[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 02:49:54 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:
I agree that this option ideally shouldn't exist. I will clarify that in the comment. The point is that are a couple of current tests that test some corner cases, which we wouldn't test anymore as they would now be rejected for interchange. Thus, keeping the behaviour with this option is easier than re-architecting the tests. But I will follow up on this as I am going to see if I can trigger the assert in different ways.
https://github.com/llvm/llvm-project/pull/167113
More information about the llvm-commits
mailing list