Files
clang-p2996/llvm/test/CodeGen/DirectX/fneg-conversion.ll
Greg Roth ab75180501 [DirectX] Remove trivially dead functions at linkage finalize (#106146)
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
2024-10-17 12:54:52 -06:00

16 lines
410 B
LLVM

; RUN: llc %s --filetype=asm -o - | FileCheck %s
target triple = "dxil-unknown-shadermodel6.7-library"
define float @negateF(float %0) #0 {
; CHECK: %2 = fsub float -0.000000e+00, %0
%2 = fneg float %0
ret float %2
}
define double @negateD(double %0) #0 {
; CHECK: %2 = fsub double -0.000000e+00, %0
%2 = fneg double %0
ret double %2
}
attributes #0 = { convergent norecurse nounwind "hlsl.export"}