summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorAmara Emerson <aemerson@apple.com>2019-07-09 16:05:59 +0000
committerAmara Emerson <aemerson@apple.com>2019-07-09 16:05:59 +0000
commit6616e269a690b12335946c4cd019ef298ed0b288 (patch)
treedb9b60a6db80777b0de1eb174c99696327178a7a /llvm/lib/Target
parentd088720edad9c29ee0d622b5d69092e18a9ac0bd (diff)
downloadbcm5719-llvm-6616e269a690b12335946c4cd019ef298ed0b288.tar.gz
bcm5719-llvm-6616e269a690b12335946c4cd019ef298ed0b288.zip
[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 llvm-svn: 365510
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/AArch64/AArch64PreLegalizerCombiner.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64PreLegalizerCombiner.cpp b/llvm/lib/Target/AArch64/AArch64PreLegalizerCombiner.cpp
index fe8216a8d1f..5f7245bfbd7 100644
--- a/llvm/lib/Target/AArch64/AArch64PreLegalizerCombiner.cpp
+++ b/llvm/lib/Target/AArch64/AArch64PreLegalizerCombiner.cpp
@@ -45,6 +45,8 @@ bool AArch64PreLegalizerCombinerInfo::combine(GISelChangeObserver &Observer,
return false;
case TargetOpcode::COPY:
return Helper.tryCombineCopy(MI);
+ case TargetOpcode::G_BR:
+ return Helper.tryCombineBr(MI);
case TargetOpcode::G_LOAD:
case TargetOpcode::G_SEXTLOAD:
case TargetOpcode::G_ZEXTLOAD:
OpenPOWER on IntegriCloud