summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-07-03 18:20:14 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-07-03 18:20:14 +0000
commita122f2f51e4cc9edc5f1c4020e51909b585a0f90 (patch)
treef9bbf7acc9d080593c1c3427a22cd97f9975c626
parentcb2627395d995e7727711c3319303183cb741ef3 (diff)
downloadllvm-a122f2f51e4cc9edc5f1c4020e51909b585a0f90.tar.gz
llvm-a122f2f51e4cc9edc5f1c4020e51909b585a0f90.tar.bz2
llvm-a122f2f51e4cc9edc5f1c4020e51909b585a0f90.tar.xz
Backed out 53031.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53110 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/CodeGen/SelectionDAG.h5
-rw-r--r--lib/CodeGen/SelectionDAG/LegalizeDAG.cpp24
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAG.cpp7
3 files changed, 14 insertions, 22 deletions
diff --git a/include/llvm/CodeGen/SelectionDAG.h b/include/llvm/CodeGen/SelectionDAG.h
index 58883e5709..7ebc698bad 100644
--- a/include/llvm/CodeGen/SelectionDAG.h
+++ b/include/llvm/CodeGen/SelectionDAG.h
@@ -589,9 +589,8 @@ public:
void dump() const;
/// CreateStackTemporary - Create a stack temporary, suitable for holding the
- /// specified value type. If minAlign is specified, the slot size will have
- /// at least that alignment.
- SDOperand CreateStackTemporary(MVT VT, unsigned minAlign = 1);
+ /// specified value type.
+ SDOperand CreateStackTemporary(MVT VT);
/// FoldSetCC - Constant fold a setcc to true or false.
SDOperand FoldSetCC(MVT VT, SDOperand N1,
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index e5599b681b..c6de862514 100644
--- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -4871,41 +4871,35 @@ SDOperand SelectionDAGLegalize::EmitStackConvert(SDOperand SrcOp,
MVT SlotVT,
MVT DestVT) {
// Create the stack frame object.
- unsigned SrcAlign = TLI.getTargetData()->getPrefTypeAlignment(
- SrcOp.getValueType().getTypeForMVT());
- SDOperand FIPtr = DAG.CreateStackTemporary(SlotVT, SrcAlign);
-
+ SDOperand FIPtr = DAG.CreateStackTemporary(SlotVT);
+
FrameIndexSDNode *StackPtrFI = cast<FrameIndexSDNode>(FIPtr);
int SPFI = StackPtrFI->getIndex();
-
+
unsigned SrcSize = SrcOp.getValueType().getSizeInBits();
unsigned SlotSize = SlotVT.getSizeInBits();
unsigned DestSize = DestVT.getSizeInBits();
- const Type* SlotTy = SlotVT.getTypeForMVT();
- unsigned SlotAlign = TLI.getTargetData()->getPrefTypeAlignment(SlotTy);
// Emit a store to the stack slot. Use a truncstore if the input value is
// later than DestVT.
SDOperand Store;
-
if (SrcSize > SlotSize)
Store = DAG.getTruncStore(DAG.getEntryNode(), SrcOp, FIPtr,
- PseudoSourceValue::getFixedStack(), SPFI, SlotVT,
- false, SlotAlign);
+ PseudoSourceValue::getFixedStack(),
+ SPFI, SlotVT);
else {
assert(SrcSize == SlotSize && "Invalid store");
Store = DAG.getStore(DAG.getEntryNode(), SrcOp, FIPtr,
- PseudoSourceValue::getFixedStack(), SPFI,
- false, SlotAlign);
+ PseudoSourceValue::getFixedStack(),
+ SPFI);
}
// Result is a load from the stack slot.
if (SlotSize == DestSize)
- return DAG.getLoad(DestVT, Store, FIPtr, NULL, 0, false, SlotAlign);
+ return DAG.getLoad(DestVT, Store, FIPtr, NULL, 0);
assert(SlotSize < DestSize && "Unknown extension!");
- return DAG.getExtLoad(ISD::EXTLOAD, DestVT, Store, FIPtr, NULL, 0, SlotVT,
- false, SlotAlign);
+ return DAG.getExtLoad(ISD::EXTLOAD, DestVT, Store, FIPtr, NULL, 0, SlotVT);
}
SDOperand SelectionDAGLegalize::ExpandSCALAR_TO_VECTOR(SDNode *Node) {
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 9cce7380fc..c457c4bb76 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -1080,17 +1080,16 @@ SDOperand SelectionDAG::getMemOperand(const MachineMemOperand &MO) {
/// CreateStackTemporary - Create a stack temporary, suitable for holding the
/// specified value type.
-SDOperand SelectionDAG::CreateStackTemporary(MVT VT, unsigned minAlign) {
+SDOperand SelectionDAG::CreateStackTemporary(MVT VT) {
MachineFrameInfo *FrameInfo = getMachineFunction().getFrameInfo();
unsigned ByteSize = VT.getSizeInBits()/8;
const Type *Ty = VT.getTypeForMVT();
- unsigned StackAlign =
- std::max((unsigned)TLI.getTargetData()->getPrefTypeAlignment(Ty), minAlign);
-
+ unsigned StackAlign = (unsigned)TLI.getTargetData()->getPrefTypeAlignment(Ty);
int FrameIdx = FrameInfo->CreateStackObject(ByteSize, StackAlign);
return getFrameIndex(FrameIdx, TLI.getPointerTy());
}
+
SDOperand SelectionDAG::FoldSetCC(MVT VT, SDOperand N1,
SDOperand N2, ISD::CondCode Cond) {
// These setcc operations always fold.