
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
16 lines
508 B
LLVM
16 lines
508 B
LLVM
; RUN: llc %s --filetype=asm -o - | FileCheck %s
|
|
target triple = "dxil-unknown-shadermodel6.7-library"
|
|
|
|
; CHECK: Function Attrs: nounwind memory(none)
|
|
; Function Attrs: norecurse nounwind readnone willreturn
|
|
define dso_local float @fma(float %0, float %1, float %2) local_unnamed_addr #0 {
|
|
%4 = fmul float %0, %1
|
|
%5 = fadd float %4, %2
|
|
ret float %5
|
|
}
|
|
|
|
; CHECK: attributes #0 = { nounwind memory(none) }
|
|
; CHECK-NOT: attributes #
|
|
|
|
attributes #0 = { norecurse nounwind readnone willreturn "hlsl.export"}
|