summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2017-06-07 07:40:37 +0000
committerCraig Topper <craig.topper@gmail.com>2017-06-07 07:40:37 +0000
commit73ba1c84beadc3dfc6cf11fc971d97eba48c956e (patch)
tree30a24b6376062d7af27f4b025ca9fff592584989 /llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
parent29c282eac8840e461d14c157fd3529e2adb513e9 (diff)
downloadbcm5719-llvm-73ba1c84beadc3dfc6cf11fc971d97eba48c956e.tar.gz
bcm5719-llvm-73ba1c84beadc3dfc6cf11fc971d97eba48c956e.zip
[InstCombine][InstSimplify] Use APInt::isNullValue/isOneValue to reduce compiled code for comparing APInts with 0 and 1. NFC
These methods are specifically optimized to only counting leading zeros without an additional uint64_t compare. llvm-svn: 304876
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp b/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
index 4d408359eee..2fcfe464bbd 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
@@ -930,7 +930,7 @@ Instruction *InstCombiner::commonIDivTransforms(BinaryOperator &I) {
}
}
- if (*C2 != 0) // avoid X udiv 0
+ if (!C2->isNullValue()) // avoid X udiv 0
if (Instruction *FoldedDiv = foldOpWithConstantIntoOperand(I))
return FoldedDiv;
}
OpenPOWER on IntegriCloud