[llvm] [AMDGPU] Using feature to define vmem cacheline size (PR #207884)

Robert Imschweiler via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 8 23:24:43 PDT 2026


================
@@ -409,6 +409,15 @@ class SubtargetFeatureInstCacheLineSize <int Value> : SubtargetFeature <
 def FeatureInstCacheLineSize64  : SubtargetFeatureInstCacheLineSize<64>;
 def FeatureInstCacheLineSize128 : SubtargetFeatureInstCacheLineSize<128>;
 
+class SubtargetFeatureDataCacheLineSize <int Value> : SubtargetFeature <
+  "datacachelinesize"#Value,
+  "DataCacheLineSize",
+  !cast<string>(Value),
+  "Data (VMEM) cache line size in bytes."
+>;
+
+def FeatureDataCacheLineSize128 : SubtargetFeatureDataCacheLineSize<128>;
----------------
ro-i wrote:

why should the cache line size attribute depend on prefetch?
Also, didn't llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h return 128 unconditionally before (see the diff of your changes)?
So, isn't this already gated on the usage sites?

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


More information about the llvm-commits mailing list