Lines Matching defs:Compare

78   bool convertToBRCT(MachineInstr *MI, MachineInstr *Compare,
81 bool adjustCCMasksForInstr(MachineInstr *MI, MachineInstr *Compare,
83 bool optimizeCompareZero(MachineInstr *Compare,
85 bool fuseCompareAndBranch(MachineInstr *Compare,
161 // Compare compares the result of MI against zero. If MI is an addition
165 SystemZElimCompare::convertToBRCT(MachineInstr *MI, MachineInstr *Compare,
189 // MI and Compare. Make sure that there are also no references between
190 // Compare and Branch.
191 unsigned SrcReg = Compare->getOperand(0).getReg();
192 MachineBasicBlock::iterator MBBI = Compare, MBBE = Branch;
231 adjustCCMasksForInstr(MachineInstr *MI, MachineInstr *Compare,
241 unsigned CompareFlags = Compare->getDesc().TSFlags;
295 MachineBasicBlock::iterator MBBI = MI, MBBE = Compare;
302 // Return true if Compare is a comparison against zero.
303 static bool isCompareZero(MachineInstr *Compare) {
304 switch (Compare->getOpcode()) {
311 return (Compare->getNumExplicitOperands() == 2 &&
312 Compare->getOperand(1).isImm() &&
313 Compare->getOperand(1).getImm() == 0);
317 // Try to optimize cases where comparison instruction Compare is testing
318 // a value against zero. Return true on success and if Compare should be
320 // value produced by Compare.
322 optimizeCompareZero(MachineInstr *Compare,
324 if (!isCompareZero(Compare))
328 unsigned SrcReg = Compare->getOperand(0).getReg();
329 unsigned SrcSubReg = Compare->getOperand(0).getSubReg();
330 MachineBasicBlock &MBB = *Compare->getParent();
331 MachineBasicBlock::iterator MBBI = Compare, MBBE = MBB.begin();
338 // Try to remove both MI and Compare by converting a branch to BRCT(G).
340 // Compare.
341 if (!CCRefs.Use && !SrcRefs && convertToBRCT(MI, Compare, CCUsers)) {
345 // Try to eliminate Compare by reusing a CC result from MI.
347 (!CCRefs.Def && adjustCCMasksForInstr(MI, Compare, CCUsers))) {
362 // Try to fuse comparison instruction Compare into a later branch.
363 // Return true on success and if Compare is therefore redundant.
365 fuseCompareAndBranch(MachineInstr *Compare,
368 unsigned FusedOpcode = TII->getCompareAndBranch(Compare->getOpcode(),
369 Compare);
381 unsigned SrcReg = Compare->getOperand(0).getReg();
382 unsigned SrcReg2 = (Compare->getOperand(1).isReg() ?
383 Compare->getOperand(1).getReg() : 0);
384 MachineBasicBlock::iterator MBBI = Compare, MBBE = Branch;
407 .addOperand(Compare->getOperand(0))
408 .addOperand(Compare->getOperand(1))
414 MBBI = Compare;
430 // all CC users as we go. The subroutines can delete Compare and