mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-22 23:24:59 +00:00
implement PR2328.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51176 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -3012,6 +3012,10 @@ Instruction *InstCombiner::commonDivTransforms(BinaryOperator &I) {
|
||||
Instruction *InstCombiner::commonIDivTransforms(BinaryOperator &I) {
|
||||
Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1);
|
||||
|
||||
// (sdiv X, X) --> 1 (udiv X, X) --> 1
|
||||
if (Op0 == Op1)
|
||||
return ReplaceInstUsesWith(I, ConstantInt::get(I.getType(), 1));
|
||||
|
||||
if (Instruction *Common = commonDivTransforms(I))
|
||||
return Common;
|
||||
|
||||
|
Reference in New Issue
Block a user