Skip to content

Commit

Permalink
[AArch64] Wrong CC access in CSINC-conditional branch sequence
Browse files Browse the repository at this point in the history
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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219748 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
Gerolf-Apple committed Oct 14, 2014
1 parent 1a0afd8 commit cd27f3f
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions lib/Target/AArch64/AArch64InstrInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit cd27f3f

Please sign in to comment.