Files
clang-p2996/llvm/test/Transforms/FunctionSpecialization/function-specialization-constant-expression3.ll
Alexandros Lamprineas 33830326aa [FuncSpec] Remove definitions of fully specialized functions.
A function is basically dead when:
 * it has no uses
 * it has only self-referencing uses (it's recursive)

Differential Revision: https://reviews.llvm.org/D119878
2022-03-01 11:57:08 +00:00

25 lines
985 B
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -function-specialization -force-function-specialization -S < %s | FileCheck %s
define i32 @main() {
; CHECK-LABEL: @main(
; CHECK-NEXT: bb:
; CHECK-NEXT: tail call void @wombat.1(i8* undef, i64 undef, i64 undef, i32 (i8*, i8*)* bitcast (i32 ()* @quux to i32 (i8*, i8*)*))
; CHECK-NEXT: tail call void @wombat.2(i8* undef, i64 undef, i64 undef, i32 (i8*, i8*)* bitcast (i32 ()* @eggs to i32 (i8*, i8*)*))
; CHECK-NEXT: ret i32 undef
;
bb:
tail call void @wombat(i8* undef, i64 undef, i64 undef, i32 (i8*, i8*)* bitcast (i32 ()* @quux to i32 (i8*, i8*)*))
tail call void @wombat(i8* undef, i64 undef, i64 undef, i32 (i8*, i8*)* bitcast (i32 ()* @eggs to i32 (i8*, i8*)*))
ret i32 undef
}
declare i32 @quux()
declare i32 @eggs()
define internal void @wombat(i8* %arg, i64 %arg1, i64 %arg2, i32 (i8*, i8*)* %arg3) {
bb4:
%tmp = tail call i32 %arg3(i8* undef, i8* undef)
ret void
}