mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-06 04:31:08 +00:00
When moving zext/sext to be folded with a load, ignore the issue of whether
truncates are free only in the case where the extended type is legal but the load type is not. If both types are illegal, such as when they are too big, the load may not be legalized into an extended load. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114568 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
00d01f1a42
commit
ec57a1acec
@ -772,7 +772,8 @@ bool CodeGenPrepare::MoveExtToFormExtLoad(Instruction *I) {
|
||||
// If the load has other users and the truncate is not free, this probably
|
||||
// isn't worthwhile.
|
||||
if (!LI->hasOneUse() &&
|
||||
TLI && TLI->isTypeLegal(TLI->getValueType(LI->getType())) &&
|
||||
TLI && (TLI->isTypeLegal(TLI->getValueType(LI->getType())) ||
|
||||
!TLI->isTypeLegal(TLI->getValueType(I->getType()))) &&
|
||||
!TLI->isTruncateFree(I->getType(), LI->getType()))
|
||||
return false;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user