]> granicus.if.org Git - llvm/commitdiff
[BypassSlowDivision] Simplify partially-tautological if statement.
authorJustin Lebar <jlebar@google.com>
Wed, 16 Nov 2016 00:44:43 +0000 (00:44 +0000)
committerJustin Lebar <jlebar@google.com>
Wed, 16 Nov 2016 00:44:43 +0000 (00:44 +0000)
if (A || (B && A)) --> if (A).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287061 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Utils/BypassSlowDivision.cpp

index 0e2a46533532dfba3c85eb6044142ed867ba5ac7..d74d5299db524a6fc6a74448d6178c0a8a0fb1e8 100644 (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;
   }