[llvm] [AMDGPU] Track buffer resource num_records width in a subtarget field (PR #217136)
Krzysztof Drewniak via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 24 11:50:51 PDT 2026
================
@@ -353,6 +358,14 @@ class GCNSubtarget final : public AMDGPUGenSubtargetInfo,
bool hasRelaxedBufferOOBMode() const { return BufferOOBRelaxed; }
bool hasRelaxedTBufferOOBMode() const { return TBufferOOBRelaxed; }
+ /// Return the width, in bits, of the num_records field of a buffer resource
+ /// (V#) on this subtarget, or std::nullopt if not yet knows.
+ std::optional<unsigned> getBufferResourceNumRecordsWidth() const {
----------------
krzysz00 wrote:
I like `optional` because it forces people to contend with the generic case, unlike just returning 0 and hoping people remember
https://github.com/llvm/llvm-project/pull/217136
More information about the llvm-commits
mailing list