Skip to content

Commit 6f62884

Browse files
authored
Merge pull request rust-lang#115 from Pavel-Durov/skip-stackmaps-for-yk-tracing-function
Skip stackmaps for yk_trace_basicblock.
2 parents 4ed74e6 + da52101 commit 6f62884

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

llvm/lib/CodeGen/Yk/FixStackmapsSpillReloads.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
#include "llvm/IR/DebugLoc.h"
5050
#include "llvm/InitializePasses.h"
5151
#include "llvm/Support/Debug.h"
52+
#include "llvm/Transforms/Yk/BasicBlockTracer.h"
5253

5354
#include <set>
5455

@@ -103,6 +104,13 @@ bool FixStackmapsSpillReloads::runOnMachineFunction(MachineFunction &MF) {
103104
// removed during lowering?
104105
if (MI.getOpcode() != TargetOpcode::STACKMAP &&
105106
MI.getOpcode() != TargetOpcode::PATCHPOINT) {
107+
MachineOperand Op = MI.getOperand(0);
108+
if (Op.isGlobal() && Op.getGlobal()->getGlobalIdentifier() == YK_TRACE_FUNCTION) {
109+
// `YK_TRACE_FUNCTION` calls don't require stackmaps so we don't
110+
// need to adjust anything here. In fact, doing so will skew any
111+
// stackmap that follows.
112+
continue;
113+
}
106114
// If we see a normal function call we know it will be followed by a
107115
// STACKMAP instruction. Set `Collect` to `true` to collect all spill
108116
// reload instructions between this call and the STACKMAP instruction.

0 commit comments

Comments
 (0)