Lines Matching refs:CI
74 static bool optimizeCallInst(CallInst *CI, bool &ModifiedDT,
145 static void scalarizeMaskedLoad(const DataLayout &DL, CallInst *CI, in scalarizeMaskedLoad() argument
147 Value *Ptr = CI->getArgOperand(0); in scalarizeMaskedLoad()
148 Value *Alignment = CI->getArgOperand(1); in scalarizeMaskedLoad()
149 Value *Mask = CI->getArgOperand(2); in scalarizeMaskedLoad()
150 Value *Src0 = CI->getArgOperand(3); in scalarizeMaskedLoad()
153 VectorType *VecType = cast<FixedVectorType>(CI->getType()); in scalarizeMaskedLoad()
157 IRBuilder<> Builder(CI->getContext()); in scalarizeMaskedLoad()
158 Instruction *InsertPt = CI; in scalarizeMaskedLoad()
159 BasicBlock *IfBlock = CI->getParent(); in scalarizeMaskedLoad()
162 Builder.SetCurrentDebugLocation(CI->getDebugLoc()); in scalarizeMaskedLoad()
167 CI->replaceAllUsesWith(NewI); in scalarizeMaskedLoad()
168 CI->eraseFromParent(); in scalarizeMaskedLoad()
192 CI->replaceAllUsesWith(VResult); in scalarizeMaskedLoad()
193 CI->eraseFromParent(); in scalarizeMaskedLoad()
255 CI->replaceAllUsesWith(VResult); in scalarizeMaskedLoad()
256 CI->eraseFromParent(); in scalarizeMaskedLoad()
287 static void scalarizeMaskedStore(const DataLayout &DL, CallInst *CI, in scalarizeMaskedStore() argument
289 Value *Src = CI->getArgOperand(0); in scalarizeMaskedStore()
290 Value *Ptr = CI->getArgOperand(1); in scalarizeMaskedStore()
291 Value *Alignment = CI->getArgOperand(2); in scalarizeMaskedStore()
292 Value *Mask = CI->getArgOperand(3); in scalarizeMaskedStore()
299 IRBuilder<> Builder(CI->getContext()); in scalarizeMaskedStore()
300 Instruction *InsertPt = CI; in scalarizeMaskedStore()
302 Builder.SetCurrentDebugLocation(CI->getDebugLoc()); in scalarizeMaskedStore()
307 CI->eraseFromParent(); in scalarizeMaskedStore()
328 CI->eraseFromParent(); in scalarizeMaskedStore()
381 CI->eraseFromParent(); in scalarizeMaskedStore()
415 static void scalarizeMaskedGather(const DataLayout &DL, CallInst *CI, in scalarizeMaskedGather() argument
417 Value *Ptrs = CI->getArgOperand(0); in scalarizeMaskedGather()
418 Value *Alignment = CI->getArgOperand(1); in scalarizeMaskedGather()
419 Value *Mask = CI->getArgOperand(2); in scalarizeMaskedGather()
420 Value *Src0 = CI->getArgOperand(3); in scalarizeMaskedGather()
422 auto *VecType = cast<FixedVectorType>(CI->getType()); in scalarizeMaskedGather()
425 IRBuilder<> Builder(CI->getContext()); in scalarizeMaskedGather()
426 Instruction *InsertPt = CI; in scalarizeMaskedGather()
427 BasicBlock *IfBlock = CI->getParent(); in scalarizeMaskedGather()
431 Builder.SetCurrentDebugLocation(CI->getDebugLoc()); in scalarizeMaskedGather()
448 CI->replaceAllUsesWith(VResult); in scalarizeMaskedGather()
449 CI->eraseFromParent(); in scalarizeMaskedGather()
513 CI->replaceAllUsesWith(VResult); in scalarizeMaskedGather()
514 CI->eraseFromParent(); in scalarizeMaskedGather()
545 static void scalarizeMaskedScatter(const DataLayout &DL, CallInst *CI, in scalarizeMaskedScatter() argument
547 Value *Src = CI->getArgOperand(0); in scalarizeMaskedScatter()
548 Value *Ptrs = CI->getArgOperand(1); in scalarizeMaskedScatter()
549 Value *Alignment = CI->getArgOperand(2); in scalarizeMaskedScatter()
550 Value *Mask = CI->getArgOperand(3); in scalarizeMaskedScatter()
559 IRBuilder<> Builder(CI->getContext()); in scalarizeMaskedScatter()
560 Instruction *InsertPt = CI; in scalarizeMaskedScatter()
562 Builder.SetCurrentDebugLocation(CI->getDebugLoc()); in scalarizeMaskedScatter()
577 CI->eraseFromParent(); in scalarizeMaskedScatter()
630 CI->eraseFromParent(); in scalarizeMaskedScatter()
635 static void scalarizeMaskedExpandLoad(const DataLayout &DL, CallInst *CI, in scalarizeMaskedExpandLoad() argument
637 Value *Ptr = CI->getArgOperand(0); in scalarizeMaskedExpandLoad()
638 Value *Mask = CI->getArgOperand(1); in scalarizeMaskedExpandLoad()
639 Value *PassThru = CI->getArgOperand(2); in scalarizeMaskedExpandLoad()
641 auto *VecType = cast<FixedVectorType>(CI->getType()); in scalarizeMaskedExpandLoad()
645 IRBuilder<> Builder(CI->getContext()); in scalarizeMaskedExpandLoad()
646 Instruction *InsertPt = CI; in scalarizeMaskedExpandLoad()
647 BasicBlock *IfBlock = CI->getParent(); in scalarizeMaskedExpandLoad()
650 Builder.SetCurrentDebugLocation(CI->getDebugLoc()); in scalarizeMaskedExpandLoad()
681 CI->replaceAllUsesWith(VResult); in scalarizeMaskedExpandLoad()
682 CI->eraseFromParent(); in scalarizeMaskedExpandLoad()
756 CI->replaceAllUsesWith(VResult); in scalarizeMaskedExpandLoad()
757 CI->eraseFromParent(); in scalarizeMaskedExpandLoad()
762 static void scalarizeMaskedCompressStore(const DataLayout &DL, CallInst *CI, in scalarizeMaskedCompressStore() argument
765 Value *Src = CI->getArgOperand(0); in scalarizeMaskedCompressStore()
766 Value *Ptr = CI->getArgOperand(1); in scalarizeMaskedCompressStore()
767 Value *Mask = CI->getArgOperand(2); in scalarizeMaskedCompressStore()
771 IRBuilder<> Builder(CI->getContext()); in scalarizeMaskedCompressStore()
772 Instruction *InsertPt = CI; in scalarizeMaskedCompressStore()
773 BasicBlock *IfBlock = CI->getParent(); in scalarizeMaskedCompressStore()
776 Builder.SetCurrentDebugLocation(CI->getDebugLoc()); in scalarizeMaskedCompressStore()
794 CI->eraseFromParent(); in scalarizeMaskedCompressStore()
860 CI->eraseFromParent(); in scalarizeMaskedCompressStore()
920 if (CallInst *CI = dyn_cast<CallInst>(&*CurInstIterator++)) in optimizeBlock() local
921 MadeChange |= optimizeCallInst(CI, ModifiedDT, TTI, DL, DTU); in optimizeBlock()
929 static bool optimizeCallInst(CallInst *CI, bool &ModifiedDT, in optimizeCallInst() argument
932 IntrinsicInst *II = dyn_cast<IntrinsicInst>(CI); in optimizeCallInst()
946 CI->getType(), in optimizeCallInst()
947 cast<ConstantInt>(CI->getArgOperand(1))->getAlignValue())) in optimizeCallInst()
949 scalarizeMaskedLoad(DL, CI, DTU, ModifiedDT); in optimizeCallInst()
953 CI->getArgOperand(0)->getType(), in optimizeCallInst()
954 cast<ConstantInt>(CI->getArgOperand(2))->getAlignValue())) in optimizeCallInst()
956 scalarizeMaskedStore(DL, CI, DTU, ModifiedDT); in optimizeCallInst()
960 cast<ConstantInt>(CI->getArgOperand(1))->getMaybeAlignValue(); in optimizeCallInst()
961 Type *LoadTy = CI->getType(); in optimizeCallInst()
966 scalarizeMaskedGather(DL, CI, DTU, ModifiedDT); in optimizeCallInst()
971 cast<ConstantInt>(CI->getArgOperand(2))->getMaybeAlignValue(); in optimizeCallInst()
972 Type *StoreTy = CI->getArgOperand(0)->getType(); in optimizeCallInst()
977 scalarizeMaskedScatter(DL, CI, DTU, ModifiedDT); in optimizeCallInst()
981 if (TTI.isLegalMaskedExpandLoad(CI->getType())) in optimizeCallInst()
983 scalarizeMaskedExpandLoad(DL, CI, DTU, ModifiedDT); in optimizeCallInst()
986 if (TTI.isLegalMaskedCompressStore(CI->getArgOperand(0)->getType())) in optimizeCallInst()
988 scalarizeMaskedCompressStore(DL, CI, DTU, ModifiedDT); in optimizeCallInst()