[llvm] r354740 - [Hexagon, SystemZ] Be super conservative about atomics
Philip Reames via llvm-commits
llvm-commits at lists.llvm.org
Sat Feb 23 16:45:09 PST 2019
Author: reames
Date: Sat Feb 23 16:45:09 2019
New Revision: 354740
URL: http://llvm.org/viewvc/llvm-project?rev=354740&view=rev
Log:
[Hexagon, SystemZ] Be super conservative about atomics
As requested during review of D57601, be equally conservative for atomic MMOs as for volatile MMOs in all in tree backends. At the moment, all atomic MMOs are also volatile, but I'm about to change that.
Reviewed as part of https://reviews.llvm.org/D58490, with other backends still pending review.
Modified:
llvm/trunk/lib/Target/Hexagon/HexagonExpandCondsets.cpp
llvm/trunk/lib/Target/Hexagon/HexagonFrameLowering.cpp
llvm/trunk/lib/Target/Hexagon/HexagonSplitDouble.cpp
llvm/trunk/lib/Target/SystemZ/SystemZInstrInfo.cpp
Modified: llvm/trunk/lib/Target/Hexagon/HexagonExpandCondsets.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonExpandCondsets.cpp?rev=354740&r1=354739&r2=354740&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/HexagonExpandCondsets.cpp (original)
+++ llvm/trunk/lib/Target/Hexagon/HexagonExpandCondsets.cpp Sat Feb 23 16:45:09 2019
@@ -733,7 +733,7 @@ bool HexagonExpandCondsets::isPredicable
HasDef = true;
}
for (auto &Mo : MI->memoperands())
- if (Mo->isVolatile())
+ if (Mo->isVolatile() || Mo->isAtomic())
return false;
return true;
}
Modified: llvm/trunk/lib/Target/Hexagon/HexagonFrameLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonFrameLowering.cpp?rev=354740&r1=354739&r2=354740&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/HexagonFrameLowering.cpp (original)
+++ llvm/trunk/lib/Target/Hexagon/HexagonFrameLowering.cpp Sat Feb 23 16:45:09 2019
@@ -2101,7 +2101,7 @@ void HexagonFrameLowering::optimizeSpill
}
if (!Bad) {
for (auto *Mo : In.memoperands()) {
- if (!Mo->isVolatile())
+ if (!Mo->isVolatile() && !Mo->isAtomic())
continue;
Bad = true;
break;
Modified: llvm/trunk/lib/Target/Hexagon/HexagonSplitDouble.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonSplitDouble.cpp?rev=354740&r1=354739&r2=354740&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/HexagonSplitDouble.cpp (original)
+++ llvm/trunk/lib/Target/Hexagon/HexagonSplitDouble.cpp Sat Feb 23 16:45:09 2019
@@ -152,8 +152,8 @@ bool HexagonSplitDoubleRegs::isInduction
}
bool HexagonSplitDoubleRegs::isVolatileInstr(const MachineInstr *MI) const {
- for (auto &I : MI->memoperands())
- if (I->isVolatile())
+ for (auto &MO : MI->memoperands())
+ if (MO->isVolatile() || MO->isAtomic())
return true;
return false;
}
Modified: llvm/trunk/lib/Target/SystemZ/SystemZInstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/SystemZ/SystemZInstrInfo.cpp?rev=354740&r1=354739&r2=354740&view=diff
==============================================================================
--- llvm/trunk/lib/Target/SystemZ/SystemZInstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/SystemZ/SystemZInstrInfo.cpp Sat Feb 23 16:45:09 2019
@@ -1188,7 +1188,7 @@ MachineInstr *SystemZInstrInfo::foldMemo
// MVCs that turn out to be redundant.
if (OpNum == 0 && MI.hasOneMemOperand()) {
MachineMemOperand *MMO = *MI.memoperands_begin();
- if (MMO->getSize() == Size && !MMO->isVolatile()) {
+ if (MMO->getSize() == Size && !MMO->isVolatile() && !MMO->isAtomic()) {
// Handle conversion of loads.
if (isSimpleBD12Move(&MI, SystemZII::SimpleBDXLoad)) {
return BuildMI(*InsertPt->getParent(), InsertPt, MI.getDebugLoc(),
More information about the llvm-commits
mailing list