[PATCH] D158510: [InstCombine] Propagate nsw flag when negating

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 28 05:59:45 PDT 2023


nikic added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineNegator.cpp:241
+                             I->getName() + ".neg", /* HasNUW */ false,
+                             IsNSW && I->hasNoSignedWrap());
   }
----------------
goldstein.w.n wrote:
> Nit: I would rename `IsNSW` to `MayNSW` or `ParentNSW` as that seems to more accurately represent the usage.
The intention here was that IsNSW refers to whether the negation is nsw.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D158510/new/

https://reviews.llvm.org/D158510



More information about the llvm-commits mailing list