[IR] Don't treat callbr as indirect terminator
authorNikita Popov <npopov@redhat.com>
Fri, 15 Jul 2022 11:23:54 +0000 (13:23 +0200)
committerNikita Popov <npopov@redhat.com>
Mon, 18 Jul 2022 07:32:08 +0000 (09:32 +0200)
commit11079e8820ab58417365c226d39f2615b0bef685
treeb706073a29b7ba1d7e4b5a0074a24662dc04804f
parent048aaab19420a67c5b4075726233f73b37ed177c
[IR] Don't treat callbr as indirect terminator

Callbr is no longer an indirect terminator in the sense that is
relevant here (that it's successors cannot be updated). The primary
effect of this change is that callbr no longer prevents formation
of loop simplify form.

I decided to drop the isIndirectTerminator() method entirely and
replace it with isa<IndirectBrInst>() checks. I assume this method
was added to abstract over indirectbr and callbr, but it never
really caught on, and there is nothing left to abstract anymore
at this point.

Differential Revision: https://reviews.llvm.org/D129849
llvm/include/llvm/Analysis/SparsePropagation.h
llvm/include/llvm/IR/Instruction.h
llvm/lib/Transforms/Utils/LoopRotationUtils.cpp
llvm/lib/Transforms/Utils/LoopSimplify.cpp
llvm/test/Transforms/LoopDeletion/two-predecessors.ll
llvm/test/Transforms/LoopRotate/callbr.ll