[llvm] [GlobalISel] Don't treat intrinsic callbr indirect dest as machine successor. (PR #221685)

Christudasan Devadasan via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 8 02:11:22 PDT 2026


cdevadas wrote:

I am beginning to think that the indirect targets are added here are on purpose. They are flagged with `setIsInlineAsmBrIndirectTarget` to indicate they are specifically coming from the callbr inline-asm usage. The relevant part of the code in the GISel side is here:
https://github.com/llvm/llvm-project/blob/main/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp#L3925
The TODO present here on the SelectionDAG side indicates that the DAG side should incorporate this change to add such successors and mark them in a similar manner.
https://github.com/llvm/llvm-project/blob/main/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp#L3602

Any pass that analyzes branches and the successors list should query this special flag to handle them separately. You will see many invocations of `isInlineAsmBrIndirectTarget()` throughout the backend.  
This fix is not necessary in that sense.


https://github.com/llvm/llvm-project/pull/221685


More information about the llvm-commits mailing list