[PATCH] D159439: [AMDGPU] Add utilities to track number of user SGPRs. NFC.
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 12 13:09:43 PDT 2023
craig.topper added inline comments.
================
Comment at: llvm/lib/Target/AMDGPU/GCNSubtarget.h:1412
+ // Returns the size in number of SGPRs for preload user SGPR field.
+ static constexpr unsigned getNumUserSGPRForField(UserSGPRID ID) {
+ switch (ID) {
----------------
gcc 8.5.0 doesn't like this being constexpr due to the call to unreachable. I'm getting an error like
```
llvm/lib/Target/AMDGPU/GCNSubtarget.h: In static member function ‘static constexpr unsigned int llvm::GCNUserSGPRUsageInfo::getNumUserSGPRForField(llvm::GCNUserSGPRUsageInfo::UserSGPRID)’:
llvm/include/llvm/Support/ErrorHandling.h:144:36: error: call to non-‘constexpr’ function ‘void llvm::llvm_unreachable_internal(const char*, const char*, unsigned int)’
::llvm::llvm_unreachable_internal(msg, __FILE__, __LINE__)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
llvm/lib/Target/AMDGPU/GCNSubtarget.h:1431: note: in expansion of macro llvm_unreachable’
llvm_unreachable("Unknown UserSGPRID.");
```
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D159439/new/
https://reviews.llvm.org/D159439
More information about the llvm-commits
mailing list