summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff options
context:
space:
mode:
authorWei Mi <wmi@google.com>2016-12-22 19:38:22 +0000
committerWei Mi <wmi@google.com>2016-12-22 19:38:22 +0000
commitf3f01aba48188c06d267aa270bdcc5f2eb502caf (patch)
tree68fa8fd8fbc24980b77b0acd6e08a618d6cc64cc /llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
parentfe8bbb2333108c3a7a922dbb44d23fc66c3f76ab (diff)
downloadbcm5719-llvm-f3f01aba48188c06d267aa270bdcc5f2eb502caf.tar.gz
bcm5719-llvm-f3f01aba48188c06d267aa270bdcc5f2eb502caf.zip
Change the interface of TLI.isMultiStoresCheaperThanBitsMerge.
This is for splitMergedValStore in DAG Combine to share the target query interface with similar logic in CodeGenPrepare. Differential Revision: https://reviews.llvm.org/D24707 llvm-svn: 290363
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index a91e727130d..1d28124ce7a 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -12435,8 +12435,15 @@ SDValue DAGCombiner::splitMergedValStore(StoreSDNode *ST) {
Hi.getOperand(0).getValueSizeInBits() > HalfValBitSize)
return SDValue();
- if (!TLI.isMultiStoresCheaperThanBitsMerge(Lo.getOperand(0),
- Hi.getOperand(0)))
+ // Use the EVT of low and high parts before bitcast as the input
+ // of target query.
+ EVT LowTy = (Lo.getOperand(0).getOpcode() == ISD::BITCAST)
+ ? Lo.getOperand(0).getValueType()
+ : Lo.getValueType();
+ EVT HighTy = (Hi.getOperand(0).getOpcode() == ISD::BITCAST)
+ ? Hi.getOperand(0).getValueType()
+ : Hi.getValueType();
+ if (!TLI.isMultiStoresCheaperThanBitsMerge(LowTy, HighTy))
return SDValue();
// Start to split store.
OpenPOWER on IntegriCloud