
Now that #149310 has restricted lifetime intrinsics to only work on allocas, we can also drop the explicit size argument. Instead, the size is implied by the alloca. This removes the ability to only mark a prefix of an alloca alive/dead. We never used that capability, so we should remove the need to handle that possibility everywhere (though many key places, including stack coloring, did not actually respect this).
22 lines
955 B
C
22 lines
955 B
C
// RUN: %clang -S -emit-llvm -o - -O0 %s | FileCheck %s --implicit-check-not="call void @llvm.lifetime" -check-prefixes=CHECK
|
|
// RUN: %clang -S -emit-llvm -o - -O1 %s | FileCheck %s --implicit-check-not="call void @llvm.lifetime" -check-prefixes=CHECK,LIFETIME
|
|
// RUN: %clang -S -emit-llvm -o - -O2 %s | FileCheck %s --implicit-check-not="call void @llvm.lifetime" -check-prefixes=CHECK,LIFETIME
|
|
// RUN: %clang -S -emit-llvm -o - -O3 %s | FileCheck %s --implicit-check-not="call void @llvm.lifetime" -check-prefixes=CHECK,LIFETIME
|
|
|
|
extern void use(char *a);
|
|
|
|
// CHECK-LABEL: @helper_no_markers
|
|
__attribute__((always_inline)) void helper_no_markers(void) {
|
|
char a;
|
|
// LIFETIME: call void @llvm.lifetime.start.p0(
|
|
use(&a);
|
|
// LIFETIME: call void @llvm.lifetime.end.p0(
|
|
}
|
|
|
|
// CHECK-LABEL: @lifetime_test
|
|
void lifetime_test(void) {
|
|
// LIFETIME: call void @llvm.lifetime.start.p0(
|
|
helper_no_markers();
|
|
// LIFETIME: call void @llvm.lifetime.end.p0(
|
|
}
|