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

llvm-svn: 43446
This commit is contained in:
Evan Cheng 2007-10-29 07:57:50 +00:00
parent 18acd44514
commit 7b3f7feaea
1 changed files with 5 additions and 1 deletions

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;
}