From 6144eee70a68ac9854c88d84edab7e56a1461679 Mon Sep 17 00:00:00 2001 From: Hans Wennborg Date: Fri, 27 Jan 2017 16:17:56 +0000 Subject: [PATCH] Merging r292516: ------------------------------------------------------------------------ r292516 | rserge | 2017-01-19 12:24:23 -0800 (Thu, 19 Jan 2017) | 14 lines [XRay][Arm] Repair XRay table emission on Arm32 and add tests to identify such problem earlier Summary: Emission of XRay table was occasionally disabled for Arm32, but this bug was not then detected because earlier (also by mistake) testing of XRay was occasionally disabled on 32-bit Arm targets. This patch should fix that problem and detect such problems in the future. This patch is one of a series, see also - https://reviews.llvm.org/D28623 Reviewers: rengolin, dberris Reviewed By: dberris Subscribers: llvm-commits, aemerson, rengolin, dberris, iid_iunknown Differential Revision: https://reviews.llvm.org/D28624 ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_40@293295 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/ARM/ARMAsmPrinter.cpp | 3 +++ test/CodeGen/ARM/xray-armv6-attribute-instrumentation.ll | 6 ++++++ test/CodeGen/ARM/xray-armv7-attribute-instrumentation.ll | 6 ++++++ 3 files changed, 15 insertions(+) diff --git a/lib/Target/ARM/ARMAsmPrinter.cpp b/lib/Target/ARM/ARMAsmPrinter.cpp index 8ec9cb02813..95db35ce8ff 100644 --- a/lib/Target/ARM/ARMAsmPrinter.cpp +++ b/lib/Target/ARM/ARMAsmPrinter.cpp @@ -164,6 +164,9 @@ bool ARMAsmPrinter::runOnMachineFunction(MachineFunction &MF) { // Emit the rest of the function body. EmitFunctionBody(); + // Emit the XRay table for this function. + emitXRayTable(); + // If we need V4T thumb mode Register Indirect Jump pads, emit them. // These are created per function, rather than per TU, since it's // relatively easy to exceed the thumb branch range within a TU. diff --git a/test/CodeGen/ARM/xray-armv6-attribute-instrumentation.ll b/test/CodeGen/ARM/xray-armv6-attribute-instrumentation.ll index 8a8c667b2d8..93c3cb14fb7 100644 --- a/test/CodeGen/ARM/xray-armv6-attribute-instrumentation.ll +++ b/test/CodeGen/ARM/xray-armv6-attribute-instrumentation.ll @@ -23,3 +23,9 @@ define i32 @foo() nounwind noinline uwtable "function-instrument"="xray-always" ; CHECK-LABEL: Ltmp1: ; CHECK-NEXT: bx lr } +; CHECK: .p2align 4 +; CHECK-NEXT: .long {{.*}}Lxray_synthetic_0 +; CHECK-NEXT: .section {{.*}}xray_instr_map{{.*}} +; CHECK-LABEL: Lxray_synthetic_0: +; CHECK: .long {{.*}}Lxray_sled_0 +; CHECK: .long {{.*}}Lxray_sled_1 diff --git a/test/CodeGen/ARM/xray-armv7-attribute-instrumentation.ll b/test/CodeGen/ARM/xray-armv7-attribute-instrumentation.ll index 07852cd6879..d14590b8867 100644 --- a/test/CodeGen/ARM/xray-armv7-attribute-instrumentation.ll +++ b/test/CodeGen/ARM/xray-armv7-attribute-instrumentation.ll @@ -23,3 +23,9 @@ define i32 @foo() nounwind noinline uwtable "function-instrument"="xray-always" ; CHECK-LABEL: Ltmp1: ; CHECK-NEXT: bx lr } +; CHECK: .p2align 4 +; CHECK-NEXT: .long {{.*}}Lxray_synthetic_0 +; CHECK-NEXT: .section {{.*}}xray_instr_map{{.*}} +; CHECK-LABEL: Lxray_synthetic_0: +; CHECK: .long {{.*}}Lxray_sled_0 +; CHECK: .long {{.*}}Lxray_sled_1 -- 2.49.0