diff options
| author | Alexandros Lamprineas <alexandros.lamprineas@arm.com> | 2017-06-28 15:09:11 +0000 |
|---|---|---|
| committer | Alexandros Lamprineas <alexandros.lamprineas@arm.com> | 2017-06-28 15:09:11 +0000 |
| commit | c0432d86aa5dceacc034fcbef81cb5270bf9840c (patch) | |
| tree | 449f4fcf9ccac36f7c703d03d7eead6f1bd29548 /llvm/lib/Target/AArch64 | |
| parent | afdadf56275bf870a4b54d6ca104937be7b708e6 (diff) | |
| download | bcm5719-llvm-c0432d86aa5dceacc034fcbef81cb5270bf9840c.tar.gz bcm5719-llvm-c0432d86aa5dceacc034fcbef81cb5270bf9840c.zip | |
[AArch64] AArch64CondBrTuningPass generates wrong branch instructions
Some conditional branch instructions generated by this pass are checking
the wrong condition code. The instructions TBZ and TBNZ are transformed
into B.GE and B.LT instead of B.PL and B.MI respectively. They should
only be checking the Negative bit.
Differential Revision: https://reviews.llvm.org/D34743
llvm-svn: 306550
Diffstat (limited to 'llvm/lib/Target/AArch64')
| -rw-r--r-- | llvm/lib/Target/AArch64/AArch64CondBrTuning.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64CondBrTuning.cpp b/llvm/lib/Target/AArch64/AArch64CondBrTuning.cpp index f27bc97ec3f..13bcbe4304b 100644 --- a/llvm/lib/Target/AArch64/AArch64CondBrTuning.cpp +++ b/llvm/lib/Target/AArch64/AArch64CondBrTuning.cpp @@ -22,7 +22,7 @@ /// cbz w8, .LBB1_2 -> b.eq .LBB1_2 /// /// 3) sub w8, w0, w1 -> subs w8, w0, w1 ; w8 has multiple uses. -/// tbz w8, #31, .LBB6_2 -> b.ge .LBB6_2 +/// tbz w8, #31, .LBB6_2 -> b.pl .LBB6_2 /// //===----------------------------------------------------------------------===// @@ -129,11 +129,11 @@ MachineInstr *AArch64CondBrTuning::convertToCondBr(MachineInstr &MI) { break; case AArch64::TBZW: case AArch64::TBZX: - CC = AArch64CC::GE; + CC = AArch64CC::PL; break; case AArch64::TBNZW: case AArch64::TBNZX: - CC = AArch64CC::LT; + CC = AArch64CC::MI; break; } return BuildMI(*MI.getParent(), MI, MI.getDebugLoc(), TII->get(AArch64::Bcc)) |

