[llvm] [LoopInfo] Derive Loop::contains(BlockT*) from the block-to-loop map (PR #207613)

Alexis Engelke via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 5 22:56:05 PDT 2026


https://github.com/aengelke commented:

Code looks good, but this makes Loop::contains(Block) O(n) instead of O(1). I'm a bit worried about somewhat deeply nested loops with a lot of contains() queries, I feel this might cause regressions in some cases?

(Unlikely in the common case... and for very deeply nested loops, LoopInfo is O(n^3) already... maybe this is not too relevant in practice.)

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


More information about the llvm-commits mailing list