diff options
author | Evan Cheng <evan.cheng@apple.com> | 2007-10-29 07:57:50 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2007-10-29 07:57:50 +0000 |
commit | 7f152607e1b8574102205a4b93776edf23002dde (patch) | |
tree | 13eb0bf0354110ad36e97d9b8e419ca3bb8bb7c8 /lib/Target/X86/X86ISelLowering.cpp | |
parent | f8f57ee6441b7a69cd658d0b5f45c8bd07fada7b (diff) | |
download | external_llvm-7f152607e1b8574102205a4b93776edf23002dde.zip external_llvm-7f152607e1b8574102205a4b93776edf23002dde.tar.gz external_llvm-7f152607e1b8574102205a4b93776edf23002dde.tar.bz2 |
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
Diffstat (limited to 'lib/Target/X86/X86ISelLowering.cpp')
-rw-r--r-- | lib/Target/X86/X86ISelLowering.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index 172aa53..5decef2 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/lib/Target/X86/X86ISelLowering.cpp @@ -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; } |