mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 11:42:57 +01:00
ff78401ab1
Summary: This fixes code-gen for XRay in PPC. The regression wasn't caught by codegen tests which we add in this change. What happened was the following: - For tail exits, we used to unconditionally prepend the returns/exits with a pseudo-instruction that gets lowered to the instrumentation sled (and leave the actual return/exit instruction as-is). - Changes to the XRay instrumentation pass caused the tail exits to suddenly also emit the tail exit pseudo-instruction, since the check for whether a return instruction was also a call instruction meant it was a tail exit instruction. - None of the tests caught the regression either due to non-existent tests, or the tests being disabled/removed for continuous breakage. This change re-introduces some of the basic tests and verifies that we're back to a state that allows the back-end to generate appropriate XRay instrumented binaries for PPC in the presence of tail exits. Reviewers: echristo, timshen Subscribers: nemanjai, kbarton, llvm-commits Differential Revision: https://reviews.llvm.org/D37570 llvm-svn: 312772
27 lines
836 B
LLVM
27 lines
836 B
LLVM
; RUN: llc -filetype=asm -o - -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s
|
|
|
|
declare hidden i32 @callee() nounwind noinline uwtable "function-instrument"="xray-always"
|
|
|
|
define i32 @caller() nounwind noinline uwtable "function-instrument"="xray-always" {
|
|
; CHECK-LABEL: .Ltmp0:
|
|
; CHECK: b .Ltmp1
|
|
; CHECK-NEXT: nop
|
|
; CHECK-NEXT: std 0, -8(1)
|
|
; CHECK-NEXT: mflr 0
|
|
; CHECK-NEXT: bl __xray_FunctionEntry
|
|
; CHECK-NEXT: nop
|
|
; CHECK-NEXT: mtlr 0
|
|
; CHECK-LABEL: .Ltmp1:
|
|
%retval = tail call i32 @callee()
|
|
ret i32 %retval
|
|
; CHECK-LABEL: .Ltmp2:
|
|
; CHECK: b callee
|
|
; CHECK-NEXT: nop
|
|
; CHECK-NEXT: std 0, -8(1)
|
|
; CHECK-NEXT: mflr 0
|
|
; CHECK-NEXT: bl __xray_FunctionExit
|
|
; CHECK-NEXT: nop
|
|
; CHECK-NEXT: mtlr 0
|
|
}
|
|
|