diff options
author | Evan Cheng <evan.cheng@apple.com> | 2008-12-05 17:23:48 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2008-12-05 17:23:48 +0000 |
commit | f95d0fc604058938191797a54950bd2402ec8558 (patch) | |
tree | 738e743db29e1483974429976dd4c8154156f5ae /lib | |
parent | 47f45c69b69960e0eb48d7dd1054aaf6cdc9bf8b (diff) | |
download | external_llvm-f95d0fc604058938191797a54950bd2402ec8558.zip external_llvm-f95d0fc604058938191797a54950bd2402ec8558.tar.gz external_llvm-f95d0fc604058938191797a54950bd2402ec8558.tar.bz2 |
Effectively undo 60461 in PIC mode which simply transform V_SET0 / V_SETALLONES into a load from constpool in order to fold into restores. This is not safe to do when PIC base is being used for a number of reasons:
1. GlobalBaseReg may have been spilled.
2. It may not be live at the use.
3. Spiller doesn't know this is happening so it won't prevent GlobalBaseReg from being spilled later (That by itself is a nasty hack. It's needed because we don't insert the reload until later).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60595 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Target/X86/X86InstrInfo.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Target/X86/X86InstrInfo.cpp b/lib/Target/X86/X86InstrInfo.cpp index 8420445..330b4d6 100644 --- a/lib/Target/X86/X86InstrInfo.cpp +++ b/lib/Target/X86/X86InstrInfo.cpp @@ -2137,7 +2137,13 @@ MachineInstr* X86InstrInfo::foldMemoryOperandImpl(MachineFunction &MF, unsigned PICBase = 0; if (TM.getRelocationModel() == Reloc::PIC_ && !TM.getSubtarget<X86Subtarget>().is64Bit()) - PICBase = TM.getInstrInfo()->getGlobalBaseReg(&MF); + // FIXME: PICBase = TM.getInstrInfo()->getGlobalBaseReg(&MF); + // This doesn't work for several reasons. + // 1. GlobalBaseReg may have been spilled. + // 2. It may not be live at MI. + // 3. If this is used during register allocation / spilling, the spiller + // must know not to spill GlobalBaseReg (which is a temporary nasty hack). + return false; // Create a v4i32 constant-pool entry. MachineConstantPool &MCP = *MF.getConstantPool(); |