[llvm] [MergeFunc] Remove discardables function before writing alias or thunk. (PR #128865)

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 26 07:55:59 PST 2025


================
@@ -43,14 +43,8 @@ define linkonce i32 @funA(i32 %x, i32 %y) {
 ; CHECK-NEXT:    ret i32 [[SUM3]]
 ;
 ;
-; CHECK-LABEL: define linkonce i32 @funC(
-; CHECK-SAME: i32 [[TMP0:%.*]], i32 [[TMP1:%.*]]) {
-; CHECK-NEXT:    [[TMP3:%.*]] = tail call i32 @[[GLOB0:[0-9]+]](i32 [[TMP0]], i32 [[TMP1]])
-; CHECK-NEXT:    ret i32 [[TMP3]]
-;
-;
 ; CHECK-LABEL: define linkonce i32 @funB(
 ; CHECK-SAME: i32 [[TMP0:%.*]], i32 [[TMP1:%.*]]) {
-; CHECK-NEXT:    [[TMP3:%.*]] = tail call i32 @[[GLOB0]](i32 [[TMP0]], i32 [[TMP1]])
+; CHECK-NEXT:    [[TMP3:%.*]] = tail call i32 @[[GLOB0:[0-9]+]](i32 [[TMP0]], i32 [[TMP1]])
----------------
teresajohnson wrote:

I was going to suggest that you add a check that funC no longer exists, but I see that even before this patch the test contains `-implicit-check-not=funC` - how was that working since there was a funC before?

Also, what happens to funA? Is it also deleted as a result of this patch? Should that be checked as well?

https://github.com/llvm/llvm-project/pull/128865


More information about the llvm-commits mailing list