[llvm] [AMDGPU][NFC] Minor source cleanups in SIInsertWaitcnts (PR #181095)
Sameer Sahasrabuddhe via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 17 00:21:28 PST 2026
================
@@ -2972,7 +2973,7 @@ bool WaitcntBrackets::mergeAsyncMarks(ArrayRef<MergeInfo> MergeInfos,
// pending async operations at this checkpoint" and acts as the identity
// element for max() during merging. We pad at the beginning since the marks
// need to be aligned in most-recent order.
- CounterValueArray ZeroMark{};
+ constexpr CounterValueArray ZeroMark{};
----------------
ssahasra wrote:
Declaring something static is not really about storage optimization. It is used to create a variable that retains state across calls, which is irrelevant if it is a constant anyway. If the compiler decides to allocate it, it _should_ get allocated to the stack instead of hanging around forever. It is *wrong* to use static just to move something from stack to heap.
We are splitting hair at this point, and trying to second guess the compiler at this level seems like just noise to me. I don't think this change is worth it.
https://github.com/llvm/llvm-project/pull/181095
More information about the llvm-commits
mailing list