[llvm] [LICM] Preserve Disjoint flag on OR when hoisting. (PR #140266)

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Fri May 16 08:44:46 PDT 2025


================
@@ -2877,6 +2877,12 @@ static bool hoistBOAssociation(Instruction &I, Loop &L,
     if (auto *I = dyn_cast<Instruction>(Inv))
       I->setFastMathFlags(Intersect);
     NewBO->setFastMathFlags(Intersect);
+  } else if (Opcode == Instruction::Or) {
----------------
preames wrote:

Actually, unless I'm missing something, Reassociate.cpp has the same problem of dropping disjoint flags.  Note that there is the existing OverflowTracking helper, which might serve as a starting place for the API.

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


More information about the llvm-commits mailing list