mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-10 14:10:58 +00:00
[BypassSlowDivision] Simplify partially-tautological if statement.
if (A || (B && A)) --> if (A). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287061 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d0211181aa
commit
c18d950852
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user