Matt Arsenault 056d2c12f7
RuntimeLibcalls: Split lowering decisions into LibcallLoweringInfo (#164987)
Introduce a new class for the TargetLowering usage. This tracks the
subtarget specific lowering decisions for which libcall to use.
RuntimeLibcallsInfo is a module level property, which may have multiple
implementations of a particular libcall available. This attempts to be
a minimum boilerplate patch to introduce the new concept.

In the future we should have a tablegen way of selecting which
implementations should be used for a subtarget. Currently we
do have some conflicting implementations added, it just happens
to work out that the default cases to prefer is alphabetically
first (plus some of these still are using manual overrides
in TargetLowering constructors).
2025-11-05 17:10:36 +00:00

25 lines
659 B
LLVM

; RUN: opt -S -passes=declare-runtime-libcalls -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s
; Check an already declared function
; CHECK: declare float @logf(float)
declare float @logf(float)
; Check an already defined function
; CHECK: define float @sinf(float %x) {
define float @sinf(float %x) {
ret float %x
}
; CHECK: declare void @_Unwind_Resume(...)
; CHECK: declare void @__umodti3(...)
; CHECK: declare void @acosf(...)
; CHECK: declare nofpclass(ninf nsub nnorm) double @sqrt(double) [[SQRT_ATTRS:#[0-9]+]]
; CHECK: declare nofpclass(ninf nsub nnorm) float @sqrtf(float) [[SQRT_ATTRS:#[0-9]+]]
; CHECK: declare void @truncl(...)