summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-05-05 19:39:05 +0000
committerChris Lattner <sabre@nondot.org>2007-05-05 19:39:05 +0000
commitb464c446791f03cd8abc0b55bab4d472de534218 (patch)
treecaa7608198f2cbdd15fd34abbc96501aeb44653b /lib
parent09d933fdbdea4a2f282d6e7c2ae7f85e46d02d35 (diff)
downloadllvm-b464c446791f03cd8abc0b55bab4d472de534218.tar.gz
llvm-b464c446791f03cd8abc0b55bab4d472de534218.tar.bz2
llvm-b464c446791f03cd8abc0b55bab4d472de534218.tar.xz
Propagate alignment/volatility in two places.
Implement support for expanding a bitcast from an illegal vector type to a legal one (e.g. 4xi32 -> 4xf32 in SSE1). This fixes PR1371 and CodeGen/X86/2007-05-05-VecCastExpand.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36787 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/SelectionDAG/LegalizeDAG.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index cc8cc61cb1..26ce7b9470 100644
--- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -1881,7 +1881,8 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
}
Lo = DAG.getStore(Tmp1, Lo, Tmp2, ST->getSrcValue(),
- ST->getSrcValueOffset());
+ ST->getSrcValueOffset(), ST->isVolatile(),
+ ST->getAlignment());
if (Hi.Val == NULL) {
// Must be int <-> float one-to-one expansion.
@@ -1896,7 +1897,8 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
// FIXME: This sets the srcvalue of both halves to be the same, which is
// wrong.
Hi = DAG.getStore(Tmp1, Hi, Tmp2, ST->getSrcValue(),
- ST->getSrcValueOffset());
+ ST->getSrcValueOffset(), ST->isVolatile(),
+ std::min(ST->getAlignment(), IncrementSize));
Result = DAG.getNode(ISD::TokenFactor, MVT::Other, Lo, Hi);
break;
}
@@ -5667,8 +5669,18 @@ SDOperand SelectionDAGLegalize::PackVectorOp(SDOperand Op,
PackVectorOp(Node->getOperand(0), EVT));
break;
} else {
- // FIXME: UNIMP!
- assert(0 && "Cast from unsupported vector type not implemented yet!");
+ // If the input vector type isn't legal, then go through memory.
+ SDOperand Ptr = CreateStackTemporary(NewVT);
+ // Get the alignment for the store.
+ const TargetData &TD = *TLI.getTargetData();
+ unsigned Align =
+ TD.getABITypeAlignment(MVT::getTypeForValueType(NewVT));
+
+ SDOperand St = DAG.getStore(DAG.getEntryNode(),
+ Node->getOperand(0), Ptr, NULL, 0, false,
+ Align);
+ Result = DAG.getLoad(NewVT, St, Ptr, 0, 0);
+ break;
}
}
break;