Lines Matching refs:I
173 Instruction *I = Worklist.back(); in tryInterleave() local
176 switch (I->getOpcode()) { in tryInterleave()
180 if (!Truncs.insert(I)) in tryInterleave()
182 Visited.insert(I); in tryInterleave()
189 if (Exts.count(I)) in tryInterleave()
191 for (auto *Use : I->users()) in tryInterleave()
193 Exts.insert(I); in tryInterleave()
197 IntrinsicInst *II = dyn_cast<IntrinsicInst>(I); in tryInterleave()
202 if (!Reducts.insert(I)) in tryInterleave()
204 Visited.insert(I); in tryInterleave()
245 if (!Ops.insert(I)) in tryInterleave()
248 for (Use &Op : I->operands()) { in tryInterleave()
257 for (auto *Use : I->users()) in tryInterleave()
263 if (cast<ShuffleVectorInst>(I)->isZeroEltSplat()) in tryInterleave()
268 LLVM_DEBUG(dbgs() << " Unhandled instruction: " << *I << "\n"); in tryInterleave()
278 for (auto *I : Exts) in tryInterleave()
279 dbgs() << " " << *I << "\n"; in tryInterleave()
281 for (auto *I : Ops) in tryInterleave()
282 dbgs() << " " << *I << "\n"; in tryInterleave()
284 for (auto *I : OtherLeafs) in tryInterleave()
285 dbgs() << " " << *I->get() << " of " << *I->getUser() << "\n"; in tryInterleave()
287 for (auto *I : Truncs) in tryInterleave()
288 dbgs() << " " << *I << "\n"; in tryInterleave()
290 for (auto *I : Reducts) in tryInterleave()
291 dbgs() << " " << *I << "\n"; in tryInterleave()
318 for (Instruction *I : Exts) in tryInterleave()
319 if (I->getOperand(0)->getType() != VT) { in tryInterleave()
320 LLVM_DEBUG(dbgs() << " Wrong type on " << *I << "\n"); in tryInterleave()
323 for (Instruction *I : Truncs) in tryInterleave()
324 if (I->getType() != VT) { in tryInterleave()
325 LLVM_DEBUG(dbgs() << " Wrong type on " << *I << "\n"); in tryInterleave()
332 if (!Reducts.empty() && (Ops.empty() || all_of(Ops, [](Instruction *I) { in tryInterleave() argument
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()
362 LLVM_DEBUG(dbgs() << "Replacing ext " << *I << "\n"); in tryInterleave()
363 Builder.SetInsertPoint(I); in tryInterleave()
364 Value *Shuffle = Builder.CreateShuffleVector(I->getOperand(0), LeafMask); in tryInterleave()
365 bool FPext = isa<FPExtInst>(I); in tryInterleave()
366 bool Sext = isa<SExtInst>(I); in tryInterleave()
367 Value *Ext = FPext ? Builder.CreateFPExt(Shuffle, I->getType()) in tryInterleave()
368 : Sext ? Builder.CreateSExt(Shuffle, I->getType()) in tryInterleave()
369 : Builder.CreateZExt(Shuffle, I->getType()); in tryInterleave()
370 I->replaceAllUsesWith(Ext); in tryInterleave()
374 for (Use *I : OtherLeafs) { in tryInterleave()
375 LLVM_DEBUG(dbgs() << "Replacing leaf " << *I << "\n"); in tryInterleave()
376 Builder.SetInsertPoint(cast<Instruction>(I->getUser())); in tryInterleave()
377 Value *Shuffle = Builder.CreateShuffleVector(I->get(), LeafMask); in tryInterleave()
378 I->getUser()->setOperand(I->getOperandNo(), Shuffle); in tryInterleave()
382 for (Instruction *I : Truncs) { in tryInterleave()
383 LLVM_DEBUG(dbgs() << "Replacing trunc " << *I << "\n"); in tryInterleave()
385 Builder.SetInsertPoint(I->getParent(), ++I->getIterator()); in tryInterleave()
386 Value *Shuf = Builder.CreateShuffleVector(I, TruncMask); in tryInterleave()
387 I->replaceAllUsesWith(Shuf); in tryInterleave()
388 cast<Instruction>(Shuf)->setOperand(0, I); in tryInterleave()
398 static bool isAddReduction(Instruction &I) { in isAddReduction() argument
399 if (auto *II = dyn_cast<IntrinsicInst>(&I)) in isAddReduction()
416 for (Instruction &I : reverse(instructions(F))) { in runOnFunction()
417 if (((I.getType()->isVectorTy() && in runOnFunction()
418 (isa<TruncInst>(I) || isa<FPTruncInst>(I))) || in runOnFunction()
419 isAddReduction(I)) && in runOnFunction()
420 !Visited.count(&I)) in runOnFunction()
421 Changed |= tryInterleave(&I, Visited); in runOnFunction()