diff --git a/llvm/lib/Transforms/Yk/StackMaps.cpp b/llvm/lib/Transforms/Yk/StackMaps.cpp index 58048c867dcb88..7c2b85604dc80c 100644 --- a/llvm/lib/Transforms/Yk/StackMaps.cpp +++ b/llvm/lib/Transforms/Yk/StackMaps.cpp @@ -15,8 +15,8 @@ #include "llvm/IR/Verifier.h" #include "llvm/InitializePasses.h" #include "llvm/Pass.h" +#include "llvm/Transforms/Yk/ControlPoint.h" #include "llvm/Transforms/Yk/LivenessAnalysis.h" - #include #define DEBUG_TYPE "yk-stackmaps" @@ -60,8 +60,15 @@ class YkStackmaps : public ModulePass { // We don't need to insert stackmaps after intrinsics. But since we // can't tell if an indirect call is an intrinsic at compile time, // emit a stackmap in those cases too. - if (!CI.isIndirectCall() && CI.getCalledFunction()->isIntrinsic()) + + if (!CI.isIndirectCall() && + (CI.getCalledFunction()->isIntrinsic() || + (CI.getCalledFunction()->isDeclaration() && + (!CI.getCalledFunction()->getName().startswith( + "__yk_promote") && + CI.getCalledFunction()->getName() != YK_NEW_CONTROL_POINT)))) continue; + SMCalls.insert({&I, LA.getLiveVarsBefore(&I)}); } else if ((isa(I) && cast(I).isConditional()) ||