llvm-project/llvm/test/Analysis/LazyCallGraph/remove-dead-function-spurious-ref-edge.ll
Yonghong Song becc02ce93 Revert "[Transforms][IPO] Add func suffix in ArgumentPromotion and DeadArgume… (#105742)"
This reverts commit 959448fbd6bc6f74fb3f9655b1387d0e8a272ab8.
Reverting because multiple test failures e.g.
  https://lab.llvm.org/buildbot/#/builders/187/builds/1290
  https://lab.llvm.org/buildbot/#/builders/153/builds/9389
and maybe a few others.
2024-09-19 03:54:13 -07:00

37 lines
803 B
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -passes=argpromotion,inline -S %s | FileCheck %s
; argpromo removes @b's parameter (removing @c's reference to @a without updating the ref edge in the call graph), then the inliner inlines @a into @d and attempts to remove @a.
define internal void @a() alwaysinline {
call void @e(ptr @c)
ret void
}
define internal void @b(ptr) noinline {
; CHECK-LABEL: @b(
; CHECK-NEXT: ret void
;
ret void
}
define internal void @c() noinline {
; CHECK-LABEL: @c(
; CHECK-NEXT: call void @b()
; CHECK-NEXT: ret void
;
call void @b(ptr @a)
ret void
}
define void @d() {
; CHECK-LABEL: @d(
; CHECK-NEXT: call void @e(ptr @c)
; CHECK-NEXT: ret void
;
call void @a()
ret void
}
declare void @e(ptr);