[llvm] [InstCombine] Use disjoint flag instead of calling haveNoCommonBitsSet. (PR #74222)
via llvm-commits
llvm-commits at lists.llvm.org
Sat Dec 2 19:52:37 PST 2023
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-transforms
Author: Craig Topper (topperc)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/74222.diff
1 Files Affected:
- (modified) llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp (+1-1)
``````````diff
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
index 7379bdf93169e..481fcdf181946 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
@@ -3395,7 +3395,7 @@ Instruction *InstCombinerImpl::visitOr(BinaryOperator &I) {
// or (mul X, Y), X --> add (mul X, Y), X --> mul X, (Y + 1)
if (match(&I,
m_c_Or(m_OneUse(m_Mul(m_Value(X), m_Value(Y))), m_Deferred(X))) &&
- haveNoCommonBitsSet(Op0, Op1, DL)) {
+ cast<PossiblyDisjointInst>(I).isDisjoint()) {
Value *IncrementY = Builder.CreateAdd(Y, ConstantInt::get(Ty, 1));
return BinaryOperator::CreateMul(X, IncrementY);
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/74222
More information about the llvm-commits
mailing list