diff --git a/llvm/lib/Target/RISCV/RISCVGatherScatterLowering.cpp b/llvm/lib/Target/RISCV/RISCVGatherScatterLowering.cpp index cd438e153068e..1dcb83a6078ed 100644 --- a/llvm/lib/Target/RISCV/RISCVGatherScatterLowering.cpp +++ b/llvm/lib/Target/RISCV/RISCVGatherScatterLowering.cpp @@ -250,8 +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) && - !cast(BO)->isDisjoint()) + if (!cast(BO)->isDisjoint()) return false; break; case Instruction::Add: