1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-23 21:13:02 +02:00

[BypassSlowDivision] Simplify partially-tautological if statement.

if (A || (B && A)) --> if (A).

llvm-svn: 287061
This commit is contained in:
Justin Lebar 2016-11-16 00:44:43 +00:00
parent 8adc17d24d
commit d79331f606

View File

@ -83,10 +83,9 @@ static bool insertFastDiv(Instruction *I, IntegerType *BypassType,
Value *Dividend = I->getOperand(0);
Value *Divisor = I->getOperand(1);
if (isa<ConstantInt>(Divisor) ||
(isa<ConstantInt>(Dividend) && isa<ConstantInt>(Divisor))) {
// Operations with immediate values should have
// been solved and replaced during compile time.
if (isa<ConstantInt>(Divisor)) {
// Division by a constant should have been been solved and replaced earlier
// in the pipeline.
return false;
}