Skip to content

Commit faa75bd

Browse files
committed
[LifetimeAnalysis] Only collect trace values.
Previously, every value for which there was a debug_value instruction was added to liveness. Only add those with the [trace] flag set.
1 parent 57bc670 commit faa75bd

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/SILOptimizer/UtilityPasses/OSSALifetimeAnalysis.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ void OSSALifetimeAnalysis::run() {
110110
for (auto &block : function) {
111111
for (SILInstruction *inst : deleter.updatingRange(&block)) {
112112
if (auto *debugValue = dyn_cast<DebugValueInst>(inst)) {
113+
if (!debugValue->hasTrace())
114+
continue;
113115
traceValues.push_back(debugValue->getOperand());
114116
deleter.forceDelete(debugValue);
115117
}

0 commit comments

Comments
 (0)