[llvm] [CVP] Infer nneg on existing zext (PR #72052)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 12 06:20:26 PST 2023


================
@@ -1032,6 +1033,24 @@ static bool processSExt(SExtInst *SDI, LazyValueInfo *LVI) {
   return true;
 }
 
+static bool processZExt(ZExtInst *SDI, LazyValueInfo *LVI) {
+  if (SDI->getType()->isVectorTy())
+    return false;
+
+  if (SDI->hasNonNeg())
+    return false;
+
+  const Use &Base = SDI->getOperandUse(0);
+  if (!LVI->getConstantRangeAtUse(Base, /*UndefAllowed*/ false)
----------------
nikic wrote:

Is there a test case covering at-use?

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


More information about the llvm-commits mailing list