[llvm] [InstCombine] Fold `(mul (div exact X, C0), C1)` -> `(div exact X, C0/C1)` (PR #96915)
Yingwei Zheng via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 27 20:30:35 PDT 2024
================
@@ -365,6 +365,28 @@ Instruction *InstCombinerImpl::visitMul(BinaryOperator &I) {
return BinaryOperator::CreateMul(NegOp0, X);
}
+ if (Op0->hasOneUse()) {
+ // (mul (div exact X, C0), C1)
+ // -> (div exact C0 / C1)
----------------
dtcxzyw wrote:
```suggestion
// -> (div exact X, C0 / C1)
```
https://github.com/llvm/llvm-project/pull/96915
More information about the llvm-commits
mailing list