Lines Matching refs:Op
53 Value *Op; member
54 ValueEntry(unsigned R, Value *O) : Rank(R), Op(O) {} in ValueEntry()
67 << *Ops[0].Op->getType() << '\t'; in PrintOps()
70 WriteAsOperand(dbgs(), Ops[i].Op, false, M); in PrintOps()
468 Value *Op = I->getOperand(OpIdx); in LinearizeExprTree() local
470 DEBUG(dbgs() << "OPERAND: " << *Op << " (" << Weight << ")\n"); in LinearizeExprTree()
471 assert(!Op->use_empty() && "No uses, so how did we get to it?!"); in LinearizeExprTree()
475 if (BinaryOperator *BO = isReassociableOp(Op, Opcode)) { in LinearizeExprTree()
476 assert(Visited.insert(Op) && "Not first visit!"); in LinearizeExprTree()
477 DEBUG(dbgs() << "DIRECT ADD: " << *Op << " (" << Weight << ")\n"); in LinearizeExprTree()
483 LeafMap::iterator It = Leaves.find(Op); in LinearizeExprTree()
486 assert(Visited.insert(Op) && "Not first visit!"); in LinearizeExprTree()
487 if (!Op->hasOneUse()) { in LinearizeExprTree()
490 DEBUG(dbgs() << "ADD USES LEAF: " << *Op << " (" << Weight << ")\n"); in LinearizeExprTree()
491 LeafOrder.push_back(Op); in LinearizeExprTree()
492 Leaves[Op] = Weight; in LinearizeExprTree()
498 assert(Visited.count(Op) && "In leaf map but not visited!"); in LinearizeExprTree()
506 assert(!Op->hasOneUse() && "Only one use, but we got here twice!"); in LinearizeExprTree()
514 if (BinaryOperator *BO = isReassociableOp(Op, Opcode)) { in LinearizeExprTree()
515 DEBUG(dbgs() << "UNLEAF: " << *Op << " (" << It->second << ")\n"); in LinearizeExprTree()
524 if (!Op->hasOneUse()) in LinearizeExprTree()
536 assert((!isa<Instruction>(Op) || in LinearizeExprTree()
537 cast<Instruction>(Op)->getOpcode() != Opcode) && in LinearizeExprTree()
539 assert(Op->hasOneUse() && "Has uses outside the expression tree!"); in LinearizeExprTree()
543 BinaryOperator *BO = dyn_cast<BinaryOperator>(Op); in LinearizeExprTree()
545 DEBUG(dbgs() << "MORPH LEAF: " << *Op << " (" << Weight << ") TO "); in LinearizeExprTree()
555 DEBUG(dbgs() << "ADD LEAF: " << *Op << " (" << Weight << ")\n"); in LinearizeExprTree()
556 assert(!isReassociableOp(Op, Opcode) && "Value was morphed?"); in LinearizeExprTree()
557 LeafOrder.push_back(Op); in LinearizeExprTree()
558 Leaves[Op] = Weight; in LinearizeExprTree()
611 BinaryOperator *Op = I; in RewriteExprTree() local
625 NotRewritable.insert(Ops[i].Op); in RewriteExprTree()
636 Value *NewLHS = Ops[i].Op; in RewriteExprTree()
637 Value *NewRHS = Ops[i+1].Op; in RewriteExprTree()
638 Value *OldLHS = Op->getOperand(0); in RewriteExprTree()
639 Value *OldRHS = Op->getOperand(1); in RewriteExprTree()
647 DEBUG(dbgs() << "RA: " << *Op << '\n'); in RewriteExprTree()
648 Op->swapOperands(); in RewriteExprTree()
649 DEBUG(dbgs() << "TO: " << *Op << '\n'); in RewriteExprTree()
657 DEBUG(dbgs() << "RA: " << *Op << '\n'); in RewriteExprTree()
662 Op->setOperand(0, NewLHS); in RewriteExprTree()
668 Op->setOperand(1, NewRHS); in RewriteExprTree()
670 DEBUG(dbgs() << "TO: " << *Op << '\n'); in RewriteExprTree()
672 ExpressionChanged = Op; in RewriteExprTree()
681 Value *NewRHS = Ops[i].Op; in RewriteExprTree()
682 if (NewRHS != Op->getOperand(1)) { in RewriteExprTree()
683 DEBUG(dbgs() << "RA: " << *Op << '\n'); in RewriteExprTree()
684 if (NewRHS == Op->getOperand(0)) { in RewriteExprTree()
687 Op->swapOperands(); in RewriteExprTree()
690 BinaryOperator *BO = isReassociableOp(Op->getOperand(1), Opcode); in RewriteExprTree()
693 Op->setOperand(1, NewRHS); in RewriteExprTree()
694 ExpressionChanged = Op; in RewriteExprTree()
696 DEBUG(dbgs() << "TO: " << *Op << '\n'); in RewriteExprTree()
704 BinaryOperator *BO = isReassociableOp(Op->getOperand(0), Opcode); in RewriteExprTree()
706 Op = BO; in RewriteExprTree()
726 DEBUG(dbgs() << "RA: " << *Op << '\n'); in RewriteExprTree()
727 Op->setOperand(0, NewOp); in RewriteExprTree()
728 DEBUG(dbgs() << "TO: " << *Op << '\n'); in RewriteExprTree()
729 ExpressionChanged = Op; in RewriteExprTree()
732 Op = NewOp; in RewriteExprTree()
895 if (Ops[j].Op == X) in FindInOperandList()
899 if (Ops[j].Op == X) in FindInOperandList()
936 if (Factors[i].Op == Factor) { in RemoveFactorFromExpression()
944 if (ConstantInt *FC2 = dyn_cast<ConstantInt>(Factors[i].Op)) in RemoveFactorFromExpression()
964 V = Factors[0].Op; in RemoveFactorFromExpression()
1005 if (BinaryOperator::isNot(Ops[i].Op)) { // Cannot occur for ^. in OptimizeAndOrXor()
1006 Value *X = BinaryOperator::getNotArgument(Ops[i].Op); in OptimizeAndOrXor()
1020 if (i+1 != Ops.size() && Ops[i+1].Op == Ops[i].Op) { in OptimizeAndOrXor()
1032 return Constant::getNullValue(Ops[0].Op->getType()); in OptimizeAndOrXor()
1055 Value *TheOp = Ops[i].Op; in OptimizeAdd()
1059 if (i+1 != Ops.size() && Ops[i+1].Op == TheOp) { in OptimizeAdd()
1065 } while (i != Ops.size() && Ops[i].Op == TheOp); in OptimizeAdd()
1129 BinaryOperator *BOp = isReassociableOp(Ops[i].Op, Instruction::Mul); in OptimizeAdd()
1175 BinaryOperator *BOp = isReassociableOp(Ops[i].Op, Instruction::Mul); in OptimizeAdd()
1179 if (Value *V = RemoveFactorFromExpression(Ops[i].Op, MaxOccVal)) { in OptimizeAdd()
1184 if (Ops[j].Op == Ops[i].Op) { in OptimizeAdd()
1236 return Map.find(Entry.Op) != Map.end(); in operator ()()
1258 Value *Op = Ops[Idx-1].Op; in collectMultiplyFactors() local
1262 for (; Idx < Size && Ops[Idx].Op == Op; ++Idx) in collectMultiplyFactors()
1279 Value *Op = Ops[Idx-1].Op; in collectMultiplyFactors() local
1283 for (; Idx < Ops.size() && Ops[Idx].Op == Op; ++Idx) in collectMultiplyFactors()
1291 Factors.push_back(Factor(Op, Count)); in collectMultiplyFactors()
1408 while (!Ops.empty() && isa<Constant>(Ops.back().Op)) { in OptimizeExpression()
1409 Constant *C = cast<Constant>(Ops.pop_back_val().Op); in OptimizeExpression()
1425 if (Ops.size() == 1) return Ops[0].Op; in OptimizeExpression()
1467 if (Instruction *Op = dyn_cast<Instruction>(Ops[i])) { in EraseInst() local
1470 unsigned Opcode = Op->getOpcode(); in EraseInst()
1471 while (Op->hasOneUse() && Op->use_back()->getOpcode() == Opcode && in EraseInst()
1472 Visited.insert(Op)) in EraseInst()
1473 Op = Op->use_back(); in EraseInst()
1474 RedoInsts.insert(Op); in EraseInst()
1620 isa<ConstantInt>(Ops.back().Op) && in ReassociateExpression()
1621 cast<ConstantInt>(Ops.back().Op)->isAllOnesValue()) { in ReassociateExpression()
1629 if (Ops[0].Op == I) in ReassociateExpression()
1635 I->replaceAllUsesWith(Ops[0].Op); in ReassociateExpression()
1636 if (Instruction *OI = dyn_cast<Instruction>(Ops[0].Op)) in ReassociateExpression()