Home | History | Annotate | Download | only in Scalar

Lines Matching defs:Opcode

159 /// opcode and if it only has one use.
160 static BinaryOperator *isReassociableOp(Value *V, unsigned Opcode) {
162 cast<Instruction>(V)->getOpcode() == Opcode)
270 static void IncorporateWeight(APInt &LHS, const APInt &RHS, unsigned Opcode) {
288 if (Instruction::isIdempotent(Opcode)) {
295 if (Instruction::isNilpotent(Opcode)) {
301 if (Opcode == Instruction::Add) {
307 assert(Opcode == Instruction::Mul && "Unknown associative operation!");
344 static Constant *EvaluateRepeatedConstant(unsigned Opcode, Constant *C,
348 if (Opcode == Instruction::Add)
359 Result = Result ? ConstantExpr::get(Opcode, Result, Power) : Power;
365 Power = ConstantExpr::get(Opcode, Power, Power);
397 /// opcode), or is the same kind of binary operator but has a use which either
454 unsigned Opcode = I->getOpcode();
455 assert(Instruction::isAssociative(Opcode) &&
456 Instruction::isCommutative(Opcode) &&
461 Constant *Absorber = ConstantExpr::getBinOpAbsorber(Opcode, I->getType());
518 if (BinaryOperator *BO = isReassociableOp(Op, Opcode)) {
544 IncorporateWeight(It->second, Weight, Opcode);
557 if (BinaryOperator *BO = isReassociableOp(Op, Opcode)) {
580 cast<Instruction>(Op)->getOpcode() != Opcode) &&
587 if (Opcode == Instruction::Mul && BO && BinaryOperator::isNeg(BO)) {
599 assert(!isReassociableOp(Op, Opcode) && "Value was morphed?");
614 assert(!isReassociableOp(V, Opcode) && "Shouldn't be a leaf!");
623 C = EvaluateRepeatedConstant(Opcode, C, Weight);
624 Cst = Cst ? ConstantExpr::get(Opcode, Cst, C) : C;
633 Constant *Identity = ConstantExpr::getBinOpIdentity(Opcode, I->getType());
671 unsigned Opcode = I->getOpcode();
706 if (BinaryOperator *BO = isReassociableOp(OldLHS, Opcode))
711 if (BinaryOperator *BO = isReassociableOp(OldRHS, Opcode))
735 if (BinaryOperator *BO = isReassociableOp(Op->getOperand(1), Opcode))
748 if (BinaryOperator *BO = isReassociableOp(Op->getOperand(0), Opcode)) {
763 NewOp = BinaryOperator::Create(Instruction::BinaryOps(Opcode),
1041 static Value *OptimizeAndOrXor(unsigned Opcode,
1052 if (Opcode == Instruction::And) // ...&X&~X = 0
1055 if (Opcode == Instruction::Or) // ...|X|~X = -1
1064 if (Opcode == Instruction::And || Opcode == Instruction::Or) {
1073 assert(Opcode == Instruction::Xor);
1451 unsigned Opcode = I->getOpcode();
1456 switch (Opcode) {
1461 if (Value *Result = OptimizeAndOrXor(Opcode, Ops))
1496 unsigned Opcode = Op->getOpcode();
1497 while (Op->hasOneUse() && Op->use_back()->getOpcode() == Opcode &&
1586 unsigned Opcode = BO->getOpcode();
1587 if (BO->hasOneUse() && BO->use_back()->getOpcode() == Opcode)