File tree 2 files changed +5
-3
lines changed
test/Transforms/TailCallElim
2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -510,7 +510,9 @@ void TailRecursionEliminator::createTailRecurseLoopHeader(CallInst *CI) {
510
510
NewEntry->takeName (HeaderBB);
511
511
HeaderBB->setName (" tailrecurse" );
512
512
BranchInst *BI = BranchInst::Create (HeaderBB, NewEntry);
513
- BI->setDebugLoc (CI->getDebugLoc ());
513
+ // If the new branch preserves the debug location of CI, it could result in
514
+ // misleading stepping, if CI is located in a conditional branch.
515
+ // So, here we don't give any debug location to BI.
514
516
515
517
// Move all fixed sized allocas from HeaderBB to NewEntry.
516
518
for (BasicBlock::iterator OEBI = HeaderBB->begin (), E = HeaderBB->end (),
Original file line number Diff line number Diff line change 4
4
define void @foo () {
5
5
entry:
6
6
; CHECK-LABEL: entry:
7
- ; CHECK: br label %tailrecurse, !dbg ![[DbgLoc:[0-9]+]]
7
+ ; CHECK: br label %tailrecurse{{$}}
8
8
9
9
call void @foo () ;; line 1
10
10
ret void
11
11
12
12
; CHECK-LABEL: tailrecurse:
13
- ; CHECK: br label %tailrecurse, !dbg ![[DbgLoc]]
13
+ ; CHECK: br label %tailrecurse, !dbg ![[DbgLoc:[0-9]+ ]]
14
14
}
15
15
16
16
;; Make sure tailrecurse has the call instruction's DL
You can’t perform that action at this time.
0 commit comments