aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/ScalarEvolution.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-08-16 16:25:35 +0000
committerDan Gohman <gohman@apple.com>2010-08-16 16:25:35 +0000
commite28d7922f7a3338b1d0dfec4158584d4dd6f4031 (patch)
tree453249c75e41cebf420bcf071b7659837293b099 /lib/Analysis/ScalarEvolution.cpp
parent2f199f9952b9dd62b5a0d0f4350b8fa780ebb9cc (diff)
Micro-optimize SCEVConstant comparison.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111142 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/ScalarEvolution.cpp')
-rw-r--r--lib/Analysis/ScalarEvolution.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp
index 73bc8b1727..56777c3adb 100644
--- a/lib/Analysis/ScalarEvolution.cpp
+++ b/lib/Analysis/ScalarEvolution.cpp
@@ -590,12 +590,12 @@ namespace {
// Compare constant values.
if (const SCEVConstant *LC = dyn_cast<SCEVConstant>(LHS)) {
const SCEVConstant *RC = cast<SCEVConstant>(RHS);
- const ConstantInt *LCC = LC->getValue();
- const ConstantInt *RCC = RC->getValue();
- unsigned LBitWidth = LCC->getBitWidth(), RBitWidth = RCC->getBitWidth();
+ const APInt &LA = LC->getValue()->getValue();
+ const APInt &RA = RC->getValue()->getValue();
+ unsigned LBitWidth = LA.getBitWidth(), RBitWidth = RA.getBitWidth();
if (LBitWidth != RBitWidth)
return LBitWidth < RBitWidth;
- return LCC->getValue().ult(RCC->getValue());
+ return LA.ult(RA);
}
// Compare addrec loop depths.