LegalizeDAG: Allow type promotion for scalar stores

llvm-svn: 169772
This commit is contained in:
Tom Stellard 2012-12-10 21:41:54 +00:00
parent 07df5ac1a1
commit b785bd776c
1 changed files with 4 additions and 3 deletions

View File

@ -731,9 +731,10 @@ void SelectionDAGLegalize::LegalizeStoreOps(SDNode *Node) {
return;
}
case TargetLowering::Promote: {
assert(VT.isVector() && "Unknown legal promote case!");
Value = DAG.getNode(ISD::BITCAST, dl,
TLI.getTypeToPromoteTo(ISD::STORE, VT), Value);
EVT NVT = TLI.getTypeToPromoteTo(ISD::STORE, VT);
assert(NVT.getSizeInBits() == VT.getSizeInBits() &&
"Can only promote stores to same size type");
Value = DAG.getNode(ISD::BITCAST, dl, NVT, Value);
SDValue Result =
DAG.getStore(Chain, dl, Value, Ptr,
ST->getPointerInfo(), isVolatile,