mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-07-22 09:29:31 +00:00
[CodeGenPrepare] Use variables for reused values. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223491 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
fba13406e2
commit
bf6e012f8e
@ -2962,11 +2962,13 @@ bool CodeGenPrepare::MoveExtToFormExtLoad(Instruction *I) {
|
|||||||
if (LI->getParent() == I->getParent())
|
if (LI->getParent() == I->getParent())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
EVT VT = TLI->getValueType(I->getType());
|
||||||
|
EVT LoadVT = TLI->getValueType(LI->getType());
|
||||||
|
|
||||||
// If the load has other users and the truncate is not free, this probably
|
// If the load has other users and the truncate is not free, this probably
|
||||||
// isn't worthwhile.
|
// isn't worthwhile.
|
||||||
if (!LI->hasOneUse() &&
|
if (!LI->hasOneUse() && TLI &&
|
||||||
TLI && (TLI->isTypeLegal(TLI->getValueType(LI->getType())) ||
|
(TLI->isTypeLegal(LoadVT) || !TLI->isTypeLegal(VT)) &&
|
||||||
!TLI->isTypeLegal(TLI->getValueType(I->getType()))) &&
|
|
||||||
!TLI->isTruncateFree(I->getType(), LI->getType()))
|
!TLI->isTruncateFree(I->getType(), LI->getType()))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -2978,7 +2980,7 @@ bool CodeGenPrepare::MoveExtToFormExtLoad(Instruction *I) {
|
|||||||
assert(isa<SExtInst>(I) && "Unexpected ext type!");
|
assert(isa<SExtInst>(I) && "Unexpected ext type!");
|
||||||
LType = ISD::SEXTLOAD;
|
LType = ISD::SEXTLOAD;
|
||||||
}
|
}
|
||||||
if (TLI && !TLI->isLoadExtLegal(LType, TLI->getValueType(LI->getType())))
|
if (TLI && !TLI->isLoadExtLegal(LType, LoadVT))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Move the extend into the same block as the load, so that SelectionDAG
|
// Move the extend into the same block as the load, so that SelectionDAG
|
||||||
|
Loading…
Reference in New Issue
Block a user