Lines Matching refs:Opcode

148 static BinaryOperator *isReassociableOp(Value *V, unsigned Opcode) {
150 if (I && I->hasOneUse() && I->getOpcode() == Opcode)
304 static void IncorporateWeight(APInt &LHS, const APInt &RHS, unsigned Opcode) {
322 if (Instruction::isIdempotent(Opcode)) {
329 if (Instruction::isNilpotent(Opcode)) {
335 if (Opcode == Instruction::Add || Opcode == Instruction::FAdd) {
341 assert((Opcode == Instruction::Mul || Opcode == Instruction::FMul) &&
458 unsigned Opcode = I->getOpcode();
510 if (BinaryOperator *BO = isReassociableOp(Op, Opcode)) {
538 IncorporateWeight(It->second, Weight, Opcode);
551 if (BinaryOperator *BO = isReassociableOp(Op, Opcode)) {
574 cast<Instruction>(Op)->getOpcode() != Opcode
583 if ((Opcode == Instruction::Mul && match(Tmp, m_Neg(m_Value()))) ||
584 (Opcode == Instruction::FMul && match(Tmp, m_FNeg(m_Value())))) {
597 assert(!isReassociableOp(Op, Opcode) && "Value was morphed?");
611 assert(!isReassociableOp(V, Opcode) && "Shouldn't be a leaf!");
625 Constant *Identity = ConstantExpr::getBinOpIdentity(Opcode, I->getType());
651 unsigned Opcode = I->getOpcode();
700 BinaryOperator *BO = isReassociableOp(OldLHS, Opcode);
706 BinaryOperator *BO = isReassociableOp(OldRHS, Opcode);
731 BinaryOperator *BO = isReassociableOp(Op->getOperand(1), Opcode);
745 BinaryOperator *BO = isReassociableOp(Op->getOperand(0), Opcode);
761 NewOp = BinaryOperator::Create(Instruction::BinaryOps(Opcode),
1132 static Value *OptimizeAndOrXor(unsigned Opcode,
1143 if (Opcode == Instruction::And) // ...&X&~X = 0
1146 if (Opcode == Instruction::Or) // ...|X|~X = -1
1155 if (Opcode == Instruction::And || Opcode == Instruction::Or) {
1164 assert(Opcode == Instruction::Xor);
1839 unsigned Opcode = I->getOpcode();
1842 Cst = Cst ? ConstantExpr::get(Opcode, C, Cst) : C;
1851 if (Cst && Cst != ConstantExpr::getBinOpIdentity(Opcode, I->getType())) {
1852 if (Cst == ConstantExpr::getBinOpAbsorber(Opcode, I->getType()))
1862 switch (Opcode) {
1866 if (Value *Result = OptimizeAndOrXor(Opcode, Ops))
1927 unsigned Opcode = Op->getOpcode();
1928 while (Op->hasOneUse() && Op->user_back()->getOpcode() == Opcode &&
2176 unsigned Opcode = BO->getOpcode();
2177 if (BO->hasOneUse() && BO->user_back()->getOpcode() == Opcode) {