[llvm][IfConversion] update successor list when merging INLINEASM_BR
authorNick Desaulniers <ndesaulniers@google.com>
Tue, 7 Feb 2023 18:22:24 +0000 (10:22 -0800)
committerNick Desaulniers <ndesaulniers@google.com>
Tue, 7 Feb 2023 18:28:11 +0000 (10:28 -0800)
commit07c7784d7bf69b9944b92ecc283cac823bcfce16
tree980a76ec34382f3623d515505f95d3766ff49ac4
parent1cecfa407c1a1a114d75c8b85fbe97e4c1275c1f
[llvm][IfConversion] update successor list when merging INLINEASM_BR

If this successor list is not correct, then branch-folding may
incorrectly think that the indirect target is dead and remove it. This
results in a dangling reference to the removed block as an operand to
the INLINEASM_BR, which later will get AsmPrinted into code that doesn't
assemble.

This was made more obvious by, but is not a regression of
https://reviews.llvm.org/D130316.

Fixes: https://github.com/llvm/llvm-project/issues/60346

Reviewed By: efriedma, void

Differential Revision: https://reviews.llvm.org/D142924
llvm/lib/CodeGen/IfConversion.cpp
llvm/test/CodeGen/ARM/inlineasmbr-if-cvt.mir