summaryrefslogtreecommitdiffstats
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2009-07-11 00:11:07 +0000
committerEli Friedman <eli.friedman@gmail.com>2009-07-11 00:11:07 +0000
commitaad3460086a1b29c55f7490c6d8743ea4e53f07d (patch)
tree0bc9515607cc24e6bb9b208ee2423996798cfd77 /lib/CodeGen
parentebfc177b59c0bda0c2cb54f3f64dce7ee0fa4df2 (diff)
downloadexternal_llvm-aad3460086a1b29c55f7490c6d8743ea4e53f07d.zip
external_llvm-aad3460086a1b29c55f7490c6d8743ea4e53f07d.tar.gz
external_llvm-aad3460086a1b29c55f7490c6d8743ea4e53f07d.tar.bz2
Use CreateStackStoreLoad helper in more places.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75320 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp14
-rw-r--r--lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp26
2 files changed, 4 insertions, 36 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp b/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
index 958f72d..9244654 100644
--- a/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
+++ b/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
@@ -211,18 +211,8 @@ SDValue DAGTypeLegalizer::PromoteIntRes_BIT_CONVERT(SDNode *N) {
return DAG.getNode(ISD::BIT_CONVERT, dl, OutVT, GetWidenedVector(InOp));
}
- // Otherwise, lower the bit-convert to a store/load from the stack.
- // Create the stack frame object. Make sure it is aligned for both
- // the source and destination types.
- SDValue FIPtr = DAG.CreateStackTemporary(InVT, OutVT);
- int FI = cast<FrameIndexSDNode>(FIPtr.getNode())->getIndex();
- const Value *SV = PseudoSourceValue::getFixedStack(FI);
-
- // Emit a store to the stack slot.
- SDValue Store = DAG.getStore(DAG.getEntryNode(), dl, InOp, FIPtr, SV, 0);
-
- // Result is an extending load from the stack slot.
- return DAG.getExtLoad(ISD::EXTLOAD, dl, NOutVT, Store, FIPtr, SV, 0, OutVT);
+ return DAG.getNode(ISD::ANY_EXTEND, dl, NOutVT,
+ CreateStackStoreLoad(InOp, OutVT));
}
SDValue DAGTypeLegalizer::PromoteIntRes_BSWAP(SDNode *N) {
diff --git a/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp b/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
index 0b64446..8bec4c7 100644
--- a/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
+++ b/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
@@ -1374,18 +1374,7 @@ SDValue DAGTypeLegalizer::WidenVecRes_BIT_CONVERT(SDNode *N) {
}
}
- // This should occur rarely. Lower the bit-convert to a store/load
- // from the stack. Create the stack frame object. Make sure it is aligned
- // for both the source and destination types.
- SDValue FIPtr = DAG.CreateStackTemporary(InVT, WidenVT);
- int FI = cast<FrameIndexSDNode>(FIPtr.getNode())->getIndex();
- const Value *SV = PseudoSourceValue::getFixedStack(FI);
-
- // Emit a store to the stack slot.
- SDValue Store = DAG.getStore(DAG.getEntryNode(), dl, InOp, FIPtr, SV, 0);
-
- // Result is a load from the stack slot.
- return DAG.getLoad(WidenVT, dl, Store, FIPtr, SV, 0);
+ return CreateStackStoreLoad(InOp, WidenVT);
}
SDValue DAGTypeLegalizer::WidenVecRes_BUILD_VECTOR(SDNode *N) {
@@ -1867,18 +1856,7 @@ SDValue DAGTypeLegalizer::WidenVecOp_BIT_CONVERT(SDNode *N) {
}
}
- // Lower the bit-convert to a store/load from the stack. Create the stack
- // frame object. Make sure it is aligned for both the source and destination
- // types.
- SDValue FIPtr = DAG.CreateStackTemporary(InWidenVT, VT);
- int FI = cast<FrameIndexSDNode>(FIPtr.getNode())->getIndex();
- const Value *SV = PseudoSourceValue::getFixedStack(FI);
-
- // Emit a store to the stack slot.
- SDValue Store = DAG.getStore(DAG.getEntryNode(), dl, InOp, FIPtr, SV, 0);
-
- // Result is a load from the stack slot.
- return DAG.getLoad(VT, dl, Store, FIPtr, SV, 0);
+ return CreateStackStoreLoad(InOp, VT);
}
SDValue DAGTypeLegalizer::WidenVecOp_CONCAT_VECTORS(SDNode *N) {