[llvm] [Uniformity] Fixed control-div early stop (PR #138806)

Sameer Sahasrabuddhe via llvm-commits llvm-commits at lists.llvm.org
Tue May 6 23:55:53 PDT 2025


ssahasra wrote:

Quoting the last comment from #137277 :

> Yes, setting FloorIdx to the IPD of DivTermBlock seems working. I have a similar approach (based on this IPD concept). It does not use FloorIdx, rather checking FreshLabels.count() (replacing while (true) with while (FreshLabels.count() > 1)). [ draft: https://github.com/https://github.com/llvm/llvm-project/pull/138806 ]

> But my local patch have two failures on lit tests, both are for irreducible tests. Looks to me that the irreducible cycles do not have head-rewired cycles done when doing propagation (not sure if they should be).

Correct. The analysis does not make any assumptions about how the header is connected in an irreducible cycle, and does not itself attempt any rewiring. The top of the file has a comment explaining the nature of the RPOT numbering, where we "virtually" rewire the header, but not actually in the CFG. This is why we have to separately handle cycle exit blocks.

This is why using the RPOT traversal to find the IPD might be tricky. Maybe there is a way to do it, but I have not thought about it enough yet. If we can't work with RPOT, then we will have to use fetch the postdom analysis, which is kinda expensive.

https://github.com/llvm/llvm-project/pull/138806


More information about the llvm-commits mailing list