File tree 2 files changed +16
-1
lines changed 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 11
11
#include " llvm/IR/Function.h"
12
12
#include " llvm/IR/IRBuilder.h"
13
13
#include " llvm/IR/Instructions.h"
14
+ #include " llvm/IR/IntrinsicInst.h"
14
15
#include " llvm/IR/Module.h"
15
16
#include " llvm/IR/Verifier.h"
16
17
#include " llvm/InitializePasses.h"
@@ -99,6 +100,16 @@ class YkStackmaps : public ModulePass {
99
100
// the offset of the stackmap entry will record the instruction after
100
101
// the call, which is where we want to continue after deoptimisation.
101
102
Bldr.SetInsertPoint (I->getNextNode ());
103
+ CallInst &CI = cast<CallInst>(*I);
104
+ if (!CI.isIndirectCall () &&
105
+ CI.getCalledFunction ()->getName () == YK_NEW_CONTROL_POINT) {
106
+ assert (isa<IntrinsicInst>(Args.back ()) &&
107
+ cast<IntrinsicInst>(Args.back ())->getIntrinsicID () ==
108
+ Intrinsic::frameaddress);
109
+ // Remove the last live argument which is the frameaddr which we have
110
+ // no use for and is difficult to remove during tracing.
111
+ Args.pop_back ();
112
+ }
102
113
}
103
114
Bldr.CreateCall (SMFunc->getFunctionType (), SMFunc,
104
115
ArrayRef<Value *>(Args));
Original file line number Diff line number Diff line change 4
4
//
5
5
// ===-------------------------------------------------------------------===//
6
6
7
+ #include " llvm/Analysis/ConstantFolding.h"
7
8
#include " llvm/BinaryFormat/ELF.h"
8
9
#include " llvm/IR/Constant.h"
9
10
#include " llvm/IR/Constants.h"
18
19
#include " llvm/MC/MCSectionELF.h"
19
20
#include " llvm/MC/MCStreamer.h"
20
21
#include " llvm/Support/ErrorHandling.h"
22
+ #include " llvm/Transforms/Yk/ControlPoint.h"
21
23
22
24
using namespace llvm ;
23
25
using namespace std ;
@@ -693,7 +695,9 @@ class YkIRWriter {
693
695
for (unsigned OI = 0 ; OI < I->arg_size (); OI++) {
694
696
serialiseOperand (I, FLCtxt, I->getOperand (OI));
695
697
}
696
- if (!I->getCalledFunction ()->isDeclaration ()) {
698
+ bool IsCtrlPointCall =
699
+ I->getCalledFunction ()->getName () == YK_NEW_CONTROL_POINT;
700
+ if (!I->getCalledFunction ()->isDeclaration () || IsCtrlPointCall) {
697
701
// The next instruction will be the stackmap entry
698
702
// has_safepoint = 1:
699
703
OutStreamer.emitInt8 (1 );
You can’t perform that action at this time.
0 commit comments