[llvm] [indvars] Support known positive extends in getExtendedOperandRecurrence (PR #70990)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 3 08:56:46 PDT 2023


================
@@ -1384,7 +1384,22 @@ WidenIV::getExtendedOperandRecurrence(WidenIV::NarrowIVDefUse DU) {
   else if (ExtKind == ExtendKind::Zero && OBO->hasNoUnsignedWrap())
     ExtendOperExpr = SE->getZeroExtendExpr(
       SE->getSCEV(DU.NarrowUse->getOperand(ExtendOperIdx)), WideType);
-  else
+  else if (DU.NeverNegative) {
----------------
nikic wrote:

Hm, I guess that wouldn't do the right thing if the operation is both nuw and nsw...

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


More information about the llvm-commits mailing list