Home | History | Annotate | Download | only in Scalar

Lines Matching refs:Op

60        << *Ops[0].Op->getType() << '\t';
63 Ops[i].Op->printAsOperand(dbgs(), false, M);
259 Neg->setOperand(1, Constant::getNullValue(Ty)); // Drop use of op.
279 /// The existing weight LHS represents the computation X op X op ... op X where
280 /// X occurs LHS times. The combined weight represents X op X op ... op X with
281 /// X occurring LHS + RHS times. If op is "Xor" for example then the combined
303 // Idempotent means X op X === X, so any non-zero weight is equivalent to a
310 // Nilpotent means X op X === 0, so reduce weights modulo 2.
362 /// (Ops[0].first op Ops[0].first op ... Ops[0].first) <- Ops[0].second times
363 /// op
364 /// (Ops[1].first op Ops[1].first op ... Ops[1].first) <- Ops[1].second times
365 /// op
367 /// op
368 /// (Ops[N].first op Ops[N].first op ... Ops[N].first) <- Ops[N].second times
451 SmallVector<std::pair<BinaryOperator*, APInt>, 8> Worklist; // (Op, Weight)
482 Value *Op = I->getOperand(OpIdx);
484 DEBUG(dbgs() << "OPERAND: " << *Op << " (" << Weight << ")\n");
485 assert(!Op->use_empty() && "No uses, so how did we get to it?!");
489 if (BinaryOperator *BO = isReassociableOp(Op, Opcode)) {
490 assert(Visited.insert(Op).second && "Not first visit!");
491 DEBUG(dbgs() << "DIRECT ADD: " << *Op << " (" << Weight << ")\n");
497 LeafMap::iterator It = Leaves.find(Op);
500 assert(Visited.insert(Op).second && "Not first visit!");
501 if (!Op->hasOneUse()) {
504 DEBUG(dbgs() << "ADD USES LEAF: " << *Op << " (" << Weight << ")\n");
505 LeafOrder.push_back(Op);
506 Leaves[Op] = Weight;
512 assert(Visited.count(Op) && "In leaf map but not visited!");
520 assert(!Op->hasOneUse() && "Only one use, but we got here twice!");
528 if (BinaryOperator *BO = isReassociableOp(Op, Opcode)) {
529 DEBUG(dbgs() << "UNLEAF: " << *Op << " (" << It->second << ")\n");
538 if (!Op->hasOneUse())
550 assert((!isa<Instruction>(Op) ||
551 cast<Instruction>(Op)->getOpcode() != Opcode
552 || (isa<FPMathOperator>(Op) &&
553 !cast<Instruction>(Op)->hasUnsafeAlgebra())) &&
555 assert(Op->hasOneUse() && "Has uses outside the expression tree!");
559 if (BinaryOperator *BO = dyn_cast<BinaryOperator>(Op))
562 DEBUG(dbgs() << "MORPH LEAF: " << *Op << " (" << Weight << ") TO ");
572 DEBUG(dbgs() << "ADD LEAF: " << *Op << " (" << Weight << ")\n");
573 assert(!isReassociableOp(Op, Opcode) && "Value was morphed?");
574 LeafOrder.push_back(Op);
575 Leaves[Op] = Weight;
628 BinaryOperator *Op = I;
642 NotRewritable.insert(Ops[i].Op);
653 Value *NewLHS = Ops[i].Op;
654 Value *NewRHS = Ops[i+1].Op;
655 Value *OldLHS = Op->getOperand(0);
656 Value *OldRHS = Op->getOperand(1);
664 DEBUG(dbgs() << "RA: " << *Op << '\n');
665 Op->swapOperands();
666 DEBUG(dbgs() << "TO: " << *Op << '\n');
674 DEBUG(dbgs() << "RA: " << *Op << '\n');
679 Op->setOperand(0, NewLHS);
685 Op->setOperand(1, NewRHS);
687 DEBUG(dbgs() << "TO: " << *Op << '\n');
689 ExpressionChanged = Op;
698 Value *NewRHS = Ops[i].Op;
699 if (NewRHS != Op->getOperand(1)) {
700 DEBUG(dbgs() << "RA: " << *Op << '\n');
701 if (NewRHS == Op->getOperand(0)) {
704 Op->swapOperands();
707 BinaryOperator *BO = isReassociableOp(Op->getOperand(1), Opcode);
710 Op->setOperand(1, NewRHS);
711 ExpressionChanged = Op;
713 DEBUG(dbgs() << "TO: " << *Op << '\n');
721 BinaryOperator *BO = isReassociableOp(Op->getOperand(0), Opcode);
723 Op = BO;
745 DEBUG(dbgs() << "RA: " << *Op << '\n');
746 Op->setOperand(0, NewOp);
747 DEBUG(dbgs() << "TO: " << *Op << '\n');
748 ExpressionChanged = Op;
751 Op = NewOp;
915 Sub->setOperand(0, Constant::getNullValue(Sub->getType())); // Drop use of op.
916 Sub->setOperand(1, Constant::getNullValue(Sub->getType())); // Drop use of op.
935 Shl->setOperand(0, UndefValue::get(Shl->getType())); // Drop use of op.
961 if (Ops[j].Op == X)
963 if (Instruction *I1 = dyn_cast<Instruction>(Ops[j].Op))
970 if (Ops[j].Op == X)
972 if (Instruction *I1 = dyn_cast<Instruction>(Ops[j].Op))
1013 if (Factors[i].Op == Factor) {
1021 if (ConstantInt *FC2 = dyn_cast<ConstantInt>(Factors[i].Op))
1028 if (ConstantFP *FC2 = dyn_cast<ConstantFP>(Factors[i].Op)) {
1053 V = Factors[0].Op;
1093 if (BinaryOperator::isNot(Ops[i].Op)) { // Cannot occur for ^.
1094 Value *X = BinaryOperator::getNotArgument(Ops[i].Op);
1108 if (i+1 != Ops.size() && Ops[i+1].Op == Ops[i].Op) {
1120 return Constant::getNullValue(Ops[0].Op->getType());
1280 Type *Ty = Ops[0].Op->getType();
1285 Value *V = Ops[i].Op;
1378 return Ops.back().Op;
1399 Value *TheOp = Ops[i].Op;
1403 if (i+1 != Ops.size() && Ops[i+1].Op == TheOp) {
1409 } while (i != Ops.size() && Ops[i].Op == TheOp);
1494 isReassociableOp(Ops[i].Op, Instruction::Mul, Instruction::FMul);
1503 // Add one to FactorOccurrences for each unique factor in this op.
1565 isReassociableOp(Ops[i].Op, Instruction::Mul, Instruction::FMul);
1569 if (Value *V = RemoveFactorFromExpression(Ops[i].Op, MaxOccVal)) {
1574 if (Ops[j].Op == Ops[i].Op) {
1635 Value *Op = Ops[Idx-1].Op;
1639 for (; Idx < Size && Ops[Idx].Op == Op; ++Idx)
1656 Value *Op = Ops[Idx-1].Op;
1660 for (; Idx < Ops.size() && Ops[Idx].Op == Op; ++Idx)
1668 Factors.push_back(Factor(Op, Count));
1794 while (!Ops.empty() && isa<Constant>(Ops.back().Op)) {
1795 Constant *C = cast<Constant>(Ops.pop_back_val().Op);
1811 if (Ops.size() == 1) return Ops[0].Op;
1857 for (auto Op : Ops)
1858 if (Instruction *OpInst = dyn_cast<Instruction>(Op))
1874 if (Instruction *Op = dyn_cast<Instruction>(Ops[i])) {
1877 unsigned Opcode = Op->getOpcode();
1878 while (Op->hasOneUse() && Op->user_back()->getOpcode() == Opcode &&
1879 Visited.insert(Op).second)
1880 Op = Op->user_back();
1881 RedoInsts.insert(Op);
2139 isa<ConstantInt>(Ops.back().Op) &&
2140 cast<ConstantInt>(Ops.back().Op)->isAllOnesValue()) {
2146 isa<ConstantFP>(Ops.back().Op) &&
2147 cast<ConstantFP>(Ops.back().Op)->isExactlyValue(-1.0)) {
2156 if (Ops[0].Op == I)
2162 I->replaceAllUsesWith(Ops[0].Op);
2163 if (Instruction *OI = dyn_cast<Instruction>(Ops[0].Op))