[llvm] 06f28f2 - [Assignment Tracking][NFC] Cache debug-info-assignment-tracking module flag
via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 29 04:53:49 PDT 2023
Author: OCHyams
Date: 2023-03-29T12:51:59+01:00
New Revision: 06f28f2451e475d77df12ca370158c3fd465c073
URL: https://github.com/llvm/llvm-project/commit/06f28f2451e475d77df12ca370158c3fd465c073
DIFF: https://github.com/llvm/llvm-project/commit/06f28f2451e475d77df12ca370158c3fd465c073.diff
LOG: [Assignment Tracking][NFC] Cache debug-info-assignment-tracking module flag
This reduces CTMark LTO-O3-g compile time by a geomean of 0.1%.
Reviewed By: jmorse
Differential Revision: https://reviews.llvm.org/D146985
Added:
Modified:
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h
Removed:
################################################################################
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index 1107da1f9f5f1..c19cbec4702a5 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -1051,6 +1051,8 @@ void SelectionDAGBuilder::init(GCFunctionInfo *gfi, AliasAnalysis *aa,
Context = DAG.getContext();
LPadToCallSiteMap.clear();
SL->init(DAG.getTargetLoweringInfo(), TM, DAG.getDataLayout());
+ AssignmentTrackingEnabled = isAssignmentTrackingEnabled(
+ *DAG.getMachineFunction().getFunction().getParent());
}
void SelectionDAGBuilder::clear() {
@@ -6113,7 +6115,7 @@ void SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I,
}
case Intrinsic::dbg_declare: {
// Debug intrinsics are handled separately in assignment tracking mode.
- if (isAssignmentTrackingEnabled(*I.getFunction()->getParent()))
+ if (AssignmentTrackingEnabled)
return;
// Assume dbg.declare can not currently use DIArgList, i.e.
// it is non-variadic.
@@ -6208,13 +6210,13 @@ void SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I,
}
case Intrinsic::dbg_assign: {
// Debug intrinsics are handled seperately in assignment tracking mode.
- assert(isAssignmentTrackingEnabled(*I.getFunction()->getParent()) &&
+ assert(AssignmentTrackingEnabled &&
"expected assignment tracking to be enabled");
return;
}
case Intrinsic::dbg_value: {
// Debug intrinsics are handled seperately in assignment tracking mode.
- if (isAssignmentTrackingEnabled(*I.getFunction()->getParent()))
+ if (AssignmentTrackingEnabled)
return;
const DbgValueInst &DI = cast<DbgValueInst>(I);
assert(DI.getVariable() && "Missing variable");
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h
index 3627d91005d91..c9664ff82c333 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h
@@ -175,6 +175,10 @@ class SelectionDAGBuilder {
/// We defer handling these until we do see it.
MapVector<const Value*, DanglingDebugInfoVector> DanglingDebugInfoMap;
+ /// Cache the module flag for whether we should use debug-info assignment
+ /// tracking.
+ bool AssignmentTrackingEnabled = false;
+
public:
/// Loads are not emitted to the program immediately. We bunch them up and
/// then emit token factor nodes when possible. This allows us to get simple
More information about the llvm-commits
mailing list