summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorRenato Golin <renato.golin@linaro.org>2016-04-23 19:30:52 +0000
committerRenato Golin <renato.golin@linaro.org>2016-04-23 19:30:52 +0000
commit179d1f5dadbbd4a338ea7c5954bb917ca043b99b (patch)
tree28ce0bc93d123f436ae4f54b2f9c7a6dc32b3d1a /llvm/lib/Target
parent8d97011eb275d0f803c26a45d20a64d1b12826b0 (diff)
downloadbcm5719-llvm-179d1f5dadbbd4a338ea7c5954bb917ca043b99b.tar.gz
bcm5719-llvm-179d1f5dadbbd4a338ea7c5954bb917ca043b99b.zip
Revert "[AArch64] Fix optimizeCondBranch logic."
This reverts commit r267206, as it broke self-hosting on AArch64. llvm-svn: 267294
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/AArch64/AArch64InstrInfo.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp b/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
index 95037a4cd7c..eb0c5785d5d 100644
--- a/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
+++ b/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
@@ -3353,9 +3353,9 @@ bool AArch64InstrInfo::optimizeCondBranch(MachineInstr *MI) const {
if (!MRI->hasOneNonDBGUse(VReg))
return false;
- bool Is64Bit = DefMI->getOpcode() != AArch64::ANDWri;
uint64_t Mask = AArch64_AM::decodeLogicalImmediate(
- DefMI->getOperand(2).getImm(), Is64Bit ? 64 : 32);
+ DefMI->getOperand(2).getImm(),
+ (DefMI->getOpcode() == AArch64::ANDWri) ? 32 : 64);
if (!isPowerOf2_64(Mask))
return false;
@@ -3370,9 +3370,9 @@ bool AArch64InstrInfo::optimizeCondBranch(MachineInstr *MI) const {
MachineBasicBlock *TBB = MI->getOperand(1).getMBB();
DebugLoc DL = MI->getDebugLoc();
unsigned Imm = Log2_64(Mask);
- unsigned Opc = Is64Bit
- ? (IsNegativeBranch ? AArch64::TBNZX : AArch64::TBZX)
- : (IsNegativeBranch ? AArch64::TBNZW : AArch64::TBZW);
+ unsigned Opc = (Imm < 32)
+ ? (IsNegativeBranch ? AArch64::TBNZW : AArch64::TBZW)
+ : (IsNegativeBranch ? AArch64::TBNZX : AArch64::TBZX);
BuildMI(RefToMBB, MI, DL, get(Opc)).addReg(NewReg).addImm(Imm).addMBB(TBB);
MI->eraseFromParent();
return true;
OpenPOWER on IntegriCloud