[clang] [llvm] wip: Move instrumentation passes (PR #92171)

Arthur Eubanks via cfe-commits cfe-commits at lists.llvm.org
Wed May 22 14:03:05 PDT 2024


================
@@ -0,0 +1,29 @@
+; RUN: llc -mtriple=x86_64-- -O0 < %s | FileCheck %s
+; RUN: llc -mtriple=x86_64-- -O1 < %s | FileCheck %s
+; RUN: llc -mtriple=x86_64-- -O2 < %s | FileCheck %s
+
+; The codegen should insert post-inlining instrumentation calls and should not
+; insert pre-inlining instrumentation.
+
+; CHECK-NOT:       callq __cyg_profile_func_enter
+
+define void @leaf_function() #0 {
+; CHECK-LABEL: leaf_function:
+; CHECK:       callq __cyg_profile_func_enter_bare
+; CHECK:       movq	leaf_function at GOTPCREL(%rip), %rdi
----------------
aeubanks wrote:

checking the specifics of how the function is called shouldn't be in this test that tests the pipeline, the point of this test is just a quick end-to-end test testing we inserted instrumentation. if we want to test this we should have a separate test focused on the exact instruction sequence. but I don't think we need to add that test coverage in this PR

so I'd remove the `%rdi` CHECK line

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


More information about the cfe-commits mailing list