aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2010-08-11 23:08:22 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2010-08-11 23:08:22 +0000
commite347dfce511cc53efc99d18809de2e154bd58717 (patch)
tree339588fc6462cbf8e92bdfd572166e2416cfebc0
parentf5e94ec0d24c92dce4f37a30173d9ff0efe55767 (diff)
downloadexternal_llvm-e347dfce511cc53efc99d18809de2e154bd58717.zip
external_llvm-e347dfce511cc53efc99d18809de2e154bd58717.tar.gz
external_llvm-e347dfce511cc53efc99d18809de2e154bd58717.tar.bz2
Fix <rdar://problem/8282498> even if it doesn't reproduce on trunk.
When a register is defined by a partial load: %reg1234:sub_32 = MOV32mr <fi#-1>; GR64:%reg1234 That load cannot be folded into an instruction using the full 64-bit register. It would become a 64-bit load. This is related to the recent change to have isLoadFromStackSlot return false on a sub-register load. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110874 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/X86/X86InstrInfo.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Target/X86/X86InstrInfo.cpp b/lib/Target/X86/X86InstrInfo.cpp
index 4ee0c0a..7d973ea 100644
--- a/lib/Target/X86/X86InstrInfo.cpp
+++ b/lib/Target/X86/X86InstrInfo.cpp
@@ -2410,6 +2410,11 @@ MachineInstr* X86InstrInfo::foldMemoryOperandImpl(MachineFunction &MF,
} else if (Ops.size() != 1)
return NULL;
+ // Make sure the subregisters match.
+ // Otherwise we risk changing the size of the load.
+ if (LoadMI->getOperand(0).getSubReg() != MI->getOperand(Ops[0]).getSubReg())
+ return NULL;
+
SmallVector<MachineOperand,X86::AddrNumOperands> MOs;
switch (LoadMI->getOpcode()) {
case X86::V_SET0PS: