summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff options
context:
space:
mode:
authorNirav Dave <niravd@google.com>2019-02-22 16:20:34 +0000
committerNirav Dave <niravd@google.com>2019-02-22 16:20:34 +0000
commit46f939c1183560064effc6b838ffdc397df265ac (patch)
treec31fb9265fa3de0d10d39d7f73393841b98e934f /llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
parent44037d7a6377ec8e5542cced73583283334b516b (diff)
downloadbcm5719-llvm-46f939c1183560064effc6b838ffdc397df265ac.tar.gz
bcm5719-llvm-46f939c1183560064effc6b838ffdc397df265ac.zip
Disable big-endian constant store merges from rL354676.
llvm-svn: 354677
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index cbaa13c55f5..c118dfffed2 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -15450,16 +15450,17 @@ SDValue DAGCombiner::visitSTORE(SDNode *N) {
if (auto *C = dyn_cast<ConstantSDNode>(Value)) {
APInt Val = C1->getAPIntValue();
APInt InsertVal = C->getAPIntValue().zextOrTrunc(STByteSize * 8);
- if (DAG.getDataLayout().isBigEndian())
- Offset = ChainByteSize - 1 - Offset;
- Val.insertBits(InsertVal, Offset * 8);
- SDValue NewSDVal =
- DAG.getConstant(Val, SDLoc(C), ChainValue.getValueType(),
- C1->isTargetOpcode(), C1->isOpaque());
- SDNode *NewST1 = DAG.UpdateNodeOperands(
- ST1, ST1->getChain(), NewSDVal, ST1->getOperand(2),
- ST1->getOperand(3));
- return CombineTo(ST, SDValue(NewST1, 0));
+ // FIXME: Handle Big-endian mode.
+ if (!DAG.getDataLayout().isBigEndian()) {
+ Val.insertBits(InsertVal, Offset * 8);
+ SDValue NewSDVal =
+ DAG.getConstant(Val, SDLoc(C), ChainValue.getValueType(),
+ C1->isTargetOpcode(), C1->isOpaque());
+ SDNode *NewST1 = DAG.UpdateNodeOperands(
+ ST1, ST1->getChain(), NewSDVal, ST1->getOperand(2),
+ ST1->getOperand(3));
+ return CombineTo(ST, SDValue(NewST1, 0));
+ }
}
}
} // End ST subset of ST1 case.
OpenPOWER on IntegriCloud