|
|
97e156a |
From af4d115e2c9c4cfd8b099aaef9a13c2972c36272 Mon Sep 17 00:00:00 2001
|
|
|
97e156a |
From: Tom Stellard <thomas.stellard@amd.com>
|
|
|
97e156a |
Date: Thu, 6 Dec 2012 18:05:30 +0000
|
|
|
97e156a |
Subject: [PATCH] LegalizeDAG: Allow type promotion for scalar stores
|
|
|
97e156a |
|
|
|
97e156a |
---
|
|
|
97e156a |
lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 7 ++++---
|
|
|
97e156a |
1 file changed, 4 insertions(+), 3 deletions(-)
|
|
|
97e156a |
|
|
|
97e156a |
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
|
|
|
97e156a |
index abf40b7..9946694 100644
|
|
|
97e156a |
--- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
|
|
|
97e156a |
+++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
|
|
|
97e156a |
@@ -731,9 +731,10 @@ void SelectionDAGLegalize::LegalizeStoreOps(SDNode *Node) {
|
|
|
97e156a |
return;
|
|
|
97e156a |
}
|
|
|
97e156a |
case TargetLowering::Promote: {
|
|
|
97e156a |
- assert(VT.isVector() && "Unknown legal promote case!");
|
|
|
97e156a |
- Value = DAG.getNode(ISD::BITCAST, dl,
|
|
|
97e156a |
- TLI.getTypeToPromoteTo(ISD::STORE, VT), Value);
|
|
|
97e156a |
+ EVT NVT = TLI.getTypeToPromoteTo(ISD::STORE, VT);
|
|
|
97e156a |
+ assert(NVT.getSizeInBits() == VT.getSizeInBits() &&
|
|
|
97e156a |
+ "Can only promote stores to same size type");
|
|
|
97e156a |
+ Value = DAG.getNode(ISD::BITCAST, dl, NVT, Value);
|
|
|
97e156a |
SDValue Result =
|
|
|
97e156a |
DAG.getStore(Chain, dl, Value, Ptr,
|
|
|
97e156a |
ST->getPointerInfo(), isVolatile,
|
|
|
97e156a |
--
|
|
|
97e156a |
1.7.11.4
|
|
|
97e156a |
|