llvm-project
649ef149 - [CIR] Narrow region successors for constant conditions (#243490)

Commit
2 days ago
[CIR] Narrow region successors for constant conditions (#243490) `cir.if`: implement getEntrySuccessorRegions such that a constant condition enters only the selected region, or goes straight to the parent when it is false and there is no else region. `cir.condition`: narrows its successors the same way. In a loop, true only enters the body and false only reaches the cleanup region, or the parent when there is none. In the ready region of a cir.await, true only resumes and false only suspends. This lets generic region-branch clients such as dead code analysis and SCCP prune regions behind constant conditions, and prepares the function exit analysis (https://github.com/llvm/llvm-project/pull/239774) to rely on the interfaces instead of decoding each op.
Author
Parents
Loading