-
Notifications
You must be signed in to change notification settings - Fork 15.4k
Description
This issue originates from PR #142124. Currently, the canonicalizer is the most widely used approach for testing folders. However, when people want to test the specific behavior of a folder, such as ensuring its efficiency, the canonicalizer seems somewhat inappropriate because it will repeatedly apply the folder until the corresponding op can no longer be folded. I have tried the max-iterations option, but it doesn't seem to work for folding. The reason might be in this code - when an op is folded in place, it gets re-added to the worklist, so it can still be folded multiple times within a single iteration.
if (foldResults.empty()) {
// Op was modified in-place.
notifyOperationModified(op);PR #142124 worked around this testing issue by renaming the existing TestConstantFold pass to TestSingleFold. But I'm wondering if there are better ways to achieve the "fold once" purpose. Any thoughts or suggestions on would be greatly appreciated.