]> granicus.if.org Git - llvm/commit
[AArch64][GlobalISel] Optimize conditional branches followed by unconditional branches
authorAmara Emerson <aemerson@apple.com>
Tue, 9 Jul 2019 16:05:59 +0000 (16:05 +0000)
committerAmara Emerson <aemerson@apple.com>
Tue, 9 Jul 2019 16:05:59 +0000 (16:05 +0000)
commit1e1e4fd87f7b230641e7f32f7ad9c0fb5c4bd722
treecd6bd62c385eae5a6bddcb99cbd15c041c856e3b
parentba7a465aab90320dadbca30d6ea4dfda22d97141
[AArch64][GlobalISel] Optimize conditional branches followed by unconditional branches

If we have an icmp->brcond->br sequence where the brcond just branches to the
next block jumping over the br, while the br takes the false edge, then we can
modify the conditional branch to jump to the br's target while inverting the
condition of the incoming icmp. This means we can eliminate the br as an
unconditional branch to the fallthrough block.

Differential Revision: https://reviews.llvm.org/D64354

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365510 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/GlobalISel/CombinerHelper.h
include/llvm/CodeGen/MachineOperand.h
lib/CodeGen/GlobalISel/CombinerHelper.cpp
lib/Target/AArch64/AArch64PreLegalizerCombiner.cpp
test/CodeGen/AArch64/GlobalISel/localizer-arm64-tti.ll
test/CodeGen/AArch64/GlobalISel/prelegalizercombiner-br.mir [new file with mode: 0644]
test/CodeGen/AArch64/speculation-hardening.ll