[llvm] r324712 - [AMDGPU] More descriptive names in the memory legalizer
Stanislav Mekhanoshin via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 8 22:05:33 PST 2018
Author: rampitec
Date: Thu Feb 8 22:05:33 2018
New Revision: 324712
URL: http://llvm.org/viewvc/llvm-project?rev=324712&view=rev
Log:
[AMDGPU] More descriptive names in the memory legalizer
NFC.
Differential Revision: https://reviews.llvm.org/D43054
Modified:
llvm/trunk/lib/Target/AMDGPU/SIMemoryLegalizer.cpp
Modified: llvm/trunk/lib/Target/AMDGPU/SIMemoryLegalizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/SIMemoryLegalizer.cpp?rev=324712&r1=324711&r2=324712&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/SIMemoryLegalizer.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/SIMemoryLegalizer.cpp Thu Feb 8 22:05:33 2018
@@ -107,7 +107,7 @@ public:
const MachineBasicBlock::iterator &MI);
/// \returns Atomic cmpxchg/rmw info if \p MI is an atomic cmpxchg or
/// rmw operation, "None" otherwise.
- static Optional<SIMemOpInfo> getAtomicCmpxchgInfo(
+ static Optional<SIMemOpInfo> getAtomicCmpxchgOrRmwInfo(
const MachineBasicBlock::iterator &MI);
/// \brief Reports unknown synchronization scope used in \p MI to LLVM
@@ -128,7 +128,7 @@ private:
unsigned Vmcnt0Immediate = 0;
/// \brief Opcode for cache invalidation instruction (L1).
- unsigned Wbinvl1Opcode = 0;
+ unsigned VmemSIMDCacheInvalidateOpc = 0;
/// \brief List of atomic pseudo instructions.
std::list<MachineBasicBlock::iterator> AtomicPseudoMIs;
@@ -163,8 +163,8 @@ private:
/// \brief Inserts "buffer_wbinvl1_vol" instruction \p Before or after \p MI.
/// Always returns true.
- bool insertBufferWbinvl1Vol(MachineBasicBlock::iterator &MI,
- bool Before = true) const;
+ bool insertVmemSIMDCacheInvalidate(MachineBasicBlock::iterator &MI,
+ bool Before = true) const;
/// \brief Inserts "s_waitcnt vmcnt(0)" instruction \p Before or after \p MI.
/// Always returns true.
bool insertWaitcntVmcnt0(MachineBasicBlock::iterator &MI,
@@ -188,8 +188,8 @@ private:
MachineBasicBlock::iterator &MI);
/// \brief Expands atomic cmpxchg or rmw operation \p MI. Returns true if
/// instructions are added/deleted or \p MI is modified, false otherwise.
- bool expandAtomicCmpxchg(const SIMemOpInfo &MOI,
- MachineBasicBlock::iterator &MI);
+ bool expandAtomicCmpxchgOrRmw(const SIMemOpInfo &MOI,
+ MachineBasicBlock::iterator &MI);
public:
static char ID;
@@ -297,7 +297,7 @@ Optional<SIMemOpInfo> SIMemOpInfo::getAt
}
/* static */
-Optional<SIMemOpInfo> SIMemOpInfo::getAtomicCmpxchgInfo(
+Optional<SIMemOpInfo> SIMemOpInfo::getAtomicCmpxchgOrRmwInfo(
const MachineBasicBlock::iterator &MI) {
assert(MI->getDesc().TSFlags & SIInstrFlags::maybeAtomic);
@@ -322,15 +322,15 @@ void SIMemOpInfo::reportUnknownSyncScope
CTX->diagnose(Diag);
}
-bool SIMemoryLegalizer::insertBufferWbinvl1Vol(MachineBasicBlock::iterator &MI,
- bool Before) const {
+bool SIMemoryLegalizer::insertVmemSIMDCacheInvalidate(
+ MachineBasicBlock::iterator &MI, bool Before) const {
MachineBasicBlock &MBB = *MI->getParent();
DebugLoc DL = MI->getDebugLoc();
if (!Before)
++MI;
- BuildMI(MBB, MI, DL, TII->get(Wbinvl1Opcode));
+ BuildMI(MBB, MI, DL, TII->get(VmemSIMDCacheInvalidateOpc));
if (!Before)
--MI;
@@ -385,7 +385,7 @@ bool SIMemoryLegalizer::expandLoad(const
if (MOI.getOrdering() == AtomicOrdering::Acquire ||
MOI.getOrdering() == AtomicOrdering::SequentiallyConsistent) {
Changed |= insertWaitcntVmcnt0(MI, false);
- Changed |= insertBufferWbinvl1Vol(MI, false);
+ Changed |= insertVmemSIMDCacheInvalidate(MI, false);
}
return Changed;
@@ -463,7 +463,7 @@ bool SIMemoryLegalizer::expandAtomicFenc
if (MOI.getOrdering() == AtomicOrdering::Acquire ||
MOI.getOrdering() == AtomicOrdering::AcquireRelease ||
MOI.getOrdering() == AtomicOrdering::SequentiallyConsistent)
- Changed |= insertBufferWbinvl1Vol(MI);
+ Changed |= insertVmemSIMDCacheInvalidate(MI);
AtomicPseudoMIs.push_back(MI);
return Changed;
@@ -482,8 +482,8 @@ bool SIMemoryLegalizer::expandAtomicFenc
return Changed;
}
-bool SIMemoryLegalizer::expandAtomicCmpxchg(const SIMemOpInfo &MOI,
- MachineBasicBlock::iterator &MI) {
+bool SIMemoryLegalizer::expandAtomicCmpxchgOrRmw(const SIMemOpInfo &MOI,
+ MachineBasicBlock::iterator &MI) {
assert(MI->mayLoad() && MI->mayStore());
bool Changed = false;
@@ -503,7 +503,7 @@ bool SIMemoryLegalizer::expandAtomicCmpx
MOI.getFailureOrdering() == AtomicOrdering::Acquire ||
MOI.getFailureOrdering() == AtomicOrdering::SequentiallyConsistent) {
Changed |= insertWaitcntVmcnt0(MI, false);
- Changed |= insertBufferWbinvl1Vol(MI, false);
+ Changed |= insertVmemSIMDCacheInvalidate(MI, false);
}
return Changed;
@@ -532,8 +532,9 @@ bool SIMemoryLegalizer::runOnMachineFunc
Vmcnt0Immediate =
AMDGPU::encodeWaitcnt(IV, 0, getExpcntBitMask(IV), getLgkmcntBitMask(IV));
- Wbinvl1Opcode = ST.getGeneration() <= AMDGPUSubtarget::SOUTHERN_ISLANDS ?
- AMDGPU::BUFFER_WBINVL1 : AMDGPU::BUFFER_WBINVL1_VOL;
+ VmemSIMDCacheInvalidateOpc =
+ ST.getGeneration() <= AMDGPUSubtarget::SOUTHERN_ISLANDS ?
+ AMDGPU::BUFFER_WBINVL1 : AMDGPU::BUFFER_WBINVL1_VOL;
for (auto &MBB : MF) {
for (auto MI = MBB.begin(); MI != MBB.end(); ++MI) {
@@ -546,8 +547,8 @@ bool SIMemoryLegalizer::runOnMachineFunc
Changed |= expandStore(MOI.getValue(), MI);
else if (const auto &MOI = SIMemOpInfo::getAtomicFenceInfo(MI))
Changed |= expandAtomicFence(MOI.getValue(), MI);
- else if (const auto &MOI = SIMemOpInfo::getAtomicCmpxchgInfo(MI))
- Changed |= expandAtomicCmpxchg(MOI.getValue(), MI);
+ else if (const auto &MOI = SIMemOpInfo::getAtomicCmpxchgOrRmwInfo(MI))
+ Changed |= expandAtomicCmpxchgOrRmw(MOI.getValue(), MI);
}
}
More information about the llvm-commits
mailing list