• Home
  • Raw
  • Download

Lines Matching refs:Instruction

62 static void PrintOps(Instruction *I, const SmallVectorImpl<ValueEntry> &Ops) {  in PrintOps()
64 dbgs() << Instruction::getOpcodeName(I->getOpcode()) << " " in PrintOps()
100 Value *OptimizeAdd(Instruction *I, SmallVectorImpl<ValueEntry> &Ops);
118 Instruction *Op = dyn_cast<Instruction>(V); in RemoveDeadBinaryOp()
131 static bool isUnmovableInstruction(Instruction *I) { in isUnmovableInstruction()
132 if (I->getOpcode() == Instruction::PHI || in isUnmovableInstruction()
133 I->getOpcode() == Instruction::Alloca || in isUnmovableInstruction()
134 I->getOpcode() == Instruction::Load || in isUnmovableInstruction()
135 I->getOpcode() == Instruction::Invoke || in isUnmovableInstruction()
136 (I->getOpcode() == Instruction::Call && in isUnmovableInstruction()
138 I->getOpcode() == Instruction::UDiv || in isUnmovableInstruction()
139 I->getOpcode() == Instruction::SDiv || in isUnmovableInstruction()
140 I->getOpcode() == Instruction::FDiv || in isUnmovableInstruction()
141 I->getOpcode() == Instruction::URem || in isUnmovableInstruction()
142 I->getOpcode() == Instruction::SRem || in isUnmovableInstruction()
143 I->getOpcode() == Instruction::FRem) in isUnmovableInstruction()
171 Instruction *I = dyn_cast<Instruction>(V); in getRank()
204 if ((V->hasOneUse() || V->use_empty()) && isa<Instruction>(V) && in isReassociableOp()
205 cast<Instruction>(V)->getOpcode() == Opcode) in isReassociableOp()
212 static Instruction *LowerNegateToMultiply(Instruction *Neg, in LowerNegateToMultiply()
216 Instruction *Res = BinaryOperator::CreateMul(Neg->getOperand(1), Cst, "",Neg); in LowerNegateToMultiply()
283 if (I->getOpcode() == Instruction::Mul) { in LinearizeExprTree()
285 LHS = LowerNegateToMultiply(cast<Instruction>(LHS), ValueRankMap); in LinearizeExprTree()
289 RHS = LowerNegateToMultiply(cast<Instruction>(RHS), ValueRankMap); in LinearizeExprTree()
402 static Value *NegateValue(Value *V, Instruction *BI) { in NegateValue()
415 if (Instruction *I = dyn_cast<Instruction>(V)) in NegateValue()
416 if (I->getOpcode() == Instruction::Add && I->hasOneUse()) { in NegateValue()
448 if (Instruction *InstInput = dyn_cast<Instruction>(V)) { in NegateValue()
470 static bool ShouldBreakUpSubtract(Instruction *Sub) { in ShouldBreakUpSubtract()
477 if (isReassociableOp(Sub->getOperand(0), Instruction::Add) || in ShouldBreakUpSubtract()
478 isReassociableOp(Sub->getOperand(0), Instruction::Sub)) in ShouldBreakUpSubtract()
480 if (isReassociableOp(Sub->getOperand(1), Instruction::Add) || in ShouldBreakUpSubtract()
481 isReassociableOp(Sub->getOperand(1), Instruction::Sub)) in ShouldBreakUpSubtract()
484 (isReassociableOp(Sub->use_back(), Instruction::Add) || in ShouldBreakUpSubtract()
485 isReassociableOp(Sub->use_back(), Instruction::Sub))) in ShouldBreakUpSubtract()
494 static Instruction *BreakUpSubtract(Instruction *Sub, in BreakUpSubtract()
503 Instruction *New = in BreakUpSubtract()
520 static Instruction *ConvertShiftToMul(Instruction *Shl, in ConvertShiftToMul()
524 if (isReassociableOp(Shl->getOperand(0), Instruction::Mul) || in ConvertShiftToMul()
526 (isReassociableOp(Shl->use_back(), Instruction::Mul) || in ConvertShiftToMul()
527 isReassociableOp(Shl->use_back(), Instruction::Add)))) { in ConvertShiftToMul()
531 Instruction *Mul = in ConvertShiftToMul()
562 static Value *EmitAddTreeOfValues(Instruction *I, SmallVectorImpl<Value*> &Ops){ in EmitAddTreeOfValues()
575 BinaryOperator *BO = isReassociableOp(V, Instruction::Mul); in RemoveFactorFromExpression()
636 BO->getOpcode() != Instruction::Mul) { in FindSingleUseMultiplyFactors()
673 if (Opcode == Instruction::And) // ...&X&~X = 0 in OptimizeAndOrXor()
676 if (Opcode == Instruction::Or) // ...|X|~X = -1 in OptimizeAndOrXor()
685 if (Opcode == Instruction::And || Opcode == Instruction::Or) { in OptimizeAndOrXor()
694 assert(Opcode == Instruction::Xor); in OptimizeAndOrXor()
710 Value *Reassociate::OptimizeAdd(Instruction *I, in OptimizeAdd()
794 if (BOp == 0 || BOp->getOpcode() != Instruction::Mul || !BOp->use_empty()) in OptimizeAdd()
835 Instruction *DummyInst = BinaryOperator::CreateAdd(MaxOccVal, MaxOccVal); in OptimizeAdd()
840 if (BOp == 0 || BOp->getOpcode() != Instruction::Mul || !BOp->use_empty()) in OptimizeAdd()
911 case Instruction::And: in OptimizeExpression()
917 case Instruction::Mul: in OptimizeExpression()
926 case Instruction::Or: in OptimizeExpression()
930 case Instruction::Add: in OptimizeExpression()
931 case Instruction::Xor: in OptimizeExpression()
942 case Instruction::And: in OptimizeExpression()
943 case Instruction::Or: in OptimizeExpression()
944 case Instruction::Xor: { in OptimizeExpression()
952 case Instruction::Add: { in OptimizeExpression()
972 Instruction *BI = BBI++; in ReassociateInst()
973 if (BI->getOpcode() == Instruction::Shl && in ReassociateInst()
975 if (Instruction *NI = ConvertShiftToMul(BI, ValueRankMap)) { in ReassociateInst()
996 if (BI->getOpcode() == Instruction::Sub) { in ReassociateInst()
1007 if (isReassociableOp(BI->getOperand(1), Instruction::Mul) && in ReassociateInst()
1009 !isReassociableOp(BI->use_back(), Instruction::Mul))) { in ReassociateInst()
1027 if (I->hasOneUse() && I->getOpcode() == Instruction::Add && in ReassociateInst()
1028 cast<Instruction>(I->use_back())->getOpcode() == Instruction::Sub) in ReassociateInst()
1058 if (Instruction *VI = dyn_cast<Instruction>(V)) in ReassociateExpression()
1069 if (I->getOpcode() == Instruction::Mul && I->hasOneUse() && in ReassociateExpression()
1070 cast<Instruction>(I->use_back())->getOpcode() == Instruction::Add && in ReassociateExpression()
1083 if (Instruction *OI = dyn_cast<Instruction>(Ops[0].Op)) in ReassociateExpression()
1109 BasicBlock::iterator BBI = cast<Instruction>(V); in runOnFunction()