forked from OSchip/llvm-project
[BypassSlowDivision] Simplify partially-tautological if statement.
if (A || (B && A)) --> if (A). llvm-svn: 287061
This commit is contained in:
parent
507013180e
commit
583b8687eb
|
@ -83,10 +83,9 @@ static bool insertFastDiv(Instruction *I, IntegerType *BypassType,
|
||||||
Value *Dividend = I->getOperand(0);
|
Value *Dividend = I->getOperand(0);
|
||||||
Value *Divisor = I->getOperand(1);
|
Value *Divisor = I->getOperand(1);
|
||||||
|
|
||||||
if (isa<ConstantInt>(Divisor) ||
|
if (isa<ConstantInt>(Divisor)) {
|
||||||
(isa<ConstantInt>(Dividend) && isa<ConstantInt>(Divisor))) {
|
// Division by a constant should have been been solved and replaced earlier
|
||||||
// Operations with immediate values should have
|
// in the pipeline.
|
||||||
// been solved and replaced during compile time.
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue