aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/X86/X86RegisterInfo.td
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-03-11 07:16:00 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-03-11 07:16:00 +0000
commitd121681b9257fe8993c1d84efec905d07de6b835 (patch)
tree154cf2ee6cd4bde6ced84dc7cf96fab19d41f062 /lib/Target/X86/X86RegisterInfo.td
parente2e73866e3ef3343561003e02bffd4d1082469fb (diff)
downloadexternal_llvm-d121681b9257fe8993c1d84efec905d07de6b835.zip
external_llvm-d121681b9257fe8993c1d84efec905d07de6b835.tar.gz
external_llvm-d121681b9257fe8993c1d84efec905d07de6b835.tar.bz2
In 32-bit mode, mark 64-bit GPR's as unallocatable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48217 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86RegisterInfo.td')
-rw-r--r--lib/Target/X86/X86RegisterInfo.td3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Target/X86/X86RegisterInfo.td b/lib/Target/X86/X86RegisterInfo.td
index 93d2a51..2440238 100644
--- a/lib/Target/X86/X86RegisterInfo.td
+++ b/lib/Target/X86/X86RegisterInfo.td
@@ -415,6 +415,9 @@ def GR64 : RegisterClass<"X86", [i64], 64,
GR64Class::allocation_order_end(const MachineFunction &MF) const {
const TargetMachine &TM = MF.getTarget();
const TargetRegisterInfo *RI = TM.getRegisterInfo();
+ const X86Subtarget &Subtarget = TM.getSubtarget<X86Subtarget>();
+ if (!Subtarget.is64Bit())
+ return begin(); // None of these are allocatable in 32-bit.
if (RI->hasFP(MF)) // Does the function dedicate RBP to being a frame ptr?
return end()-2; // If so, don't allocate RSP or RBP
else