[llvm] [IVDesc] Check loop-preheader for loop-legality when pass-remarks enabled (PR #166310)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 3 02:41:28 PST 2026


================
@@ -1690,6 +1695,9 @@ bool InductionDescriptor::isInductionPHI(
   assert(Phi->getParent() == TheLoop->getHeader() &&
          "Invalid Phi node, not present in loop header");
 
+  if (!TheLoop->getLoopPreheader())
+    return false;
+
----------------
fhahn wrote:

move simple early exit closer to the top, possibly the first check

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


More information about the llvm-commits mailing list