Refines OpName emission to only target Global Variables, Functions, Function Parameters, Local Variables (allocas/phis), and Basic Blocks. This reduces binary size and clutter by avoiding OpName for every intermediate instruction (arithmetic, casts, etc.), while preserving readability for interfaces and program structure. Also updates the test suite to align with this change: - Removes OpName checks for intermediate instructions. - Adds side-effects (e.g., volatile stores) to tests where instructions were previously kept alive solely by their OpName usage. - Updates checks to use generic ID matching where specific names are no longer available. - Adds debug-info/opname-filtering.ll to verify the new policy.
20 lines
700 B
LLVM
20 lines
700 B
LLVM
; RUN: llc -O0 -mtriple=spirv32-unknown-unknown %s -o - | FileCheck %s --check-prefix=CHECK-SPIRV
|
|
|
|
; TODO: This test currently fails with LLVM_ENABLE_EXPENSIVE_CHECKS enabled
|
|
; XFAIL: expensive_checks
|
|
|
|
; CHECK-SPIRV: OpName %[[#vec:]] "vec"
|
|
; CHECK-SPIRV: OpName %[[#index:]] "index"
|
|
|
|
; CHECK-SPIRV: %[[#float:]] = OpTypeFloat 32
|
|
; CHECK-SPIRV: %[[#float2:]] = OpTypeVector %[[#float]] 2
|
|
|
|
; CHECK-SPIRV: %[[#res:]] = OpVectorExtractDynamic %[[#float]] %[[#vec]] %[[#index]]
|
|
|
|
define spir_kernel void @test(float addrspace(1)* nocapture %out, <2 x float> %vec, i32 %index) {
|
|
entry:
|
|
%res = extractelement <2 x float> %vec, i32 %index
|
|
store float %res, float addrspace(1)* %out, align 4
|
|
ret void
|
|
}
|