diff options
author | Dan Gohman <gohman@apple.com> | 2010-09-02 21:18:42 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-09-02 21:18:42 +0000 |
commit | 24bde5bce192119ee0fc4f94ef8757fd4031e5f6 (patch) | |
tree | 33efa1083f81d0600127fc08d38b6aac0ff7d819 /lib/CodeGen/SelectionDAG | |
parent | 8e741ed2fa16f46ab586bf3a54526cd9c2338c5b (diff) | |
download | external_llvm-24bde5bce192119ee0fc4f94ef8757fd4031e5f6.zip external_llvm-24bde5bce192119ee0fc4f94ef8757fd4031e5f6.tar.gz external_llvm-24bde5bce192119ee0fc4f94ef8757fd4031e5f6.tar.bz2 |
Don't narrow the load and store in a load+twiddle+store sequence unless
there are clearly no stores between the load and the store. This fixes
this miscompile reported as PR7833.
This breaks the test/CodeGen/X86/narrow_op-2.ll optimization, which is
safe, but awkward to prove safe. Move it to X86's README.txt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112861 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG')
-rw-r--r-- | lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 7ffbf8d..c9c4d91 100644 --- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -5798,7 +5798,8 @@ SDValue DAGCombiner::ReduceLoadOpStoreWidth(SDNode *N) { return SDValue(); SDValue N0 = Value.getOperand(0); - if (ISD::isNormalLoad(N0.getNode()) && N0.hasOneUse()) { + if (ISD::isNormalLoad(N0.getNode()) && N0.hasOneUse() && + Chain == SDValue(N0.getNode(), 1)) { LoadSDNode *LD = cast<LoadSDNode>(N0); if (LD->getBasePtr() != Ptr) return SDValue(); |