[llvm-branch-commits] [clang] [clang] Use tighter lifetime bounds for C temporary arguments (PR #170518)
Paul Kirth via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu Dec 4 13:49:52 PST 2025
================
@@ -13,30 +13,27 @@ void test() {
// CHECK: call void @llvm.lifetime.start.p0(ptr nonnull %[[AGG1]])
// CHECK: invoke void @_Z16func_that_throws7Trivial(ptr noundef nonnull byval(%struct.Trivial) align 8 %[[AGG1]])
- // CHECK-NEXT: to label %[[CONT1:.*]] unwind label %[[LPAD1:.*]]
-
+ // CHECK-NEXT: to label %[[CONT1:.*]] unwind label %[[LPAD:.*]]
+
// CHECK: [[CONT1]]:
+ // CHECK-NEXT: call void @llvm.lifetime.end.p0(ptr nonnull %[[AGG1]])
// CHECK-NEXT: call void @llvm.lifetime.start.p0(ptr nonnull %[[AGG2]])
// CHECK: invoke void @_Z16func_that_throws7Trivial(ptr noundef nonnull byval(%struct.Trivial) align 8 %[[AGG2]])
- // CHECK-NEXT: to label %[[CONT2:.*]] unwind label %[[LPAD2:.*]]
+ // CHECK-NEXT: to label %[[CONT2:.*]] unwind label %[[LPAD]]
// CHECK: [[CONT2]]:
- // CHECK-DAG: call void @llvm.lifetime.end.p0(ptr nonnull %[[AGG2]])
- // CHECK-DAG: call void @llvm.lifetime.end.p0(ptr nonnull %[[AGG1]])
+ // CHECK-NEXT: call void @llvm.lifetime.end.p0(ptr nonnull %[[AGG2]])
// CHECK: br label %[[TRY_CONT:.*]]
- // CHECK: [[LPAD1]]:
- // CHECK: landingpad
- // CHECK: br label %[[EHCLEANUP:.*]]
-
- // CHECK: [[LPAD2]]:
+ // CHECK: [[LPAD]]:
// CHECK: landingpad
- // CHECK: call void @llvm.lifetime.end.p0(ptr nonnull %[[AGG2]])
- // CHECK: br label %[[EHCLEANUP]]
-
- // CHECK: [[EHCLEANUP]]:
- // CHECK: call void @llvm.lifetime.end.p0(ptr nonnull %[[AGG1]])
+ // CHECK-NOT: call void @llvm.lifetime.end.p0(ptr nonnull %[[AGG1]])
+ // CHECK-NOT: call void @llvm.lifetime.end.p0(ptr nonnull %[[AGG2]])
----------------
ilovepi wrote:
I think the new version covers this correctly now.
https://github.com/llvm/llvm-project/pull/170518
More information about the llvm-branch-commits
mailing list