[llvm-commits] CVS: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp X86ISelLowering.cpp X86ISelPattern.cpp
Chris Lattner
lattner at cs.uiuc.edu
Sun Jan 15 01:00:33 PST 2006
Changes in directory llvm/lib/Target/X86:
X86ISelDAGToDAG.cpp updated: 1.31 -> 1.32
X86ISelLowering.cpp updated: 1.41 -> 1.42
X86ISelPattern.cpp updated: 1.197 -> 1.198
---
Log message:
Use the default lowering of ISD::DYNAMIC_STACKALLOC, delete now dead code.
---
Diffs of the changes: (+4 -84)
X86ISelDAGToDAG.cpp | 40 ----------------------------------------
X86ISelLowering.cpp | 7 ++++---
X86ISelPattern.cpp | 41 -----------------------------------------
3 files changed, 4 insertions(+), 84 deletions(-)
Index: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
diff -u llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.31 llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.32
--- llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.31 Sat Jan 14 14:11:13 2006
+++ llvm/lib/Target/X86/X86ISelDAGToDAG.cpp Sun Jan 15 03:00:21 2006
@@ -700,46 +700,6 @@
Base, Scale, Index, Disp, Chain);
return Chain;
}
-
- case ISD::DYNAMIC_STACKALLOC: {
- SDOperand Chain = N.getOperand(0);
- SDOperand Size = N.getOperand(1);
- SDOperand Align = N.getOperand(2);
-
- // FIXME: We are currently ignoring the requested alignment for handling
- // greater than the stack alignment. This will need to be revisited at
- // some point.
- if (!isa<ConstantSDNode>(Align) ||
- cast<ConstantSDNode>(Align)->getValue() != 0) {
- std::cerr << "Cannot allocate stack object with greater alignment than"
- << " the stack alignment yet!";
- abort();
- }
-
- // FIXME: This produces crappy code. Lots of unnecessary MOV32rr to and
- // from ESP.
- SDOperand InFlag;
- SDOperand SPVal = CurDAG->getCopyFromReg(Chain, X86::ESP, MVT::i32, InFlag);
- Chain = SPVal.getValue(1);
- InFlag = SPVal.getValue(2);
-
- SDOperand Result = Select(CurDAG->getNode(X86ISD::SUB_FLAG, MVT::i32,
- SPVal, Size, InFlag));
- InFlag = Result.getValue(1);
-
- // Force the result back into ESP.
- Chain = CurDAG->getCopyToReg(Chain,
- CurDAG->getRegister(X86::ESP, MVT::i32),
- Result, InFlag);
- InFlag = Chain.getValue(1);
-
- // Copy the result back from ESP.
- Result = CurDAG->getCopyFromReg(Chain, X86::ESP, MVT::i32, InFlag);
-
- CodeGenMap[N.getValue(0)] = Result;
- CodeGenMap[N.getValue(1)] = Result.getValue(1);
- return Result.getValue(N.ResNo);
- }
}
return SelectCode(N);
Index: llvm/lib/Target/X86/X86ISelLowering.cpp
diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.41 llvm/lib/Target/X86/X86ISelLowering.cpp:1.42
--- llvm/lib/Target/X86/X86ISelLowering.cpp:1.41 Fri Jan 13 21:14:10 2006
+++ llvm/lib/Target/X86/X86ISelLowering.cpp Sun Jan 15 03:00:21 2006
@@ -162,9 +162,10 @@
setOperationAction(ISD::DEBUG_LOC, MVT::Other, Expand);
setOperationAction(ISD::DEBUG_LABEL, MVT::Other, Expand);
- // Not implemented yet.
- setOperationAction(ISD::STACKSAVE, MVT::Other, Expand);
- setOperationAction(ISD::STACKRESTORE, MVT::Other, Expand);
+ // Expand to the default code.
+ setOperationAction(ISD::STACKSAVE, MVT::Other, Expand);
+ setOperationAction(ISD::STACKRESTORE, MVT::Other, Expand);
+ setOperationAction(ISD::DYNAMIC_STACKALLOC, MVT::i32 , Expand);
if (X86ScalarSSE) {
// Set up the FP register classes.
Index: llvm/lib/Target/X86/X86ISelPattern.cpp
diff -u llvm/lib/Target/X86/X86ISelPattern.cpp:1.197 llvm/lib/Target/X86/X86ISelPattern.cpp:1.198
--- llvm/lib/Target/X86/X86ISelPattern.cpp:1.197 Fri Jan 13 14:19:44 2006
+++ llvm/lib/Target/X86/X86ISelPattern.cpp Sun Jan 15 03:00:21 2006
@@ -2386,46 +2386,6 @@
return Result;
}
- case ISD::DYNAMIC_STACKALLOC:
- // Generate both result values.
- if (Result != 1)
- ExprMap[N.getValue(1)] = 1; // Generate the token
- else
- Result = ExprMap[N.getValue(0)] = MakeReg(N.getValue(0).getValueType());
-
- // FIXME: We are currently ignoring the requested alignment for handling
- // greater than the stack alignment. This will need to be revisited at some
- // point. Align = N.getOperand(2);
-
- if (!isa<ConstantSDNode>(N.getOperand(2)) ||
- cast<ConstantSDNode>(N.getOperand(2))->getValue() != 0) {
- std::cerr << "Cannot allocate stack object with greater alignment than"
- << " the stack alignment yet!";
- abort();
- }
-
- if (ConstantSDNode *CN = dyn_cast<ConstantSDNode>(N.getOperand(1))) {
- Select(N.getOperand(0));
- BuildMI(BB, X86::SUB32ri, 2, X86::ESP).addReg(X86::ESP)
- .addImm(CN->getValue());
- } else {
- if (getRegPressure(N.getOperand(0)) > getRegPressure(N.getOperand(1))) {
- Select(N.getOperand(0));
- Tmp1 = SelectExpr(N.getOperand(1));
- } else {
- Tmp1 = SelectExpr(N.getOperand(1));
- Select(N.getOperand(0));
- }
-
- // Subtract size from stack pointer, thereby allocating some space.
- BuildMI(BB, X86::SUB32rr, 2, X86::ESP).addReg(X86::ESP).addReg(Tmp1);
- }
-
- // Put a pointer to the space into the result register, by copying the stack
- // pointer.
- BuildMI(BB, X86::MOV32rr, 1, Result).addReg(X86::ESP);
- return Result;
-
case X86ISD::TAILCALL:
case X86ISD::CALL: {
// The chain for this call is now lowered.
@@ -3295,7 +3255,6 @@
case ISD::EXTLOAD:
case ISD::SEXTLOAD:
case ISD::ZEXTLOAD:
- case ISD::DYNAMIC_STACKALLOC:
case X86ISD::TAILCALL:
case X86ISD::CALL:
ExprMap.erase(N);
More information about the llvm-commits
mailing list