[llvm] [FunctionSpecializer] Keep the blocks in dead functions and remove the callsites of dead function properly. (PR #154668)
Alexandros Lamprineas via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 27 05:56:20 PDT 2025
================
@@ -0,0 +1,95 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
+; RUN: opt -passes=ipsccp --funcspec-min-function-size=1 -S < %s | FileCheck %s
+
+define i32 @caller() {
+; CHECK-LABEL: define i32 @caller() {
+; CHECK-NEXT: [[ENTRY:.*:]]
+; CHECK-NEXT: [[CALL1:%.*]] = call i32 @callee.specialized.1(i32 1)
+; CHECK-NEXT: [[CALL2:%.*]] = call i32 @callee.specialized.2(i32 0)
+; CHECK-NEXT: [[COND:%.*]] = icmp eq i32 undef, 0
+; CHECK-NEXT: br i1 [[COND]], label %[[COMMON_RET:.*]], label %[[IF_THEN:.*]]
+; CHECK: [[COMMON_RET]]:
+; CHECK-NEXT: ret i32 0
+; CHECK: [[IF_THEN]]:
+; CHECK-NEXT: ret i32 0
----------------
labrinea wrote:
Why is this not poison?
https://github.com/llvm/llvm-project/pull/154668
More information about the llvm-commits
mailing list