Skip to content

Commit 2399497

Browse files
committed
[debug-info] Followup to e0374fb, avoid changing codegen
As discussed on D140404, calling GetValueInMiddleOfBlock can force PHI nodes to be created, but the patch was only supposed to fetch a Value if it wasn't going to generate any PHIs. Fix this by using GetValueAtEndOfBlock instead of the Middle variant, which was the original intention given the check of HasValueForBlock. We don't need to consider the "middle of block" scenario as we're only dealing with blocks where there are no value definitions.
1 parent a07584d commit 2399497

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Transforms/Utils/SSAUpdater.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ void SSAUpdater::UpdateDebugValues(Instruction *I,
216216
void SSAUpdater::UpdateDebugValue(Instruction *I, DbgValueInst *DbgValue) {
217217
BasicBlock *UserBB = DbgValue->getParent();
218218
if (HasValueForBlock(UserBB)) {
219-
Value *NewVal = GetValueInMiddleOfBlock(UserBB);
219+
Value *NewVal = GetValueAtEndOfBlock(UserBB);
220220
DbgValue->replaceVariableLocationOp(I, NewVal);
221221
}
222222
else

0 commit comments

Comments
 (0)