[llvm] [LV]Support dropping of nneg flag for zext widencast recipes. (PR #74112)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 4 13:52:13 PST 2023


================
@@ -971,6 +985,10 @@ class VPRecipeWithIRFlags : public VPRecipeBase {
       I->setHasAllowContract(FMFs.AllowContract);
       I->setHasApproxFunc(FMFs.ApproxFunc);
       break;
+    case OperationType::CastOp:
+      if (isa<ZExtInst>(I))
+        I->setNonNeg(CastFlags.NonNeg);
----------------
fhahn wrote:

For other flags, we only set OpType if the underlying operant supports the flag, so no extra checks are needed. To be consistent with other flags, it would be good to avoid the need for checking `I` here, by having `ZExtFlags` /`ZExtOp` instead here.

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


More information about the llvm-commits mailing list