[clang] [Clang] Add "extend lifetime" flags and release note (PR #110000)
Stephen Tozer via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 3 11:36:22 PDT 2024
================
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 %s -emit-llvm -O2 -fextend-lifetimes -o - | FileCheck --check-prefixes=CHECK-ALL,CHECK-O2 %s
+// RUN: %clang_cc1 %s -emit-llvm -O0 -fextend-lifetimes -o - | FileCheck --check-prefixes=CHECK-ALL,CHECK-O0 %s
+
+// Checks that we emit the function attribute has_fake_uses when
+// -fextend-lifetimes is on and optimizations are enabled, and that it does not
+// when optimizations are disabled.
+
+// CHECK-ALL: define {{.*}}void @foo
+// CHECK-O2: attributes #0 = {{{.*}}has_fake_uses
----------------
SLTozer wrote:
This isn't the only effect from the front end; this flag will actually generate llvm.fake.use intrinsics, but only for source variables, which this test does not have. But as you've noted, this test should probably include variables to demonstrate that we also don't emit fake uses for those at O0!
https://github.com/llvm/llvm-project/pull/110000
More information about the cfe-commits
mailing list