Home | History | Annotate | Download | only in InstCombine

Lines Matching full:instruction

104 /// Assuming that the specified instruction is an operand to the select, return
105 /// a bitmask indicating which operands of this instruction are foldable if they
108 static unsigned GetSelectFoldableOperands(Instruction *I) {
110 case Instruction::Add:
111 case Instruction::Mul:
112 case Instruction::And:
113 case Instruction::Or:
114 case Instruction::Xor:
116 case Instruction::Sub: // Can only fold on the amount subtracted.
117 case Instruction::Shl: // Can only fold on the shift amount.
118 case Instruction::LShr:
119 case Instruction::AShr:
128 static Constant *GetSelectFoldableConstant(Instruction *I) {
131 case Instruction::Add:
132 case Instruction::Sub:
133 case Instruction::Or:
134 case Instruction::Xor:
135 case Instruction::Shl:
136 case Instruction::LShr:
137 case Instruction::AShr:
139 case Instruction::And:
141 case Instruction::Mul:
148 Instruction *InstCombiner::FoldSelectOpOp(SelectInst &SI, Instruction *TI,
149 Instruction *FI) {
170 return CastInst::Create(Instruction::CastOps(TI->getOpcode()), NewSI,
235 Instruction *InstCombiner::FoldSelectIntoOp(SelectInst &SI, Value *TrueVal,
239 if (Instruction *TVI = dyn_cast<Instruction>(TrueVal)) {
274 if (Instruction *FVI = dyn_cast<Instruction>(FalseVal)) {
322 Instruction *I = dyn_cast<Instruction>(V);
347 // constant fold the instruction.
480 // input to the cttz/ctlz is used as LHS for the compare instruction.
499 Instruction *InstCombiner::visitSelectInstWithICmp(SelectInst &SI,
593 // Move ICI instruction right before the select instruction. Otherwise
594 // the sext/zext value may be defined after the ICI instruction uses it.
744 // If the value is a non-instruction value like a constant or argument, it
746 const Instruction *I = dyn_cast<Instruction>(V);
770 Instruction *InstCombiner::FoldSPFofSPF(Instruction *Inner,
773 Instruction &Outer,
836 /// both be) and we have an icmp instruction with zero, and we have an 'and'
910 Instruction *InstCombiner::visitSelectInst(SelectInst &SI) {
1071 if (Instruction *Result = visitSelectInstWithICmp(SI, ICI))
1074 if (Instruction *TI = dyn_cast<Instruction>(TrueVal))
1075 if (Instruction *FI = dyn_cast<Instruction>(FalseVal))
1077 Instruction *AddOp = nullptr, *SubOp = nullptr;
1081 if (Instruction *IV = FoldSelectOpOp(SI, TI, FI))
1086 if ((TI->getOpcode() == Instruction::Sub &&
1087 FI->getOpcode() == Instruction::Add) ||
1088 (TI->getOpcode() == Instruction::FSub &&
1089 FI->getOpcode() == Instruction::FAdd)) {
1091 } else if ((FI->getOpcode() == Instruction::Sub &&
1092 TI->getOpcode() == Instruction::Add) ||
1093 (FI->getOpcode() == Instruction::FSub &&
1094 TI->getOpcode() == Instruction::FAdd)) {
1112 if (Instruction *NegInst = dyn_cast<Instruction>(NegVal)) {
1130 Instruction *RI =
1145 if (Instruction *FoldI = FoldSelectIntoOp(SI, TrueVal, FalseVal))
1157 if (Instruction *R = FoldSPFofSPF(cast<Instruction>(LHS),SPF2,LHS2,RHS2,
1161 if (Instruction *R = FoldSPFofSPF(cast<Instruction>(RHS),SPF2,LHS2,RHS2,
1202 if (Instruction *NV = FoldOpIntoPhi(SI))