[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:20:05 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:

This block of code seems like something we should have a helper for.  As a follow up, maybe factor something out of other places we do reassociation? 

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


More information about the llvm-commits mailing list