[llvm] ce3d93e - AMDGPU: Use static constexpr instead of static const

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 3 14:52:07 PST 2023


Author: Matt Arsenault
Date: 2023-03-03T18:50:34-04:00
New Revision: ce3d93e4be0aa7d30360ad863456b031a1e72916

URL: https://github.com/llvm/llvm-project/commit/ce3d93e4be0aa7d30360ad863456b031a1e72916
DIFF: https://github.com/llvm/llvm-project/commit/ce3d93e4be0aa7d30360ad863456b031a1e72916.diff

LOG: AMDGPU: Use static constexpr instead of static const

Not sure why this was broken, but I was seeing this linker error:

ld64.lld: error: undefined symbol: (anonymous namespace)::AMDGPUInsertDelayAlu::DelayInfo::SALU_CYCLES_MAX
>>> referenced by AMDGPUInsertDelayAlu.cpp:129 (/Users/matt/src/llvm-project/llvm/lib/Target/AMDGPU/AMDGPUInsertDelayAlu.cpp:129)

Added: 
    

Modified: 
    llvm/lib/Target/AMDGPU/AMDGPUInsertDelayAlu.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AMDGPU/AMDGPUInsertDelayAlu.cpp b/llvm/lib/Target/AMDGPU/AMDGPUInsertDelayAlu.cpp
index b7e23facdfe2..57d0fdacf7cf 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUInsertDelayAlu.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUInsertDelayAlu.cpp
@@ -77,15 +77,15 @@ class AMDGPUInsertDelayAlu : public MachineFunctionPass {
   struct DelayInfo {
     // One larger than the maximum number of (non-TRANS) VALU instructions we
     // can encode in an s_delay_alu instruction.
-    static const unsigned VALU_MAX = 5;
+    static constexpr unsigned VALU_MAX = 5;
 
     // One larger than the maximum number of TRANS instructions we can encode in
     // an s_delay_alu instruction.
-    static const unsigned TRANS_MAX = 4;
+    static constexpr unsigned TRANS_MAX = 4;
 
     // The maximum number of SALU cycles we can encode in an s_delay_alu
     // instruction.
-    static const unsigned SALU_CYCLES_MAX = 3;
+    static constexpr unsigned SALU_CYCLES_MAX = 3;
 
     // If it was written by a (non-TRANS) VALU, remember how many clock cycles
     // are left until it completes, and how many other (non-TRANS) VALU we have


        


More information about the llvm-commits mailing list