aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTanya Lattner <tonic@nondot.org>2010-03-11 23:41:22 +0000
committerTanya Lattner <tonic@nondot.org>2010-03-11 23:41:22 +0000
commit2e7c26b02e1c5d76d6bf8b243daa02428c3bde81 (patch)
tree717064ab558c035a86693ae2074aacbfe51a95bd
parentacd2efdbc3bcc3dd231dfb7dba33b9d270586c05 (diff)
downloadllvm-2e7c26b02e1c5d76d6bf8b243daa02428c3bde81.zip
llvm-2e7c26b02e1c5d76d6bf8b243daa02428c3bde81.tar.gz
llvm-2e7c26b02e1c5d76d6bf8b243daa02428c3bde81.tar.bz2
Merge 98042.
Don't try to fold V_SET0 and V_SETALLONES to loads in medium and large code models. llvm-svn: 98301
-rw-r--r--llvm/lib/Target/X86/X86InstrInfo.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86InstrInfo.cpp b/llvm/lib/Target/X86/X86InstrInfo.cpp
index 39bda04..4fd91bb 100644
--- a/llvm/lib/Target/X86/X86InstrInfo.cpp
+++ b/llvm/lib/Target/X86/X86InstrInfo.cpp
@@ -2525,6 +2525,11 @@ MachineInstr* X86InstrInfo::foldMemoryOperandImpl(MachineFunction &MF,
// Folding a V_SET0 or V_SETALLONES as a load, to ease register pressure.
// Create a constant-pool entry and operands to load from it.
+ // Medium and large mode can't fold loads this way.
+ if (TM.getCodeModel() != CodeModel::Small &&
+ TM.getCodeModel() != CodeModel::Kernel)
+ return NULL;
+
// x86-32 PIC requires a PIC base register for constant pools.
unsigned PICBase = 0;
if (TM.getRelocationModel() == Reloc::PIC_) {