diff options
| author | Philip Reames <listmail@philipreames.com> | 2019-11-05 13:17:01 -0800 |
|---|---|---|
| committer | Philip Reames <listmail@philipreames.com> | 2019-11-05 13:20:08 -0800 |
| commit | db036ee0a424374ae53e9ade2c1c4aa9424ef492 (patch) | |
| tree | e70b8417fc3e86632ba2a94b8bce659c4559a576 /llvm/lib/CodeGen | |
| parent | ee10d934dddd49eccfd3b6e6ae8f02551b1a03a4 (diff) | |
| download | bcm5719-llvm-db036ee0a424374ae53e9ade2c1c4aa9424ef492.tar.gz bcm5719-llvm-db036ee0a424374ae53e9ade2c1c4aa9424ef492.zip | |
[X86/Atomics] Correct a few transforms for new atomic lowering
This is a partial fix for the issues described in commit message of 027aa27 (the revert of G24609). Unfortunately, I can't provide test coverage for it on it's own as the only (known) wrong example is still wrong, but due to a separate issue.
These fixes are cases where when performing unrelated DAG combines, we were dropping the atomicity flags entirely.
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 20986d95c29..09858e0ac7e 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -14116,7 +14116,7 @@ SDValue DAGCombiner::visitLOAD(SDNode *N) { return V; // Try to infer better alignment information than the load already has. - if (OptLevel != CodeGenOpt::None && LD->isUnindexed()) { + if (OptLevel != CodeGenOpt::None && LD->isUnindexed() && !LD->isAtomic()) { if (unsigned Align = DAG.InferPtrAlignment(Ptr)) { if (Align > LD->getAlignment() && LD->getSrcValueOffset() % Align == 0) { SDValue NewLoad = DAG.getExtLoad( @@ -16164,8 +16164,7 @@ SDValue DAGCombiner::visitSTORE(SDNode *N) { TLI.isStoreBitCastBeneficial(Value.getValueType(), SVT, DAG, *ST->getMemOperand())) { return DAG.getStore(Chain, SDLoc(N), Value.getOperand(0), Ptr, - ST->getPointerInfo(), ST->getAlignment(), - ST->getMemOperand()->getFlags(), ST->getAAInfo()); + ST->getMemOperand()); } } @@ -16174,7 +16173,7 @@ SDValue DAGCombiner::visitSTORE(SDNode *N) { return Chain; // Try to infer better alignment information than the store already has. - if (OptLevel != CodeGenOpt::None && ST->isUnindexed()) { + if (OptLevel != CodeGenOpt::None && ST->isUnindexed() && !ST->isAtomic()) { if (unsigned Align = DAG.InferPtrAlignment(Ptr)) { if (Align > ST->getAlignment() && ST->getSrcValueOffset() % Align == 0) { SDValue NewStore = |

