File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
test/Transforms/TailCallElim Expand file tree Collapse file tree 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) {
510510 NewEntry->takeName (HeaderBB);
511511 HeaderBB->setName (" tailrecurse" );
512512 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.
514516
515517 // Move all fixed sized allocas from HeaderBB to NewEntry.
516518 for (BasicBlock::iterator OEBI = HeaderBB->begin (), E = HeaderBB->end (),
Original file line number Diff line number Diff line change 44define void @foo () {
55entry:
66; CHECK-LABEL: entry:
7- ; CHECK: br label %tailrecurse, !dbg ![[DbgLoc:[0-9]+]]
7+ ; CHECK: br label %tailrecurse{{$}}
88
99 call void @foo () ;; line 1
1010 ret void
1111
1212; CHECK-LABEL: tailrecurse:
13- ; CHECK: br label %tailrecurse, !dbg ![[DbgLoc]]
13+ ; CHECK: br label %tailrecurse, !dbg ![[DbgLoc:[0-9]+ ]]
1414}
1515
1616;; Make sure tailrecurse has the call instruction's DL
You can’t perform that action at this time.
0 commit comments