mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-21 03:32:21 +00:00
Fix PR3795: Apply Dan's suggested fix for
ARMTargetLowering::isLegalAddressingMode. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68619 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
47a4edccb0
commit
2c7dab1864
@ -1759,7 +1759,8 @@ static bool isLegalAddressImmediate(int64_t V, MVT VT,
|
|||||||
/// by AM is legal for this target, for a load/store of the specified type.
|
/// by AM is legal for this target, for a load/store of the specified type.
|
||||||
bool ARMTargetLowering::isLegalAddressingMode(const AddrMode &AM,
|
bool ARMTargetLowering::isLegalAddressingMode(const AddrMode &AM,
|
||||||
const Type *Ty) const {
|
const Type *Ty) const {
|
||||||
if (!isLegalAddressImmediate(AM.BaseOffs, getValueType(Ty, true), Subtarget))
|
MVT VT = getValueType(Ty, true);
|
||||||
|
if (!isLegalAddressImmediate(AM.BaseOffs, VT, Subtarget))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Can never fold addr of global into load/store.
|
// Can never fold addr of global into load/store.
|
||||||
@ -1778,8 +1779,11 @@ bool ARMTargetLowering::isLegalAddressingMode(const AddrMode &AM,
|
|||||||
if (AM.BaseOffs)
|
if (AM.BaseOffs)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (!VT.isSimple())
|
||||||
|
return false;
|
||||||
|
|
||||||
int Scale = AM.Scale;
|
int Scale = AM.Scale;
|
||||||
switch (getValueType(Ty).getSimpleVT()) {
|
switch (VT.getSimpleVT()) {
|
||||||
default: return false;
|
default: return false;
|
||||||
case MVT::i1:
|
case MVT::i1:
|
||||||
case MVT::i8:
|
case MVT::i8:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user