mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-14 00:32:55 +00:00
Call SimplifyFDivInst() in InstCombiner::visitFDiv().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124535 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
1fca2c32cc
commit
31726c154d
@ -118,6 +118,7 @@ public:
|
||||
Instruction *commonIDivTransforms(BinaryOperator &I);
|
||||
Instruction *visitUDiv(BinaryOperator &I);
|
||||
Instruction *visitSDiv(BinaryOperator &I);
|
||||
Instruction *visitFDiv(BinaryOperator &I);
|
||||
Value *FoldAndOfICmps(ICmpInst *LHS, ICmpInst *RHS);
|
||||
Value *FoldAndOfFCmps(FCmpInst *LHS, FCmpInst *RHS);
|
||||
Instruction *visitAnd(BinaryOperator &I);
|
||||
|
@ -473,6 +473,15 @@ Instruction *InstCombiner::visitSDiv(BinaryOperator &I) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
Instruction *InstCombiner::visitFDiv(BinaryOperator &I) {
|
||||
Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1);
|
||||
|
||||
if (Value *V = SimplifyFDivInst(Op0, Op1, TD))
|
||||
return ReplaceInstUsesWith(I, V);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/// This function implements the transforms on rem instructions that work
|
||||
/// regardless of the kind of rem instruction it is (urem, srem, or frem). It
|
||||
/// is used by the visitors to those instructions.
|
||||
|
Loading…
x
Reference in New Issue
Block a user