AMDGPU: Use static constexpr instead of static const
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Fri, 3 Mar 2023 22:50:34 +0000 (18:50 -0400)
committerMatt Arsenault <arsenm2@gmail.com>
Fri, 3 Mar 2023 22:50:34 +0000 (18:50 -0400)
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)

llvm/lib/Target/AMDGPU/AMDGPUInsertDelayAlu.cpp

index b7e23fa..57d0fda 100644 (file)
@@ -77,15 +77,15 @@ public:
   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