[llvm] [AMDGPU] IGLP: Fix static variables (PR #137549)

Jeffrey Byrnes via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 15 08:55:36 PDT 2026


jrbyrnes wrote:

> > The static variables weren't even properly reset before
> 
> This needs to be fixed, but thread safety isn't something we need to worry about in LLVM. LLVM has a lot of global state that can't really work in a multithreaded environment without proper protection.

+1 That the counters should be reset if we are in `SchedulingPhase::Initial` and any asserts on StaticVariable == 0 should be fixed for the case where we have multiple functions using the iglp.opt per TU (though this does feel more of a manufactured error than a true user error).

https://github.com/llvm/llvm-project/pull/137549


More information about the llvm-commits mailing list