From 9edba7605e48aaf2b99cf0c8204db3fa1bd4d2f8 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 13 Jan 2006 18:00:54 +0000 Subject: [PATCH] Enable X86 support for savestack/restorestack git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25278 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/X86ISelLowering.cpp | 1 + lib/Target/X86/X86ISelPattern.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index 6a2fb684a85..776780ff531 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/lib/Target/X86/X86ISelLowering.cpp @@ -39,6 +39,7 @@ X86TargetLowering::X86TargetLowering(TargetMachine &TM) setSetCCResultType(MVT::i8); setSetCCResultContents(ZeroOrOneSetCCResult); setShiftAmountFlavor(Mask); // shl X, 32 == shl X, 0 + setStackPointerRegisterToSaveRestore(X86::ESP); // Set up the register classes. addRegisterClass(MVT::i8, X86::R8RegisterClass); diff --git a/lib/Target/X86/X86ISelPattern.cpp b/lib/Target/X86/X86ISelPattern.cpp index cb1835489c1..c5d5a26666f 100644 --- a/lib/Target/X86/X86ISelPattern.cpp +++ b/lib/Target/X86/X86ISelPattern.cpp @@ -1229,7 +1229,7 @@ unsigned ISel::SelectExpr(SDOperand N) { cast(Node->getOperand(1))->getReg() : cast(Node)->getReg(); // Just use the specified register as our input if we can. - if (MRegisterInfo::isVirtualRegister(Reg) || Reg == X86::ESP) + if (MRegisterInfo::isVirtualRegister(Reg)) return Reg; }