diff options
author | Justin Lebar <jlebar@google.com> | 2016-11-16 00:44:43 +0000 |
---|---|---|
committer | Justin Lebar <jlebar@google.com> | 2016-11-16 00:44:43 +0000 |
commit | 583b8687eb2b3de6f57da02e3a6a2181da1d3cc4 (patch) | |
tree | 96b903b11a4357a83e32fcf69ea1f21a215f2a71 /llvm/lib/Transforms/Utils/BypassSlowDivision.cpp | |
parent | 507013180edc1aaeb78cc88f238aca56ea7957b1 (diff) | |
download | bcm5719-llvm-583b8687eb2b3de6f57da02e3a6a2181da1d3cc4.tar.gz bcm5719-llvm-583b8687eb2b3de6f57da02e3a6a2181da1d3cc4.zip |
[BypassSlowDivision] Simplify partially-tautological if statement.
if (A || (B && A)) --> if (A).
llvm-svn: 287061
Diffstat (limited to 'llvm/lib/Transforms/Utils/BypassSlowDivision.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/BypassSlowDivision.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Utils/BypassSlowDivision.cpp b/llvm/lib/Transforms/Utils/BypassSlowDivision.cpp index 0e2a4653353..d74d5299db5 100644 --- a/llvm/lib/Transforms/Utils/BypassSlowDivision.cpp +++ b/llvm/lib/Transforms/Utils/BypassSlowDivision.cpp @@ -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; } |