Skip to content

Commit 6288b92

Browse files
committed
[DFAJumpThreading] Dont insert existing edge to DomTree
Change-Id: Iddc75ba3a219458ee0c6dfefaa1c2a574cd44f9e
1 parent 9d7b3bb commit 6288b92

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

llvm/lib/Transforms/Scalar/DFAJumpThreading.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,7 @@ void DFAJumpThreading::unfold(DomTreeUpdater *DTU, LoopInfo *LI,
266266
if (!ProfcheckDisableMetadataFixes)
267267
BI->setMetadata(LLVMContext::MD_prof,
268268
SI->getMetadata(LLVMContext::MD_prof));
269-
DTU->applyUpdates({{DominatorTree::Insert, StartBlock, EndBlock},
270-
{DominatorTree::Insert, StartBlock, NewBlock}});
269+
DTU->applyUpdates({{DominatorTree::Insert, StartBlock, NewBlock}});
271270
} else {
272271
BasicBlock *EndBlock = SIUse->getParent();
273272
BasicBlock *NewBlockT = BasicBlock::Create(

llvm/test/Transforms/DFAJumpThreading/dfa-jump-threading-transform.ll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -470,11 +470,9 @@ define i16 @DTU_update_crash() {
470470
; CHECK-NEXT: [[P_24_ADDR_3_JT0:%.*]] = phi i32 [ 0, [[FOR_BODY_SELECTBLOCK]] ], [ 0, [[SEL_SI_UNFOLD_FALSE_JT0]] ]
471471
; CHECK-NEXT: br label [[FOR_INC]]
472472
; CHECK: for.inc:
473-
; CHECK-NEXT: [[P_24_ADDR_31:%.*]] = phi i32 [ [[P_24_ADDR_3_JT0]], [[SWITCHBLOCK_JT0]] ], [ [[P_24_ADDR_3]], [[SWITCHBLOCK]] ]
474473
; CHECK-NEXT: br i1 false, label [[FOR_BODY_SELECTBLOCK]], label [[CLEANUP]]
475474
; CHECK: cleanup:
476-
; CHECK-NEXT: [[P_24_ADDR_32:%.*]] = phi i32 [ [[P_24_ADDR_31]], [[FOR_INC]] ], [ [[P_24_ADDR_3]], [[SWITCHBLOCK]] ], [ [[P_24_ADDR_3]], [[SWITCHBLOCK]] ]
477-
; CHECK-NEXT: call void (...) @llvm.fake.use(i32 [[P_24_ADDR_32]])
475+
; CHECK-NEXT: call void (...) @llvm.fake.use(i32 [[P_24_ADDR_3_JT0]])
478476
; CHECK-NEXT: ret i16 0
479477
;
480478
entry:
@@ -506,6 +504,8 @@ declare void @llvm.fake.use(...)
506504
!0 = !{!"function_entry_count", i32 10}
507505
!1 = !{!"branch_weights", i32 3, i32 5}
508506
;.
507+
; CHECK: attributes #[[ATTR0:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) }
508+
;.
509509
; CHECK: [[META0:![0-9]+]] = !{!"function_entry_count", i32 10}
510510
; CHECK: [[PROF1]] = !{!"branch_weights", i32 3, i32 5}
511511
;.

0 commit comments

Comments
 (0)