mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 04:30:12 +00:00
Micro-optimize SCEVConstant comparison.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111142 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
2f199f9952
commit
e28d7922f7
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user