From: Justin Lebar Date: Wed, 16 Nov 2016 00:44:43 +0000 (+0000) Subject: [BypassSlowDivision] Simplify partially-tautological if statement. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c18d950852c3961fbf21865eb16de26e0a2ee614;p=llvm [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 --- diff --git a/lib/Transforms/Utils/BypassSlowDivision.cpp b/lib/Transforms/Utils/BypassSlowDivision.cpp index 0e2a4653353..d74d5299db5 100644 --- a/lib/Transforms/Utils/BypassSlowDivision.cpp +++ b/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(Divisor) || - (isa(Dividend) && isa(Divisor))) { - // Operations with immediate values should have - // been solved and replaced during compile time. + if (isa(Divisor)) { + // Division by a constant should have been been solved and replaced earlier + // in the pipeline. return false; }