[llvm] [LoopInterchange] Don't consider loops with BTC=0 (PR #167113)

Sjoerd Meijer via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 10 05:52:28 PST 2025


================
@@ -101,6 +101,12 @@ static cl::opt<unsigned int> MaxLoopNestDepth(
     "loop-interchange-max-loop-nest-depth", cl::init(10), cl::Hidden,
     cl::desc("Maximum depth of loop nest considered for the transform"));
 
+// This is mainly for testing purposes, and certain tests that rely on
+// behaviour that is more difficult to trigger otherwise.
+static cl::opt<bool> SkipLoopsWithZeroBTC(
+    "loop-interchange-skip-zero-btc", cl::init(true), cl::Hidden,
+    cl::desc("Do not consider loops with a backedge taken count of 0"));
----------------
sjoerdmeijer wrote:

Yes, exactly that. Modifying these tests isn't a straightforward fix up, and requires diving into the behaviour that they want to test and coming up with a modified or new test case. I will do that for this assert that I am trying to address in a follow up, but want to delay that for the existing test cases. 

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


More information about the llvm-commits mailing list