[llvm] [IR] Add nowrap flags for trunc instruction (PR #85592)

via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 22 11:05:41 PDT 2024


================
@@ -624,6 +643,13 @@ void Instruction::andIRFlags(const Value *V) {
     }
   }
 
+  if (auto *PNWI = dyn_cast<PossiblyNoWrapInst>(V)) {
+    if (isa<PossiblyNoWrapInst>(this)) {
+      setHasNoSignedWrap(hasNoSignedWrap() && PNWI->hasNoSignedWrap());
+      setHasNoUnsignedWrap(hasNoUnsignedWrap() && PNWI->hasNoUnsignedWrap());
----------------
elhewaty wrote:

@dtcxzyw @nikic 🔔 

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


More information about the llvm-commits mailing list