Skip to content

Commit c302909

Browse files
authored
[RemoveDIs] Fix DPValue hoisting in hoistSuccIdenticalTerminatorToSwitchOrIf (#80822)
Follow up to #79476 - that patch added a call to hoistLockstepIdenticalDPValues which hoists identical DPValues in lockstep, matching dbg intrinsic hoisting behaviour. The code deleted in this patch, which unconditionally hoists DPValues, should have been deleted in that patch. Update test with --try-experimental-debuginfo-iterators to check the behaviour. Follow up to #79476 - that change introduces a call to hoistLockstepIdenticalDPValues.
1 parent 3d186a7 commit c302909

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

llvm/lib/Transforms/Utils/SimplifyCFG.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1842,11 +1842,6 @@ bool SimplifyCFGOpt::hoistSuccIdenticalTerminatorToSwitchOrIf(
18421842
Locs.push_back(I1->getDebugLoc());
18431843
for (auto *OtherSuccTI : OtherSuccTIs)
18441844
Locs.push_back(OtherSuccTI->getDebugLoc());
1845-
// Also clone DPValues from the existing terminator, and all others (to
1846-
// duplicate existing hoisting behaviour).
1847-
NT->cloneDebugInfoFrom(I1);
1848-
for (Instruction *OtherSuccTI : OtherSuccTIs)
1849-
NT->cloneDebugInfoFrom(OtherSuccTI);
18501845
NT->setDebugLoc(DILocation::getMergedLocations(Locs));
18511846

18521847
// PHIs created below will adopt NT's merged DebugLoc.

llvm/test/Transforms/SimplifyCFG/X86/sink-common-code.ll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
22
; RUN: opt < %s -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 -sink-common-insts -S | FileCheck %s
3+
; RUN: opt --try-experimental-debuginfo-iterators < %s -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 -sink-common-insts -S | FileCheck %s
34
; RUN: opt < %s -passes='simplifycfg<sink-common-insts>' -S | FileCheck %s
5+
; RUN: opt --try-experimental-debuginfo-iterators < %s -passes='simplifycfg<sink-common-insts>' -S | FileCheck %s
46

57
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
68
target triple = "x86_64-pc-linux-gnu"

0 commit comments

Comments
 (0)