[llvm] [CodeGen] Add nneg and disjoint flags (PR #86650)

Thorsten Schütt via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 26 06:36:54 PDT 2024


================
@@ -555,6 +555,16 @@ uint32_t MachineInstr::copyFlagsFromInstruction(const Instruction &I) {
       MIFlags |= MachineInstr::MIFlag::NoUWrap;
   }
 
+  // Copy the nonneg flag.
+  if (const PossiblyNonNegInst *PNI = dyn_cast<PossiblyNonNegInst>(&I))
+    if (PNI->hasNonNeg())
+      MIFlags |= MachineInstr::MIFlag::NonNeg;
+
+  // Copy the disjoint flag.
+  if (const PossiblyDisjointInst *PD = dyn_cast<PossiblyDisjointInst>(&I))
----------------
tschuett wrote:

I would prefer to keep it like this: for documentation and whenever the flags change again.

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


More information about the llvm-commits mailing list