• Home
  • Raw
  • Download

Lines Matching refs:Ops

57 static void PrintOps(Instruction *I, const SmallVectorImpl<ValueEntry> &Ops) {  in PrintOps()  argument
60 << *Ops[0].Op->getType() << '\t'; in PrintOps()
61 for (unsigned i = 0, e = Ops.size(); i != e; ++i) { in PrintOps()
63 Ops[i].Op->printAsOperand(dbgs(), false, M); in PrintOps()
64 dbgs() << ", #" << Ops[i].Rank << "] "; in PrintOps()
434 SmallVectorImpl<RepeatedValue> &Ops) { in LinearizeExprTree() argument
594 Ops.push_back(std::make_pair(V, Weight)); in LinearizeExprTree()
600 if (Ops.empty()) { in LinearizeExprTree()
603 Ops.emplace_back(Identity, APInt(Bitwidth, 1)); in LinearizeExprTree()
612 SmallVectorImpl<ValueEntry> &Ops) { in RewriteExprTree() argument
613 assert(Ops.size() > 1 && "Single values should be used directly!"); in RewriteExprTree()
641 for (unsigned i = 0, e = Ops.size(); i != e; ++i) in RewriteExprTree()
642 NotRewritable.insert(Ops[i].Op); in RewriteExprTree()
652 if (i+2 == Ops.size()) { in RewriteExprTree()
653 Value *NewLHS = Ops[i].Op; in RewriteExprTree()
654 Value *NewRHS = Ops[i+1].Op; in RewriteExprTree()
698 Value *NewRHS = Ops[i].Op; in RewriteExprTree()
956 static unsigned FindInOperandList(SmallVectorImpl<ValueEntry> &Ops, unsigned i, in FindInOperandList() argument
958 unsigned XRank = Ops[i].Rank; in FindInOperandList()
959 unsigned e = Ops.size(); in FindInOperandList()
960 for (unsigned j = i+1; j != e && Ops[j].Rank == XRank; ++j) { in FindInOperandList()
961 if (Ops[j].Op == X) in FindInOperandList()
963 if (Instruction *I1 = dyn_cast<Instruction>(Ops[j].Op)) in FindInOperandList()
969 for (unsigned j = i-1; j != ~0U && Ops[j].Rank == XRank; --j) { in FindInOperandList()
970 if (Ops[j].Op == X) in FindInOperandList()
972 if (Instruction *I1 = dyn_cast<Instruction>(Ops[j].Op)) in FindInOperandList()
983 SmallVectorImpl<WeakVH> &Ops){ in EmitAddTreeOfValues() argument
984 if (Ops.size() == 1) return Ops.back(); in EmitAddTreeOfValues()
986 Value *V1 = Ops.back(); in EmitAddTreeOfValues()
987 Ops.pop_back(); in EmitAddTreeOfValues()
988 Value *V2 = EmitAddTreeOfValues(I, Ops); in EmitAddTreeOfValues()
1071 const SmallVectorImpl<ValueEntry> &Ops) { in FindSingleUseMultiplyFactors() argument
1079 FindSingleUseMultiplyFactors(BO->getOperand(1), Factors, Ops); in FindSingleUseMultiplyFactors()
1080 FindSingleUseMultiplyFactors(BO->getOperand(0), Factors, Ops); in FindSingleUseMultiplyFactors()
1087 SmallVectorImpl<ValueEntry> &Ops) { in OptimizeAndOrXor() argument
1090 for (unsigned i = 0, e = Ops.size(); i != e; ++i) { in OptimizeAndOrXor()
1092 assert(i < Ops.size()); in OptimizeAndOrXor()
1093 if (BinaryOperator::isNot(Ops[i].Op)) { // Cannot occur for ^. in OptimizeAndOrXor()
1094 Value *X = BinaryOperator::getNotArgument(Ops[i].Op); in OptimizeAndOrXor()
1095 unsigned FoundX = FindInOperandList(Ops, i, X); in OptimizeAndOrXor()
1107 assert(i < Ops.size()); in OptimizeAndOrXor()
1108 if (i+1 != Ops.size() && Ops[i+1].Op == Ops[i].Op) { in OptimizeAndOrXor()
1111 Ops.erase(Ops.begin()+i); in OptimizeAndOrXor()
1120 return Constant::getNullValue(Ops[0].Op->getType()); in OptimizeAndOrXor()
1123 Ops.erase(Ops.begin()+i, Ops.begin()+i+2); in OptimizeAndOrXor()
1271 SmallVectorImpl<ValueEntry> &Ops) { in OptimizeXor() argument
1272 if (Value *V = OptimizeAndOrXor(Instruction::Xor, Ops)) in OptimizeXor()
1275 if (Ops.size() == 1) in OptimizeXor()
1280 Type *Ty = Ops[0].Op->getType(); in OptimizeXor()
1284 for (unsigned i = 0, e = Ops.size(); i != e; ++i) { in OptimizeXor()
1285 Value *V = Ops[i].Op; in OptimizeXor()
1363 Ops.clear(); in OptimizeXor()
1369 Ops.push_back(VE); in OptimizeXor()
1374 Ops.push_back(VE); in OptimizeXor()
1376 int Sz = Ops.size(); in OptimizeXor()
1378 return Ops.back().Op; in OptimizeXor()
1392 SmallVectorImpl<ValueEntry> &Ops) { in OptimizeAdd() argument
1398 for (unsigned i = 0, e = Ops.size(); i != e; ++i) { in OptimizeAdd()
1399 Value *TheOp = Ops[i].Op; in OptimizeAdd()
1403 if (i+1 != Ops.size() && Ops[i+1].Op == TheOp) { in OptimizeAdd()
1407 Ops.erase(Ops.begin()+i); in OptimizeAdd()
1409 } while (i != Ops.size() && Ops[i].Op == TheOp); in OptimizeAdd()
1426 if (Ops.empty()) in OptimizeAdd()
1432 Ops.insert(Ops.begin(), ValueEntry(getRank(Mul), Mul)); in OptimizeAdd()
1435 e = Ops.size(); in OptimizeAdd()
1450 unsigned FoundX = FindInOperandList(Ops, i, X); in OptimizeAdd()
1455 if (Ops.size() == 2 && in OptimizeAdd()
1460 if (Ops.size() == 2 && BinaryOperator::isNot(TheOp)) in OptimizeAdd()
1463 Ops.erase(Ops.begin()+i); in OptimizeAdd()
1468 Ops.erase(Ops.begin()+FoundX); in OptimizeAdd()
1476 Ops.insert(Ops.end(), ValueEntry(getRank(V), V)); in OptimizeAdd()
1492 for (unsigned i = 0, e = Ops.size(); i != e; ++i) { in OptimizeAdd()
1494 isReassociableOp(Ops[i].Op, Instruction::Mul, Instruction::FMul); in OptimizeAdd()
1500 FindSingleUseMultiplyFactors(BOp, Factors, Ops); in OptimizeAdd()
1562 for (unsigned i = 0; i != Ops.size(); ++i) { in OptimizeAdd()
1565 isReassociableOp(Ops[i].Op, Instruction::Mul, Instruction::FMul); in OptimizeAdd()
1569 if (Value *V = RemoveFactorFromExpression(Ops[i].Op, MaxOccVal)) { in OptimizeAdd()
1572 for (unsigned j = Ops.size(); j != i;) { in OptimizeAdd()
1574 if (Ops[j].Op == Ops[i].Op) { in OptimizeAdd()
1576 Ops.erase(Ops.begin()+j); in OptimizeAdd()
1606 if (Ops.empty()) in OptimizeAdd()
1612 Ops.insert(Ops.begin(), ValueEntry(getRank(V2), V2)); in OptimizeAdd()
1629 bool ReassociatePass::collectMultiplyFactors(SmallVectorImpl<ValueEntry> &Ops, in collectMultiplyFactors() argument
1634 for (unsigned Idx = 1, Size = Ops.size(); Idx < Size; ++Idx) { in collectMultiplyFactors()
1635 Value *Op = Ops[Idx-1].Op; in collectMultiplyFactors()
1639 for (; Idx < Size && Ops[Idx].Op == Op; ++Idx) in collectMultiplyFactors()
1655 for (unsigned Idx = 1; Idx < Ops.size(); ++Idx) { in collectMultiplyFactors()
1656 Value *Op = Ops[Idx-1].Op; in collectMultiplyFactors()
1660 for (; Idx < Ops.size() && Ops[Idx].Op == Op; ++Idx) in collectMultiplyFactors()
1669 Ops.erase(Ops.begin()+Idx, Ops.begin()+Idx+Count); in collectMultiplyFactors()
1685 SmallVectorImpl<Value*> &Ops) { in buildMultiplyTree() argument
1686 if (Ops.size() == 1) in buildMultiplyTree()
1687 return Ops.back(); in buildMultiplyTree()
1689 Value *LHS = Ops.pop_back_val(); in buildMultiplyTree()
1692 LHS = Builder.CreateMul(LHS, Ops.pop_back_val()); in buildMultiplyTree()
1694 LHS = Builder.CreateFMul(LHS, Ops.pop_back_val()); in buildMultiplyTree()
1695 } while (!Ops.empty()); in buildMultiplyTree()
1765 SmallVectorImpl<ValueEntry> &Ops) { in OptimizeMul() argument
1768 if (Ops.size() < 4) in OptimizeMul()
1775 if (!collectMultiplyFactors(Ops, Factors)) in OptimizeMul()
1780 if (Ops.empty()) in OptimizeMul()
1784 Ops.insert(std::lower_bound(Ops.begin(), Ops.end(), NewEntry), NewEntry); in OptimizeMul()
1789 SmallVectorImpl<ValueEntry> &Ops) { in OptimizeExpression() argument
1794 while (!Ops.empty() && isa<Constant>(Ops.back().Op)) { in OptimizeExpression()
1795 Constant *C = cast<Constant>(Ops.pop_back_val().Op); in OptimizeExpression()
1799 if (Ops.empty()) in OptimizeExpression()
1808 Ops.push_back(ValueEntry(0, Cst)); in OptimizeExpression()
1811 if (Ops.size() == 1) return Ops[0].Op; in OptimizeExpression()
1815 unsigned NumOps = Ops.size(); in OptimizeExpression()
1820 if (Value *Result = OptimizeAndOrXor(Opcode, Ops)) in OptimizeExpression()
1825 if (Value *Result = OptimizeXor(I, Ops)) in OptimizeExpression()
1831 if (Value *Result = OptimizeAdd(I, Ops)) in OptimizeExpression()
1837 if (Value *Result = OptimizeMul(I, Ops)) in OptimizeExpression()
1842 if (Ops.size() != NumOps) in OptimizeExpression()
1843 return OptimizeExpression(I, Ops); in OptimizeExpression()
1852 SmallVector<Value *, 4> Ops(I->op_begin(), I->op_end()); in RecursivelyEraseDeadInsts() local
1857 for (auto Op : Ops) in RecursivelyEraseDeadInsts()
1866 SmallVector<Value*, 8> Ops(I->op_begin(), I->op_end()); in EraseInst() local
1873 for (unsigned i = 0, e = Ops.size(); i != e; ++i) in EraseInst()
1874 if (Instruction *Op = dyn_cast<Instruction>(Ops[i])) { in EraseInst()
2097 SmallVector<ValueEntry, 8> Ops; in ReassociateExpression() local
2098 Ops.reserve(Tree.size()); in ReassociateExpression()
2101 Ops.append(E.second.getZExtValue(), in ReassociateExpression()
2105 DEBUG(dbgs() << "RAIn:\t"; PrintOps(I, Ops); dbgs() << '\n'); in ReassociateExpression()
2113 std::stable_sort(Ops.begin(), Ops.end()); in ReassociateExpression()
2117 if (Value *V = OptimizeExpression(I, Ops)) { in ReassociateExpression()
2139 isa<ConstantInt>(Ops.back().Op) && in ReassociateExpression()
2140 cast<ConstantInt>(Ops.back().Op)->isAllOnesValue()) { in ReassociateExpression()
2141 ValueEntry Tmp = Ops.pop_back_val(); in ReassociateExpression()
2142 Ops.insert(Ops.begin(), Tmp); in ReassociateExpression()
2146 isa<ConstantFP>(Ops.back().Op) && in ReassociateExpression()
2147 cast<ConstantFP>(Ops.back().Op)->isExactlyValue(-1.0)) { in ReassociateExpression()
2148 ValueEntry Tmp = Ops.pop_back_val(); in ReassociateExpression()
2149 Ops.insert(Ops.begin(), Tmp); in ReassociateExpression()
2153 DEBUG(dbgs() << "RAOut:\t"; PrintOps(I, Ops); dbgs() << '\n'); in ReassociateExpression()
2155 if (Ops.size() == 1) { in ReassociateExpression()
2156 if (Ops[0].Op == I) in ReassociateExpression()
2162 I->replaceAllUsesWith(Ops[0].Op); in ReassociateExpression()
2163 if (Instruction *OI = dyn_cast<Instruction>(Ops[0].Op)) in ReassociateExpression()
2171 RewriteExprTree(I, Ops); in ReassociateExpression()