diff --git a/llvm/lib/CodeGen/TargetInstrInfo.cpp b/llvm/lib/CodeGen/TargetInstrInfo.cpp --- a/llvm/lib/CodeGen/TargetInstrInfo.cpp +++ b/llvm/lib/CodeGen/TargetInstrInfo.cpp @@ -1598,6 +1598,15 @@ case TargetOpcode::LIFETIME_START: case TargetOpcode::LIFETIME_END: return outliner::InstrType::Invisible; + case TargetOpcode::PATCHABLE_FUNCTION_ENTER: + case TargetOpcode::PATCHABLE_RET: + case TargetOpcode::PATCHABLE_FUNCTION_EXIT: + case TargetOpcode::PATCHABLE_TAIL_CALL: + case TargetOpcode::PATCHABLE_EVENT_CALL: + case TargetOpcode::PATCHABLE_TYPED_EVENT_CALL: + // XRay pseudo-instructions can't safely be outlined, and + // shouldn't be either way due to their intended purpose. + return outliner::InstrType::Illegal; default: break; } diff --git a/llvm/test/CodeGen/AArch64/machine-outliner-patchable-exit.mir b/llvm/test/CodeGen/AArch64/machine-outliner-patchable-exit.mir new file mode 100644 --- /dev/null +++ b/llvm/test/CodeGen/AArch64/machine-outliner-patchable-exit.mir @@ -0,0 +1,30 @@ +# RUN: llc -mtriple aarch64 -run-pass=machine-outliner -verify-machineinstrs %s -o - | FileCheck %s +# CHECK-NOT: OUTLINED_FUNCTION + +... +--- +name: foo1 +tracksRegLiveness: true +machineFunctionInfo: + hasRedZone: false +body: | + bb.0: + liveins: $x0 + $x0 = ADDXri $x0, 0, 0 + PATCHABLE_FUNCTION_EXIT + RET_ReallyLR implicit $x0 + +... +--- +name: foo2 +tracksRegLiveness: true +machineFunctionInfo: + hasRedZone: false +body: | + bb.0: + liveins: $x0 + $x0 = ADDXri $x0, 0, 0 + PATCHABLE_FUNCTION_EXIT + RET_ReallyLR implicit $x0 + +...