[llvm] [RISCV] Handle disjoint or in RISCVGatherScatterLowering (PR #77800)

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 11 10:12:56 PST 2024


================
@@ -241,7 +250,7 @@ bool RISCVGatherScatterLowering::matchStridedRecurrence(Value *Index, Loop *L,
     return false;
   case Instruction::Or:
     // We need to be able to treat Or as Add.
-    if (!haveNoCommonBitsSet(BO->getOperand(0), BO->getOperand(1), *DL))
+    if (!cast<PossiblyDisjointInst>(BO)->isDisjoint())
----------------
preames wrote:

Very minor, but would you mind landing this as two patches.

Patch 1 - Add the disjoint or handling, but leave the haveNoCommonBitsSet case.
Patch 2 - Drop the haveNoCommonBitsSet

If dropping it exposes some missing inference case, I want the second to be easily revertable without taking out the rest of your change.

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


More information about the llvm-commits mailing list