[all-commits] [llvm/llvm-project] ae77c4: [RFC][IR] Extract AMDGPU-specific verification log...

Shilei Tian via All-commits all-commits at lists.llvm.org
Fri Jun 19 09:34:02 PDT 2026


  Branch: refs/heads/users/shiltian/seperate-ir-verifier
  Home:   https://github.com/llvm/llvm-project
  Commit: ae77c46fefada0c1dbf96f27a4a779918454a04b
      https://github.com/llvm/llvm-project/commit/ae77c46fefada0c1dbf96f27a4a779918454a04b
  Author: Shilei Tian <i at tianshilei.me>
  Date:   2026-06-19 (Fri, 19 Jun 2026)

  Changed paths:
    M llvm/lib/IR/CMakeLists.txt
    M llvm/lib/IR/Verifier.cpp
    A llvm/lib/IR/VerifierAMDGPU.cpp
    A llvm/lib/IR/VerifierInternal.h
    M llvm/test/Verifier/callbr-intrinsic.ll
    M llvm/utils/gn/secondary/llvm/lib/IR/BUILD.gn

  Log Message:
  -----------
  [RFC][IR] Extract AMDGPU-specific verification logic into `VerifierAMDGPU.cpp`

`Verifier.cpp` is large and already mixes generic IR verification with
target-specific checks. We also have a growing amount of AMDGPU verifier logic
downstream, which would all end up in the same file if we don't address this,
and that is not ideal.

This patch extracts AMDGPU-specific verification logic into a separate
`VerifierAMDGPU.cpp` file, with shared infrastructure (`VerifierSupport`) moved
into `VerifierInternal.h`.

This is purely a code organization change, not a target-dependent IR verifier.
All checks remain compiled and linked into `LLVMCore` regardless of the target
triple. The extracted functions are called unconditionally at well-defined
extension points in `Verifier.cpp`, and each function internally gates on
target-specific conditions (for example, triple checks or intrinsic IDs) as
needed. The file is strictly limited to AMDGPU-specific IR constructs (amdgcn
intrinsics, AMDGPU module flags, etc.), and does not contain generic IR rules
that vary by target.

This PR deliberately avoided introducing polymorphism, since this is not a
target-dependent verification framework. Instead, this follows a pattern similar
to TargetParser (for example `AMDGPUTargetParser.cpp`): flat file layout, free
functions, no registration, and unconditional compilation.

Other targets that want similar separation can follow the same pattern.

Open to suggestions on whether there is a better long-term way to structure
this.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list