Lines Matching refs:Instruction
84 static unsigned GetSelectFoldableOperands(Instruction *I) { in GetSelectFoldableOperands()
86 case Instruction::Add: in GetSelectFoldableOperands()
87 case Instruction::Mul: in GetSelectFoldableOperands()
88 case Instruction::And: in GetSelectFoldableOperands()
89 case Instruction::Or: in GetSelectFoldableOperands()
90 case Instruction::Xor: in GetSelectFoldableOperands()
92 case Instruction::Sub: // Can only fold on the amount subtracted. in GetSelectFoldableOperands()
93 case Instruction::Shl: // Can only fold on the shift amount. in GetSelectFoldableOperands()
94 case Instruction::LShr: in GetSelectFoldableOperands()
95 case Instruction::AShr: in GetSelectFoldableOperands()
104 static Constant *GetSelectFoldableConstant(Instruction *I) { in GetSelectFoldableConstant()
107 case Instruction::Add: in GetSelectFoldableConstant()
108 case Instruction::Sub: in GetSelectFoldableConstant()
109 case Instruction::Or: in GetSelectFoldableConstant()
110 case Instruction::Xor: in GetSelectFoldableConstant()
111 case Instruction::Shl: in GetSelectFoldableConstant()
112 case Instruction::LShr: in GetSelectFoldableConstant()
113 case Instruction::AShr: in GetSelectFoldableConstant()
115 case Instruction::And: in GetSelectFoldableConstant()
117 case Instruction::Mul: in GetSelectFoldableConstant()
124 Instruction *InstCombiner::FoldSelectOpOp(SelectInst &SI, Instruction *TI, in FoldSelectOpOp()
125 Instruction *FI) { in FoldSelectOpOp()
139 return CastInst::Create(Instruction::CastOps(TI->getOpcode()), NewSI, in FoldSelectOpOp()
204 Instruction *InstCombiner::FoldSelectIntoOp(SelectInst &SI, Value *TrueVal, in FoldSelectIntoOp()
208 if (Instruction *TVI = dyn_cast<Instruction>(TrueVal)) { in FoldSelectIntoOp()
243 if (Instruction *FVI = dyn_cast<Instruction>(FalseVal)) { in FoldSelectIntoOp()
290 Instruction *I = dyn_cast<Instruction>(V); in SimplifyWithOpReplaced()
345 Instruction *InstCombiner::visitSelectInstWithICmp(SelectInst &SI, in visitSelectInstWithICmp()
532 const Instruction *I = dyn_cast<Instruction>(V); in CanSelectOperandBeMappingIntoPredBlock()
556 Instruction *InstCombiner::FoldSPFofSPF(Instruction *Inner, in FoldSPFofSPF()
559 Instruction &Outer, in FoldSPFofSPF()
651 Instruction *InstCombiner::visitSelectInst(SelectInst &SI) { in visitSelectInst()
781 if (Instruction *Result = visitSelectInstWithICmp(SI, ICI)) in visitSelectInst()
784 if (Instruction *TI = dyn_cast<Instruction>(TrueVal)) in visitSelectInst()
785 if (Instruction *FI = dyn_cast<Instruction>(FalseVal)) in visitSelectInst()
787 Instruction *AddOp = 0, *SubOp = 0; in visitSelectInst()
791 if (Instruction *IV = FoldSelectOpOp(SI, TI, FI)) in visitSelectInst()
796 if ((TI->getOpcode() == Instruction::Sub && in visitSelectInst()
797 FI->getOpcode() == Instruction::Add) || in visitSelectInst()
798 (TI->getOpcode() == Instruction::FSub && in visitSelectInst()
799 FI->getOpcode() == Instruction::FAdd)) { in visitSelectInst()
801 } else if ((FI->getOpcode() == Instruction::Sub && in visitSelectInst()
802 TI->getOpcode() == Instruction::Add) || in visitSelectInst()
803 (FI->getOpcode() == Instruction::FSub && in visitSelectInst()
804 TI->getOpcode() == Instruction::FAdd)) { in visitSelectInst()
844 if (Instruction *FoldI = FoldSelectIntoOp(SI, TrueVal, FalseVal)) in visitSelectInst()
854 if (Instruction *R = FoldSPFofSPF(cast<Instruction>(LHS),SPF2,LHS2,RHS2, in visitSelectInst()
858 if (Instruction *R = FoldSPFofSPF(cast<Instruction>(RHS),SPF2,LHS2,RHS2, in visitSelectInst()
873 if (Instruction *NV = FoldOpIntoPhi(SI)) in visitSelectInst()