[llvm] [LoopInterchange] Extract statically bounded outer epilogues (PR #224196)

via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 20 14:40:13 PDT 2026


================

----------------
MattPD wrote:

Used a separate file so the numeric helpers can be unit-tested: llvm/unittests/Transforms/Scalar/LoopInterchangeTest.cpp includes it (via ../lib/Transforms/Scalar/LoopInterchangeUtils.h, as a few other unit tests do for lib-private headers, e.g., unittests/CodeGen/AllocationOrderTest.cpp) and covers the boundary cases that are hard to reach from IR: the INT64_MIN magnitude, mixed-width unsigned comparisons, and byte-range containment at the end of an object. A(n admittedly softer) second reason: LoopInterchange.cpp is already fairly large (about 2,700 lines on main and about 5,100 with this PR), so keeping the IR-free arithmetic out of it seemed reasonable. That said, if you'd rather avoid the extra file, I can move the four functions into LoopInterchange.cpp as static and drop the unit test; either way works for me.


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


More information about the llvm-commits mailing list