summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorGerolf Hoflehner <ghoflehner@apple.com>2014-10-14 23:55:00 +0000
committerGerolf Hoflehner <ghoflehner@apple.com>2014-10-14 23:55:00 +0000
commit5d26d40fc5ad4417147f5e4bba283ea7811ad664 (patch)
tree999c05ac55dd2a4e8d8b08dc56c724eb35ef3b62 /llvm/lib
parentdbbcb11f0eb33ebb3c65925bd0cb9b5ed1a9347b (diff)
downloadbcm5719-llvm-5d26d40fc5ad4417147f5e4bba283ea7811ad664.tar.gz
bcm5719-llvm-5d26d40fc5ad4417147f5e4bba283ea7811ad664.zip
[AArch64] Wrong CC access in CSINC-conditional branch sequence
This is a follow up to commit r219742. It removes the CCInMI variable and accesses the CC in CSCINC directly. In the case of a conditional branch accessing the CC with CCInMI was wrong. llvm-svn: 219748
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/AArch64/AArch64InstrInfo.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp b/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
index c32a1e95faa..4bec7372e69 100644
--- a/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
+++ b/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
@@ -2869,24 +2869,20 @@ bool AArch64InstrInfo::optimizeCondBranch(MachineInstr *MI) const {
case AArch64::CBZW:
case AArch64::CBZX:
TargetBBInMI = 1;
- CCInMI = 2;
break;
case AArch64::CBNZW:
case AArch64::CBNZX:
TargetBBInMI = 1;
- CCInMI = 2;
IsNegativeBranch = true;
break;
case AArch64::TBZW:
case AArch64::TBZX:
TargetBBInMI = 2;
- CCInMI = 3;
IsTestAndBranch = true;
break;
case AArch64::TBNZW:
case AArch64::TBNZX:
TargetBBInMI = 2;
- CCInMI = 3;
IsNegativeBranch = true;
IsTestAndBranch = true;
break;
@@ -2921,7 +2917,7 @@ bool AArch64InstrInfo::optimizeCondBranch(MachineInstr *MI) const {
return false;
AArch64CC::CondCode CC =
- (AArch64CC::CondCode)DefMI->getOperand(CCInMI).getImm();
+ (AArch64CC::CondCode)DefMI->getOperand(3).getImm();
bool CheckOnlyCCWrites = true;
// Convert only when the condition code is not modified between
// the CSINC and the branch. The CC may be used by other
OpenPOWER on IntegriCloud