Lines Matching full:instruction
10 // a single sext/zext or trunc instruction that takes the bottom half of a
16 // instruction, we often have to turn sext/zext/trunc into a series of lane
61 #include "llvm/IR/Instruction.h"
115 static bool isProfitableToInterleave(SmallSetVector<Instruction *, 4> &Exts, in isProfitableToInterleave() argument
116 SmallSetVector<Instruction *, 4> &Truncs) { in isProfitableToInterleave()
146 cast<Instruction>(*E->user_begin())->getOpcode() != Instruction::Mul) { in isProfitableToInterleave()
154 static bool tryInterleave(Instruction *Start, in tryInterleave()
155 SmallPtrSetImpl<Instruction *> &Visited) { in tryInterleave()
158 if (!isa<Instruction>(Start->getOperand(0))) in tryInterleave()
162 std::vector<Instruction *> Worklist; in tryInterleave()
164 Worklist.push_back(cast<Instruction>(Start->getOperand(0))); in tryInterleave()
166 SmallSetVector<Instruction *, 4> Truncs; in tryInterleave()
167 SmallSetVector<Instruction *, 4> Reducts; in tryInterleave()
168 SmallSetVector<Instruction *, 4> Exts; in tryInterleave()
170 SmallSetVector<Instruction *, 4> Ops; in tryInterleave()
173 Instruction *I = Worklist.back(); in tryInterleave()
178 case Instruction::Trunc: in tryInterleave()
179 case Instruction::FPTrunc: in tryInterleave()
186 case Instruction::SExt: in tryInterleave()
187 case Instruction::ZExt: in tryInterleave()
188 case Instruction::FPExt: in tryInterleave()
192 Worklist.push_back(cast<Instruction>(Use)); in tryInterleave()
196 case Instruction::Call: { in tryInterleave()
234 case Instruction::Add: in tryInterleave()
235 case Instruction::Sub: in tryInterleave()
236 case Instruction::Mul: in tryInterleave()
237 case Instruction::AShr: in tryInterleave()
238 case Instruction::LShr: in tryInterleave()
239 case Instruction::Shl: in tryInterleave()
240 case Instruction::ICmp: in tryInterleave()
241 case Instruction::FCmp: in tryInterleave()
242 case Instruction::FAdd: in tryInterleave()
243 case Instruction::FMul: in tryInterleave()
244 case Instruction::Select: in tryInterleave()
251 if (isa<Instruction>(Op)) in tryInterleave()
252 Worklist.push_back(cast<Instruction>(&Op)); in tryInterleave()
258 Worklist.push_back(cast<Instruction>(Use)); in tryInterleave()
261 case Instruction::ShuffleVector: in tryInterleave()
268 LLVM_DEBUG(dbgs() << " Unhandled instruction: " << *I << "\n"); in tryInterleave()
318 for (Instruction *I : Exts) in tryInterleave()
323 for (Instruction *I : Truncs) in tryInterleave()
332 if (!Reducts.empty() && (Ops.empty() || all_of(Ops, [](Instruction *I) { in tryInterleave()
333 return I->getOpcode() == Instruction::Mul || in tryInterleave()
334 I->getOpcode() == Instruction::Select || in tryInterleave()
335 I->getOpcode() == Instruction::ICmp; in tryInterleave()
361 for (Instruction *I : Exts) { in tryInterleave()
376 Builder.SetInsertPoint(cast<Instruction>(I->getUser())); in tryInterleave()
382 for (Instruction *I : Truncs) { in tryInterleave()
388 cast<Instruction>(Shuf)->setOperand(0, I); in tryInterleave()
398 static bool isAddReduction(Instruction &I) { in isAddReduction()
415 SmallPtrSet<Instruction *, 16> Visited; in runOnFunction()
416 for (Instruction &I : reverse(instructions(F))) { in runOnFunction()