[Dominators] check indirect branches of callbr
authorNick Desaulniers <ndesaulniers@google.com>
Fri, 17 Feb 2023 01:44:02 +0000 (17:44 -0800)
committerNick Desaulniers <ndesaulniers@google.com>
Fri, 17 Feb 2023 01:58:33 +0000 (17:58 -0800)
commit45a291b5f609fc7edd8c526772e491d68b210dbe
treed276062285f8832e92314eb6ceed7d8a139a7ad8
parentdf277ec67efd1bec3aa2fa8b02d84db0ea8b2f1c
[Dominators] check indirect branches of callbr

This will be necessary to support outputs from asm goto along indirect
edges.

Test via:
  $ pushd llvm/build; ninja IRTests; popd
  $ ./llvm/build/unittests/IR/IRTests \
    --gtest_filter=DominatorTree.CallBrDomination

Also, return nullptr in Instruction::getInsertionPointAfterDef for
CallBrInst as was recommened in
https://reviews.llvm.org/D135997#3991427.  The following phab review was
folded into this commit: https://reviews.llvm.org/D140166

Link: https://discourse.llvm.org/t/rfc-syncing-asm-goto-with-outputs-with-gcc/65453/8
Reviewed By: void, efriedma, ChuanqiXu, MaskRay

Differential Revision: https://reviews.llvm.org/D135997
llvm/include/llvm/IR/Dominators.h
llvm/lib/IR/Dominators.cpp
llvm/lib/IR/Instruction.cpp
llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
llvm/test/Transforms/Coroutines/coro-debug.ll
llvm/test/Transforms/InstCombine/freeze.ll
llvm/test/Transforms/Reassociate/callbr.ll
llvm/test/Verifier/callbr.ll
llvm/test/Verifier/dominates.ll
llvm/unittests/IR/DominatorTreeTest.cpp