@@ -253,6 +253,9 @@ class SIMemOpAccess final {
253
253
class SICacheControl {
254
254
protected:
255
255
256
+ // // AMDGPU subtarget info.
257
+ const GCNSubtarget &ST;
258
+
256
259
// / Instruction info.
257
260
const SIInstrInfo *TII = nullptr ;
258
261
@@ -379,7 +382,6 @@ class SIGfx7CacheControl : public SIGfx6CacheControl {
379
382
380
383
class SIGfx10CacheControl : public SIGfx7CacheControl {
381
384
protected:
382
- bool CuMode = false ;
383
385
384
386
// / Sets DLC bit to "true" if present in \p MI. Returns true if \p MI
385
387
// / is modified, false otherwise.
@@ -389,8 +391,7 @@ class SIGfx10CacheControl : public SIGfx7CacheControl {
389
391
390
392
public:
391
393
392
- SIGfx10CacheControl (const GCNSubtarget &ST, bool CuMode) :
393
- SIGfx7CacheControl (ST), CuMode(CuMode) {};
394
+ SIGfx10CacheControl (const GCNSubtarget &ST) : SIGfx7CacheControl(ST) {};
394
395
395
396
bool enableLoadCacheBypass (const MachineBasicBlock::iterator &MI,
396
397
SIAtomicScope Scope,
@@ -672,7 +673,7 @@ Optional<SIMemOpInfo> SIMemOpAccess::getAtomicCmpxchgOrRmwInfo(
672
673
return constructFromMIWithMMO (MI);
673
674
}
674
675
675
- SICacheControl::SICacheControl (const GCNSubtarget &ST) {
676
+ SICacheControl::SICacheControl (const GCNSubtarget &ST) : ST(ST) {
676
677
TII = ST.getInstrInfo ();
677
678
IV = getIsaVersion (ST.getCPU ());
678
679
InsertCacheInv = !AmdgcnSkipCacheInvalidations;
@@ -685,7 +686,7 @@ std::unique_ptr<SICacheControl> SICacheControl::create(const GCNSubtarget &ST) {
685
686
return std::make_unique<SIGfx6CacheControl>(ST);
686
687
if (Generation < AMDGPUSubtarget::GFX10)
687
688
return std::make_unique<SIGfx7CacheControl>(ST);
688
- return std::make_unique<SIGfx10CacheControl>(ST, ST. isCuModeEnabled () );
689
+ return std::make_unique<SIGfx10CacheControl>(ST);
689
690
}
690
691
691
692
bool SIGfx6CacheControl::enableLoadCacheBypass (
@@ -956,7 +957,7 @@ bool SIGfx10CacheControl::enableLoadCacheBypass(
956
957
// the WGP. Therefore need to bypass the L0 which is per CU. Otherwise in
957
958
// CU mode all waves of a work-group are on the same CU, and so the L0
958
959
// does not need to be bypassed.
959
- if (!CuMode ) Changed |= enableGLCBit (MI);
960
+ if (!ST. isCuModeEnabled () ) Changed |= enableGLCBit (MI);
960
961
break ;
961
962
case SIAtomicScope::WAVEFRONT:
962
963
case SIAtomicScope::SINGLETHREAD:
@@ -1016,7 +1017,7 @@ bool SIGfx10CacheControl::insertAcquire(MachineBasicBlock::iterator &MI,
1016
1017
// the WGP. Therefore need to invalidate the L0 which is per CU. Otherwise
1017
1018
// in CU mode and all waves of a work-group are on the same CU, and so the
1018
1019
// L0 does not need to be invalidated.
1019
- if (!CuMode ) {
1020
+ if (!ST. isCuModeEnabled () ) {
1020
1021
BuildMI (MBB, MI, DL, TII->get (AMDGPU::BUFFER_GL0_INV));
1021
1022
Changed = true ;
1022
1023
}
@@ -1076,7 +1077,7 @@ bool SIGfx10CacheControl::insertWait(MachineBasicBlock::iterator &MI,
1076
1077
// they are visible to waves in the other CU as the L0 is per CU.
1077
1078
// Otherwise in CU mode and all waves of a work-group are on the same CU
1078
1079
// which shares the same L0.
1079
- if (!CuMode ) {
1080
+ if (!ST. isCuModeEnabled () ) {
1080
1081
if ((Op & SIMemOp::LOAD) != SIMemOp::NONE)
1081
1082
VMCnt |= true ;
1082
1083
if ((Op & SIMemOp::STORE) != SIMemOp::NONE)
0 commit comments