Home | History | Annotate | Download | only in Scalar

Lines Matching refs:Op

53     Value *Op;
54 ValueEntry(unsigned R, Value *O) : Rank(R), Op(O) {}
67 << *Ops[0].Op->getType() << '\t';
70 WriteAsOperand(dbgs(), Ops[i].Op, false, M);
324 Neg->setOperand(1, Constant::getNullValue(Neg->getType())); // Drop use of op.
344 /// The existing weight LHS represents the computation X op X op ... op X where
345 /// X occurs LHS times. The combined weight represents X op X op ... op X with
346 /// X occurring LHS + RHS times. If op is "Xor" for example then the combined
368 // Idempotent means X op X === X, so any non-zero weight is equivalent to a
375 // Nilpotent means X op X === 0, so reduce weights modulo 2.
426 /// (Ops[0].first op Ops[0].first op ... Ops[0].first) <- Ops[0].second times
427 /// op
428 /// (Ops[1].first op Ops[1].first op ... Ops[1].first) <- Ops[1].second times
429 /// op
431 /// op
432 /// (Ops[N].first op Ops[N].first op ... Ops[N].first) <- Ops[N].second times
516 SmallVector<std::pair<BinaryOperator*, APInt>, 8> Worklist; // (Op, Weight)
547 Value *Op = I->getOperand(OpIdx);
549 DEBUG(dbgs() << "OPERAND: " << *Op << " (" << Weight << ")\n");
550 assert(!Op->use_empty() && "No uses, so how did we get to it?!");
554 if (BinaryOperator *BO = isReassociableOp(Op, Opcode)) {
555 assert(Visited.insert(Op) && "Not first visit!");
556 DEBUG(dbgs() << "DIRECT ADD: " << *Op << " (" << Weight << ")\n");
562 LeafMap::iterator It = Leaves.find(Op);
565 assert(Visited.insert(Op) && "Not first visit!");
566 if (!Op->hasOneUse()) {
569 DEBUG(dbgs() << "ADD USES LEAF: " << *Op << " (" << Weight << ")\n");
570 LeafOrder.push_back(Op);
571 Leaves[Op] = Weight;
577 assert(Visited.count(Op) && "In leaf map but not visited!");
585 assert(!Op->hasOneUse() && "Only one use, but we got here twice!");
593 if (BinaryOperator *BO = isReassociableOp(Op, Opcode)) {
594 DEBUG(dbgs() << "UNLEAF: " << *Op << " (" << It->second << ")\n");
603 if (!Op->hasOneUse())
615 assert((!isa<Instruction>(Op) ||
616 cast<Instruction>(Op)->getOpcode() != Opcode) &&
618 assert(Op->hasOneUse() && "Has uses outside the expression tree!");
622 BinaryOperator *BO = dyn_cast<BinaryOperator>(Op);
624 DEBUG(dbgs() << "MORPH LEAF: " << *Op << " (" << Weight << ") TO ");
634 DEBUG(dbgs() << "ADD LEAF: " << *Op << " (" << Weight << ")\n");
635 assert(!isReassociableOp(Op, Opcode) && "Value was morphed?");
636 LeafOrder.push_back(Op);
637 Leaves[Op] = Weight;
690 BinaryOperator *Op = I;
704 NotRewritable.insert(Ops[i].Op);
715 Value *NewLHS = Ops[i].Op;
716 Value *NewRHS = Ops[i+1].Op;
717 Value *OldLHS = Op->getOperand(0);
718 Value *OldRHS = Op->getOperand(1);
726 DEBUG(dbgs() << "RA: " << *Op << '\n');
727 Op->swapOperands();
728 DEBUG(dbgs() << "TO: " << *Op << '\n');
736 DEBUG(dbgs() << "RA: " << *Op << '\n');
741 Op->setOperand(0, NewLHS);
747 Op->setOperand(1, NewRHS);
749 DEBUG(dbgs() << "TO: " << *Op << '\n');
751 ExpressionChanged = Op;
760 Value *NewRHS = Ops[i].Op;
761 if (NewRHS != Op->getOperand(1)) {
762 DEBUG(dbgs() << "RA: " << *Op << '\n');
763 if (NewRHS == Op->getOperand(0)) {
766 Op->swapOperands();
769 BinaryOperator *BO = isReassociableOp(Op->getOperand(1), Opcode);
772 Op->setOperand(1, NewRHS);
773 ExpressionChanged = Op;
775 DEBUG(dbgs() << "TO: " << *Op << '\n');
783 BinaryOperator *BO = isReassociableOp(Op->getOperand(0), Opcode);
785 Op = BO;
805 DEBUG(dbgs() << "RA: " << *Op << '\n');
806 Op->setOperand(0, NewOp);
807 DEBUG(dbgs() << "TO: " << *Op << '\n');
808 ExpressionChanged = Op;
811 Op = NewOp;
937 Sub->setOperand(0, Constant::getNullValue(Sub->getType())); // Drop use of op.
938 Sub->setOperand(1, Constant::getNullValue(Sub->getType())); // Drop use of op.
958 Shl->setOperand(0, UndefValue::get(Shl->getType())); // Drop use of op.
974 if (Ops[j].Op == X)
978 if (Ops[j].Op == X)
1015 if (Factors[i].Op == Factor) {
1023 if (ConstantInt *FC2 = dyn_cast<ConstantInt>(Factors[i].Op))
1043 V = Factors[0].Op;
1084 if (BinaryOperator::isNot(Ops[i].Op)) { // Cannot occur for ^.
1085 Value *X = BinaryOperator::getNotArgument(Ops[i].Op);
1099 if (i+1 != Ops.size() && Ops[i+1].Op == Ops[i].Op) {
1111 return Constant::getNullValue(Ops[0].Op->getType());
1270 Type *Ty = Ops[0].Op->getType();
1275 Value *V = Ops[i].Op;
1356 return Ops.back().Op;
1378 Value *TheOp = Ops[i].Op;
1382 if (i+1 != Ops.size() && Ops[i+1].Op == TheOp) {
1388 } while (i != Ops.size() && Ops[i].Op == TheOp);
1452 BinaryOperator *BOp = isReassociableOp(Ops[i].Op, Instruction::Mul);
1461 // Add one to FactorOccurrences for each unique factor in this op.
1498 BinaryOperator *BOp = isReassociableOp(Ops[i].Op, Instruction::Mul);
1502 if (Value *V = RemoveFactorFromExpression(Ops[i].Op, MaxOccVal)) {
1507 if (Ops[j].Op == Ops[i].Op) {
1552 /// \brief Predicate tests whether a ValueEntry's op is in a map.
1559 return Map.find(Entry.Op) != Map.end();
1581 Value *Op = Ops[Idx-1].Op;
1585 for (; Idx < Size && Ops[Idx].Op == Op; ++Idx)
1602 Value *Op = Ops[Idx-1].Op;
1606 for (; Idx < Ops.size() && Ops[Idx].Op == Op; ++Idx)
1614 Factors.push_back(Factor(Op, Count));
1731 while (!Ops.empty() && isa<Constant>(Ops.back().Op)) {
1732 Constant *C = cast<Constant>(Ops.pop_back_val().Op);
1748 if (Ops.size() == 1) return Ops[0].Op;
1794 if (Instruction *Op = dyn_cast<Instruction>(Ops[i])) {
1797 unsigned Opcode = Op->getOpcode();
1798 while (Op->hasOneUse() && Op->use_back()->getOpcode() == Opcode &&
1799 Visited.insert(Op))
1800 Op = Op->use_back();
1801 RedoInsts.insert(Op);
1947 isa<ConstantInt>(Ops.back().Op) &&
1948 cast<ConstantInt>(Ops.back().Op)->isAllOnesValue()) {
1956 if (Ops[0].Op == I)
1962 I->replaceAllUsesWith(Ops[0].Op);
1963 if (Instruction *OI = dyn_cast<Instruction>(Ops[0].Op))