[llvm] [AMDGPU][NFC] Prepare the MFMA hazard checks for per-producer windows (PR #225988)

via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 6 14:50:20 PDT 2026


JohnIVM wrote:

Hi @mhalk,

It looks like this commit introduced a compilation regression on builders compiling with GCC and LLVM assertions enabled (`-UNDEBUG` / `_DEBUG`), such as [`clang-ppc64le-linux-test-suite` (Build #23554+)](https://lab.llvm.org/buildbot/#/builders/95/builds/23554).

### Error Log
```text
In file included from /llvm/lib/Target/AMDGPU/GCNHazardRecognizer.h:17,
                 from /llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp:14:
/llvm/lib/Target/AMDGPU/AMDGPUCoExecInfo.h: In function ‘constexpr llvm::StringRef llvm::AMDGPU::getFlavorName(llvm::AMDGPU::InstructionFlavor)’:
/llvm/include/llvm/Support/ErrorHandling.h:165: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/AMDGPUCoExecInfo.h:122: note: in expansion of macro ‘llvm_unreachable’
  llvm_unreachable("Unknown InstructionFlavor");

/llvm/lib/Target/AMDGPU/AMDGPUCoExecInfo.h: In function ‘constexpr llvm::AMDGPU::CoExecMaskT llvm::AMDGPU::getCoExecMask(llvm::AMDGPU::InstructionFlavor)’:
/llvm/include/llvm/Support/ErrorHandling.h:165: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/AMDGPUCoExecInfo.h:157: note: in expansion of macro ‘llvm_unreachable’
  llvm_unreachable("Unknown InstructionFlavor");
```

### Cause
When assertions are enabled, `llvm_unreachable(...)` expands to `llvm_unreachable_internal(...)`, which is a non-`constexpr` runtime function. GCC in C++17 mode strictly rejects non-`constexpr` calls inside functions marked `constexpr` (`getFlavorName` and `getCoExecMask` in [`AMDGPUCoExecInfo.h`](https://github.com/llvm/llvm-project/blob/main/llvm/lib/Target/AMDGPU/AMDGPUCoExecInfo.h#L115)).

Including `AMDGPUCoExecInfo.h` in `GCNHazardRecognizer.h` pulled this definition into multiple translation units during the build.

Please investigate at your earliest convenience, and consider reverting if a fix cannot be applied quickly.

Thank you,
IBM PPC64LE External Build Monitor

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


More information about the llvm-commits mailing list