File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -3297,8 +3297,10 @@ void GVNPass::addDeadBlock(BasicBlock *BB) {
3297
3297
if (!DeadBlocks.count (P))
3298
3298
continue ;
3299
3299
3300
+ auto PredTerminator = P->getTerminator ();
3300
3301
if (is_contained (successors (P), B) &&
3301
- isCriticalEdge (P->getTerminator (), B)) {
3302
+ !isa<IndirectBrInst>(PredTerminator) &&
3303
+ isCriticalEdge (PredTerminator, B)) {
3302
3304
if (BasicBlock *S = splitCriticalEdges (P, B))
3303
3305
DeadBlocks.insert (P = S);
3304
3306
}
Original file line number Diff line number Diff line change @@ -53,3 +53,22 @@ if.end: ; preds = %if.else, %if.then
53
53
}
54
54
55
55
declare void @bar (i32 )
56
+
57
+ define void @indirectbr_could_not_split () {
58
+ ; CHECK-LABEL: define void @indirectbr_could_not_split() {
59
+ ; CHECK-NEXT: [[ENTRY:.*:]]
60
+ ; CHECK-NEXT: br i1 false, label %[[IBR:.*]], label %[[EXIT:.*]]
61
+ ; CHECK: [[IBR]]:
62
+ ; CHECK-NEXT: indirectbr ptr null, [label %[[EXIT]], label %exit]
63
+ ; CHECK: [[EXIT]]:
64
+ ; CHECK-NEXT: ret void
65
+ ;
66
+ entry:
67
+ br i1 false , label %ibr , label %exit
68
+
69
+ ibr:
70
+ indirectbr ptr null , [label %exit , label %exit ]
71
+
72
+ exit:
73
+ ret void
74
+ }
You can’t perform that action at this time.
0 commit comments