Functions are not removed even when made internal by DXILFinalizeLinkage. The removal code is called from alwaysinliner and globalopt, which are invoked too early to remove functions made internal by this pass. This adds a check similar to that in alwaysinliner that removes trivially dead functions after being marked internal. It refactors that code a bit to make it simpler including reversing what is stored int he work queue. Tests both the pass in isolation and the full i0nlining, linkage finalization and function removal steps. Fixes #106139
28 lines
942 B
LLVM
28 lines
942 B
LLVM
; RUN: opt -S --passes="print-dx-shader-flags" 2>&1 %s | FileCheck %s
|
|
; RUN: llc %s --filetype=obj -o - | obj2yaml | FileCheck %s --check-prefix=DXC
|
|
|
|
target triple = "dxil-pc-shadermodel6.7-library"
|
|
|
|
; CHECK: ; Shader Flags Value: 0x00000044
|
|
; CHECK: ; Note: shader requires additional functionality:
|
|
; CHECK-NEXT: ; Double-precision floating point
|
|
; CHECK-NEXT: ; Double-precision extensions for 11.1
|
|
; CHECK-NEXT: ; Note: extra DXIL module flags:
|
|
; CHECK-NEXT: {{^;$}}
|
|
define double @div(double %a, double %b) #0 {
|
|
%res = fdiv double %a, %b
|
|
ret double %res
|
|
}
|
|
|
|
attributes #0 = { convergent norecurse nounwind "hlsl.export"}
|
|
|
|
; DXC: - Name: SFI0
|
|
; DXC-NEXT: Size: 8
|
|
; DXC-NEXT: Flags:
|
|
; DXC-NEXT: Doubles: true
|
|
; DXC-NOT: {{[A-Za-z]+: +true}}
|
|
; DXC: DX11_1_DoubleExtensions: true
|
|
; DXC-NOT: {{[A-Za-z]+: +true}}
|
|
; DXC: NextUnusedBit: false
|
|
; DXC: ...
|