================
@@ -2111,6 +2111,8 @@ static bool foldURemOfLoopIncrement(Instruction *Rem, 
const DataLayout *DL,
   Value *RemCmp = Builder.CreateICmp(ICmpInst::ICMP_EQ, RemAdd, RemAmt);
   Value *RemSel =
       Builder.CreateSelect(RemCmp, Constant::getNullValue(Ty), RemAdd);
+  if (auto *SI = dyn_cast<SelectInst>(RemSel))
----------------
boomanaiden154 wrote:

This isn't a null check. We're checking the loop IV is equal to some condition, 
and that condition might be runtime unknown. There's no way to infer what side 
is more likely in the general case.

SCEV might be able to help in some cases, but it's not already computed inside 
CGP so the compile-time cost is likely prohibitive.

https://github.com/llvm/llvm-project/pull/238967
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to