Avoid doing something dumb like rewriting using a 64-bit iv in 32-bit mode.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43446 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng 2007-10-29 07:57:50 +00:00
parent dc4756bfda
commit e127a73154

View File

@ -5125,7 +5125,11 @@ bool X86TargetLowering::isLegalAddressingMode(const AddrMode &AM,
bool X86TargetLowering::isTruncateFree(const Type *Ty1, const Type *Ty2) const {
if (!Ty1->isInteger() || !Ty2->isInteger())
return false;
return Ty1->getPrimitiveSizeInBits() > Ty2->getPrimitiveSizeInBits();
unsigned NumBits1 = Ty1->getPrimitiveSizeInBits();
unsigned NumBits2 = Ty2->getPrimitiveSizeInBits();
if (NumBits1 <= NumBits2)
return false;
return Subtarget->is64Bit() || NumBits1 < 64;
}