summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2015-09-21 15:59:46 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2015-09-21 15:59:46 +0000
commitb774834429430885d62835a9a60d58308dd72a88 (patch)
treea6acbc0a9ad62d0ec719a78c1a2a5daac1a7f227 /llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
parenta30ddb652419290b65f4ce8dafdd170c8098ddd7 (diff)
downloadbcm5719-llvm-b774834429430885d62835a9a60d58308dd72a88.tar.gz
bcm5719-llvm-b774834429430885d62835a9a60d58308dd72a88.zip
DAGCombiner: Replace store of FP constant after attemping store merges
If storing multiple FP constants, some subset of the stores would be replaced with integers due to visit order, so MergeConsecutiveStores would only partially merge these. llvm-svn: 248169
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 5c4110276cd..24627bcfcad 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -11485,16 +11485,6 @@ SDValue DAGCombiner::visitSTORE(SDNode *N) {
if (Value.getOpcode() == ISD::UNDEF && ST->isUnindexed())
return Chain;
- // Turn 'store float 1.0, Ptr' -> 'store int 0x12345678, Ptr'
- //
- // Make sure to do this only after attempting to merge stores in order to
- // avoid changing the types of some subset of stores due to visit order,
- // preventing their merging.
- if (isa<ConstantFPSDNode>(Value)) {
- if (SDValue NewSt = replaceStoreOfFPConstant(ST))
- return NewSt;
- }
-
// Try to infer better alignment information than the store already has.
if (OptLevel != CodeGenOpt::None && ST->isUnindexed()) {
if (unsigned Align = DAG.InferPtrAlignment(Ptr)) {
@@ -11618,6 +11608,16 @@ SDValue DAGCombiner::visitSTORE(SDNode *N) {
return SDValue(N, 0);
}
+ // Turn 'store float 1.0, Ptr' -> 'store int 0x12345678, Ptr'
+ //
+ // Make sure to do this only after attempting to merge stores in order to
+ // avoid changing the types of some subset of stores due to visit order,
+ // preventing their merging.
+ if (isa<ConstantFPSDNode>(Value)) {
+ if (SDValue NewSt = replaceStoreOfFPConstant(ST))
+ return NewSt;
+ }
+
return ReduceLoadOpStoreWidth(N);
}
OpenPOWER on IntegriCloud