From 69fc9a912f5a82d59fa7e6e5409e04cab6000f15 Mon Sep 17 00:00:00 2001 From: Lukas Diekmann Date: Wed, 8 Jan 2025 15:34:42 +0000 Subject: [PATCH] More accurate live variables at the control point. Variables that die immediately after the control point are not live and thus don't need to be tracked and passed into traces. This reduces the number of live variables at the control point by one in some tests. --- llvm/lib/Transforms/Yk/ControlPoint.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/llvm/lib/Transforms/Yk/ControlPoint.cpp b/llvm/lib/Transforms/Yk/ControlPoint.cpp index 7d2a12ebb0ff70..88b651e02fc0b8 100644 --- a/llvm/lib/Transforms/Yk/ControlPoint.cpp +++ b/llvm/lib/Transforms/Yk/ControlPoint.cpp @@ -193,7 +193,8 @@ class YkControlPoint : public ModulePass { // Get live variables. LivenessAnalysis LA(Caller); - auto Lives = LA.getLiveVarsBefore(OldCtrlPointCall); + auto Lives = + LA.getLiveVarsBefore(OldCtrlPointCall->getNextNonDebugInstruction()); Value *SMID = ConstantInt::get(Type::getInt64Ty(Context), CPStackMapID); Value *Shadow = ConstantInt::get(Type::getInt32Ty(Context), CPShadow);