[llvm] [AMDGPU] Fix some cache policy checks for GFX12+ (PR #116396)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 16 09:25:40 PST 2024


================
@@ -3267,9 +3267,14 @@ bool AMDGPUInstructionSelector::selectBufferLoadLds(MachineInstr &MI) const {
   MIB.add(MI.getOperand(1));            // rsrc
   MIB.add(MI.getOperand(5 + OpOffset)); // soffset
   MIB.add(MI.getOperand(6 + OpOffset)); // imm offset
+  bool IsGFX12Plus = AMDGPU::isGFX12Plus(STI);
   unsigned Aux = MI.getOperand(7 + OpOffset).getImm();
-  MIB.addImm(Aux & AMDGPU::CPol::ALL);                  // cpol
-  MIB.addImm(Aux & AMDGPU::CPol::SWZ_pregfx12 ? 1 : 0); // swz
+  MIB.addImm(Aux & (IsGFX12Plus ? AMDGPU::CPol::ALL
----------------
arsenm wrote:

I assume the DAG path already does this? 

https://github.com/llvm/llvm-project/pull/116396


More information about the llvm-commits mailing list