[llvm] [AMDGPU] Handle nontemporal and amdgpu.last.use metadata in amdgpu-lower-buffer-fat-pointers (PR #120139)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 17 07:38:56 PST 2024


================
@@ -1088,6 +1088,10 @@ Value *SplitPtrStructs::handleMemoryInst(Instruction *I, Value *Arg, Value *Ptr,
     Aux |= (Aux & AMDGPU::CPol::GLC ? AMDGPU::CPol::DLC : 0);
   if (IsVolatile)
     Aux |= AMDGPU::CPol::VOLATILE;
+  if (I->hasMetadata("amdgpu.last.use"))
+    Aux |= AMDGPU::CPol::TH_LU;
+  if (I->hasMetadata("nontemporal"))
+    Aux |= AMDGPU::CPol::TH_NT;
----------------
jayfoad wrote:

We should only use the TH_* constants on GFX12, right?

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


More information about the llvm-commits mailing list