summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorZi Xuan Wu <wuzish@cn.ibm.com>2019-07-02 02:54:52 +0000
committerZi Xuan Wu <wuzish@cn.ibm.com>2019-07-02 02:54:52 +0000
commit7ae536a1cedfa6095ab3c14ad876e076b6b17e9b (patch)
tree79445bebce77e76e9a7547714cdcc2c5f1767182 /llvm/lib
parentad38e58ef2412aaac7a5da1b15ca763787071742 (diff)
downloadbcm5719-llvm-7ae536a1cedfa6095ab3c14ad876e076b6b17e9b.tar.gz
bcm5719-llvm-7ae536a1cedfa6095ab3c14ad876e076b6b17e9b.zip
[DAGCombiner] Exploiting more about the transformation of TransformFPLoadStorePair function
For a given floating point load / store pair, if the load value isn't used by any other operations, then consider transforming the pair to integer load / store operations if the target deems the transformation profitable. And we can exploiting much more when there are other operation nodes with chain operand between the load/store pair so long as we keep the chain ordering original. We only replace the register used to load/store from float to integer. I only add testcase in ARM because the TLI.isDesirableToTransformToIntegerOp hook is only enabled in ARM target. Differential Revision: https://reviews.llvm.org/D60601 llvm-svn: 364883
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 54a52690012..2bfc3979360 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -14928,11 +14928,9 @@ SDValue DAGCombiner::ReduceLoadOpStoreWidth(SDNode *N) {
/// load / store operations if the target deems the transformation profitable.
SDValue DAGCombiner::TransformFPLoadStorePair(SDNode *N) {
StoreSDNode *ST = cast<StoreSDNode>(N);
- SDValue Chain = ST->getChain();
SDValue Value = ST->getValue();
if (ISD::isNormalStore(ST) && ISD::isNormalLoad(Value.getNode()) &&
- Value.hasOneUse() &&
- Chain == SDValue(Value.getNode(), 1)) {
+ Value.hasOneUse()) {
LoadSDNode *LD = cast<LoadSDNode>(Value);
EVT VT = LD->getMemoryVT();
if (!VT.isFloatingPoint() ||
@@ -14962,7 +14960,7 @@ SDValue DAGCombiner::TransformFPLoadStorePair(SDNode *N) {
LD->getPointerInfo(), LDAlign);
SDValue NewST =
- DAG.getStore(NewLD.getValue(1), SDLoc(N), NewLD, ST->getBasePtr(),
+ DAG.getStore(ST->getChain(), SDLoc(N), NewLD, ST->getBasePtr(),
ST->getPointerInfo(), STAlign);
AddToWorklist(NewLD.getNode());
OpenPOWER on IntegriCloud