Lines Matching +full:arc +full:- +full:hs
1 //===- ARCBranchFinalize.cpp - ARC conditional branches ---------*- C++ -*-===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
11 //===----------------------------------------------------------------------===//
25 #define DEBUG_TYPE "arc-branch-finalize"
47 return "ARC Branch Finalization Pass"; in getPassName()
62 INITIALIZE_PASS_BEGIN(ARCBranchFinalize, "arc-branch-finalize",
63 "ARC finalize branches", false, false)
65 INITIALIZE_PASS_END(ARCBranchFinalize, "arc-branch-finalize", in INITIALIZE_PASS_DEPENDENCY()
66 "ARC finalize branches", false, false) in INITIALIZE_PASS_DEPENDENCY()
70 // EQ -- 000 in INITIALIZE_PASS_DEPENDENCY()
71 // NE -- 001 in INITIALIZE_PASS_DEPENDENCY()
72 // LT -- 010 in INITIALIZE_PASS_DEPENDENCY()
73 // GE -- 011 in INITIALIZE_PASS_DEPENDENCY()
74 // LO -- 100 in INITIALIZE_PASS_DEPENDENCY()
75 // HS -- 101 in INITIALIZE_PASS_DEPENDENCY()
88 case ARCCC::HS: in INITIALIZE_PASS_DEPENDENCY()
91 return -1U; in INITIALIZE_PASS_DEPENDENCY()
96 return !(MI->getOpcode() != ARC::BRcc_rr_p && in isBRccPseudo()
97 MI->getOpcode() != ARC::BRcc_ru6_p); in isBRccPseudo()
102 if (MI->getOpcode() == ARC::BRcc_rr_p) in getBRccForPseudo()
103 return ARC::BRcc_rr; in getBRccForPseudo()
104 return ARC::BRcc_ru6; in getBRccForPseudo()
109 if (MI->getOpcode() == ARC::BRcc_rr_p) in getCmpForPseudo()
110 return ARC::CMP_rr; in getCmpForPseudo()
111 return ARC::CMP_ru6; in getCmpForPseudo()
116 unsigned CC = getCCForBRcc(MI->getOperand(3).getImm()); in replaceWithBRcc()
117 if (CC != -1U) { in replaceWithBRcc()
118 BuildMI(*MI->getParent(), MI, MI->getDebugLoc(), in replaceWithBRcc()
119 TII->get(getBRccForPseudo(MI))) in replaceWithBRcc()
120 .addMBB(MI->getOperand(0).getMBB()) in replaceWithBRcc()
121 .addReg(MI->getOperand(1).getReg()) in replaceWithBRcc()
122 .add(MI->getOperand(2)) in replaceWithBRcc()
123 .addImm(getCCForBRcc(MI->getOperand(3).getImm())); in replaceWithBRcc()
124 MI->eraseFromParent(); in replaceWithBRcc()
133 BuildMI(*MI->getParent(), MI, MI->getDebugLoc(), in replaceWithCmpBcc()
134 TII->get(getCmpForPseudo(MI))) in replaceWithCmpBcc()
135 .addReg(MI->getOperand(1).getReg()) in replaceWithCmpBcc()
136 .add(MI->getOperand(2)); in replaceWithCmpBcc()
137 BuildMI(*MI->getParent(), MI, MI->getDebugLoc(), TII->get(ARC::Bcc)) in replaceWithCmpBcc()
138 .addMBB(MI->getOperand(0).getMBB()) in replaceWithCmpBcc()
139 .addImm(MI->getOperand(3).getImm()); in replaceWithCmpBcc()
140 MI->eraseFromParent(); in replaceWithCmpBcc()
144 LLVM_DEBUG(dbgs() << "Running ARC Branch Finalize on " << MF.getName() in runOnMachineFunction()
157 unsigned Size = TII->getInstSizeInBytes(MI); in runOnMachineFunction()