Lines Matching full:opcode
235 /// opcode and if it only has one use.
236 static BinaryOperator *isReassociableOp(Value *V, unsigned Opcode) {
238 cast<Instruction>(V)->getOpcode() == Opcode)
349 static void IncorporateWeight(APInt &LHS, const APInt &RHS, unsigned Opcode) {
367 if (Instruction::isIdempotent(Opcode)) {
374 if (Instruction::isNilpotent(Opcode)) {
380 if (Opcode == Instruction::Add) {
386 assert(Opcode == Instruction::Mul && "Unknown associative operation!");
444 /// opcode), or is the same kind of binary operator but has a use which either
501 unsigned Opcode = I->getOpcode();
502 assert(Instruction::isAssociative(Opcode) &&
503 Instruction::isCommutative(Opcode) &&
554 if (BinaryOperator *BO = isReassociableOp(Op, Opcode)) {
580 IncorporateWeight(It->second, Weight, Opcode);
593 if (BinaryOperator *BO = isReassociableOp(Op, Opcode)) {
616 cast<Instruction>(Op)->getOpcode() != Opcode) &&
623 if (Opcode == Instruction::Mul && BO && BinaryOperator::isNeg(BO)) {
635 assert(!isReassociableOp(Op, Opcode) && "Value was morphed?");
649 assert(!isReassociableOp(V, Opcode) && "Shouldn't be a leaf!");
663 Constant *Identity = ConstantExpr::getBinOpIdentity(Opcode, I->getType());
689 unsigned Opcode = I->getOpcode();
738 BinaryOperator *BO = isReassociableOp(OldLHS, Opcode);
744 BinaryOperator *BO = isReassociableOp(OldRHS, Opcode);
769 BinaryOperator *BO = isReassociableOp(Op->getOperand(1), Opcode);
783 BinaryOperator *BO = isReassociableOp(Op->getOperand(0), Opcode);
799 NewOp = BinaryOperator::Create(Instruction::BinaryOps(Opcode),
1077 static Value *OptimizeAndOrXor(unsigned Opcode,
1088 if (Opcode == Instruction::And) // ...&X&~X = 0
1091 if (Opcode == Instruction::Or) // ...|X|~X = -1
1100 if (Opcode == Instruction::And || Opcode == Instruction::Or) {
1109 assert(Opcode == Instruction::Xor);
1730 unsigned Opcode = I->getOpcode();
1733 Cst = Cst ? ConstantExpr::get(Opcode, C, Cst) : C;
1742 if (Cst && Cst != ConstantExpr::getBinOpIdentity(Opcode, I->getType())) {
1743 if (Cst == ConstantExpr::getBinOpAbsorber(Opcode, I->getType()))
1753 switch (Opcode) {
1757 if (Value *Result = OptimizeAndOrXor(Opcode, Ops))
1797 unsigned Opcode = Op->getOpcode();
1798 while (Op->hasOneUse() && Op->use_back()->getOpcode() == Opcode &&
1887 unsigned Opcode = BO->getOpcode();
1888 if (BO->hasOneUse() && BO->use_back()->getOpcode() == Opcode)