In case the then-path of an if-region is empty, then merging with the else-path should be handled with the inverse of the condition (leading to that path).
Fix PR37662
Paths
| Differential D78881
[FlattenCFG] Fix `MergeIfRegion` in case then-path is empty ClosedPublic Authored by ekatz on Apr 26 2020, 9:50 AM.
Details Summary In case the then-path of an if-region is empty, then merging with the else-path should be handled with the inverse of the condition (leading to that path). Fix PR37662
Diff Detail
Event TimelineComment Actions I followed the new tests and the patch seems fine to me, but I'd rather someone else took a look too.
This revision is now accepted and ready to land.May 11 2020, 6:55 AM Comment Actions
Thanks! Comment Actions I am NOT familiar with this transformation. But I believe that the patch is well-formed, and I was able to follow the logic. The tests also demonstrate that it works as intended. LGTM. Closed by commit rG111ddc57d380: [FlattenCFG] Fix `MergeIfRegion` in case then-path is empty (authored by ekatz). · Explain WhyMay 21 2020, 4:18 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 265472 llvm/lib/Transforms/Utils/FlattenCFG.cpp
llvm/test/Transforms/Util/flattencfg.ll
|
Is there a better name for Invert2? I think until this point it's difficult to tell what it's actually for.