Commit ce60a03
authored
[BranchRelaxation] Fix invalid branch generation in branch-relaxation (#162065)
If we have MBB with only one successor which is accessable through both
conditional and unconditional branches (TBB == FBB), in
`fixupConditionalBranch` we will first replace FBB with NewMBB in
successors list - `MBB->replaceSuccessor(FBB, NewBB);`, and then create
branch to TBB - `insertBranch(MBB, &NextBB, TBB, Cond);`, ending up with
two branches to different blocks, but only one successor.
Fixes: #1620631 parent 9deba01 commit ce60a03
File tree
2 files changed
+53
-0
lines changed- llvm
- lib/CodeGen
- test/CodeGen/RISCV
2 files changed
+53
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
491 | 491 | | |
492 | 492 | | |
493 | 493 | | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
494 | 508 | | |
495 | 509 | | |
496 | 510 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
0 commit comments