Lines Matching defs:Opcode
136 /// "(A op B) op' (A op C)". Here "op" is given by Opcode and "op'" is
140 static Value *ExpandBinOp(unsigned Opcode, Value *LHS, Value *RHS,
154 if (Value *L = SimplifyBinOp(Opcode, A, C, Q, MaxRecurse))
155 if (Value *R = SimplifyBinOp(Opcode, B, C, Q, MaxRecurse)) {
177 if (Value *L = SimplifyBinOp(Opcode, A, B, Q, MaxRecurse))
178 if (Value *R = SimplifyBinOp(Opcode, A, C, Q, MaxRecurse)) {
201 Instruction::BinaryOps Opcode = (Instruction::BinaryOps)Opc;
202 assert(Instruction::isAssociative(Opcode) && "Not an associative operation!");
212 if (Op0 && Op0->getOpcode() == Opcode) {
218 if (Value *V = SimplifyBinOp(Opcode, B, C, Q, MaxRecurse)) {
223 if (Value *W = SimplifyBinOp(Opcode, A, V, Q, MaxRecurse)) {
231 if (Op1 && Op1->getOpcode() == Opcode) {
237 if (Value *V = SimplifyBinOp(Opcode, A, B, Q, MaxRecurse)) {
242 if (Value *W = SimplifyBinOp(Opcode, V, C, Q, MaxRecurse)) {
250 if (!Instruction::isCommutative(Opcode))
254 if (Op0 && Op0->getOpcode() == Opcode) {
260 if (Value *V = SimplifyBinOp(Opcode, C, A, Q, MaxRecurse)) {
265 if (Value *W = SimplifyBinOp(Opcode, V, B, Q, MaxRecurse)) {
273 if (Op1 && Op1->getOpcode() == Opcode) {
279 if (Value *V = SimplifyBinOp(Opcode, C, A, Q, MaxRecurse)) {
284 if (Value *W = SimplifyBinOp(Opcode, B, V, Q, MaxRecurse)) {
298 static Value *ThreadBinOpOverSelect(unsigned Opcode, Value *LHS, Value *RHS,
316 TV = SimplifyBinOp(Opcode, SI->getTrueValue(), RHS, Q, MaxRecurse);
317 FV = SimplifyBinOp(Opcode, SI->getFalseValue(), RHS, Q, MaxRecurse);
319 TV = SimplifyBinOp(Opcode, LHS, SI->getTrueValue(), Q, MaxRecurse);
320 FV = SimplifyBinOp(Opcode, LHS, SI->getFalseValue(), Q, MaxRecurse);
346 if (Simplified && Simplified->getOpcode() == Opcode) {
451 static Value *ThreadBinOpOverPHI(unsigned Opcode, Value *LHS, Value *RHS,
477 SimplifyBinOp(Opcode, Incoming, RHS, Q, MaxRecurse) :
478 SimplifyBinOp(Opcode, LHS, Incoming, Q, MaxRecurse);
982 static Value *SimplifyDiv(Instruction::BinaryOps Opcode, Value *Op0, Value *Op1,
986 return ConstantFoldBinaryOpOperands(Opcode, C0, C1, Q.DL);
988 bool isSigned = Opcode == Instruction::SDiv;
1029 if (Div->getOpcode() == Opcode && Div->getOperand(1) == Y)
1051 if (Value *V = ThreadBinOpOverSelect(Opcode, Op0, Op1, Q, MaxRecurse))
1057 if (Value *V = ThreadBinOpOverPHI(Opcode, Op0, Op1, Q, MaxRecurse))
1144 static Value *SimplifyRem(Instruction::BinaryOps Opcode, Value *Op0, Value *Op1,
1148 return ConstantFoldBinaryOpOperands(Opcode, C0, C1, Q.DL);
1179 if ((Opcode == Instruction::SRem &&
1181 (Opcode == Instruction::URem &&
1188 if (Value *V = ThreadBinOpOverSelect(Opcode, Op0, Op1, Q, MaxRecurse))
1194 if (Value *V = ThreadBinOpOverPHI(Opcode, Op0, Op1, Q, MaxRecurse))
1293 static Value *SimplifyShift(unsigned Opcode, Value *Op0, Value *Op1,
1297 return ConstantFoldBinaryOpOperands(Opcode, C0, C1, Q.DL);
1314 if (Value *V = ThreadBinOpOverSelect(Opcode, Op0, Op1, Q, MaxRecurse))
1320 if (Value *V = ThreadBinOpOverPHI(Opcode, Op0, Op1, Q, MaxRecurse))
1344 static Value *SimplifyRightShift(unsigned Opcode, Value *Op0, Value *Op1,
1347 if (Value *V = SimplifyShift(Opcode, Op0, Op1, Q, MaxRecurse))
3761 static Value *SimplifyBinOp(unsigned Opcode, Value *LHS, Value *RHS,
3763 switch (Opcode) {
3800 return ConstantFoldBinaryOpOperands(Opcode, CLHS, CRHS, Q.DL);
3803 if (Instruction::isAssociative(Opcode))
3804 if (Value *V = SimplifyAssociativeBinOp(Opcode, LHS, RHS, Q, MaxRecurse))
3810 if (Value *V = ThreadBinOpOverSelect(Opcode, LHS, RHS, Q, MaxRecurse))
3816 if (Value *V = ThreadBinOpOverPHI(Opcode, LHS, RHS, Q, MaxRecurse))
3827 static Value *SimplifyFPBinOp(unsigned Opcode, Value *LHS, Value *RHS,
3830 switch (Opcode) {
3838 return SimplifyBinOp(Opcode, LHS, RHS, Q, MaxRecurse);
3842 Value *llvm::SimplifyBinOp(unsigned Opcode, Value *LHS, Value *RHS,
3846 return ::SimplifyBinOp(Opcode, LHS, RHS, Query(DL, TLI, DT, AC, CxtI),
3850 Value *llvm::SimplifyFPBinOp(unsigned Opcode, Value *LHS, Value *RHS,
3855 return ::SimplifyFPBinOp(Opcode, LHS, RHS, FMF, Query(DL, TLI, DT, AC, CxtI),