diff options
| author | Dan Gohman <gohman@apple.com> | 2010-08-16 16:25:35 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2010-08-16 16:25:35 +0000 |
| commit | f29618236eec69866c1ee6200df71d89e80243a7 (patch) | |
| tree | b93cc94f8b0e2780b733b91cdba4767107c9ea89 /llvm/lib | |
| parent | 2cc136d4e3326d1505e100e86c8aa6a6a6f34ef4 (diff) | |
| download | bcm5719-llvm-f29618236eec69866c1ee6200df71d89e80243a7.tar.gz bcm5719-llvm-f29618236eec69866c1ee6200df71d89e80243a7.zip | |
Micro-optimize SCEVConstant comparison.
llvm-svn: 111142
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Analysis/ScalarEvolution.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp index 73bc8b17276..56777c3adb2 100644 --- a/llvm/lib/Analysis/ScalarEvolution.cpp +++ b/llvm/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. |

