Lines Matching refs:CI
54 llvm::function_ref<Error(CallInst *CI)> ReplaceCall) { in replaceFunction()
56 CallInst *CI = dyn_cast<CallInst>(U); in replaceFunction() local
57 if (!CI) in replaceFunction()
60 if (Error E = ReplaceCall(CI)) { in replaceFunction()
63 *CI->getFunction(), Message, CI->getDebugLoc())); in replaceFunction()
109 return replaceFunction(F, [&](CallInst *CI) -> Error { in replaceFunctionWithOp() argument
110 OpBuilder.getIRB().SetInsertPoint(CI); in replaceFunctionWithOp()
116 Args.push_back(CI->getArgOperand(A.Value)); in replaceFunctionWithOp()
127 Args.append(CI->arg_begin(), CI->arg_end()); in replaceFunctionWithOp()
131 OpBuilder.tryCreateOp(DXILOp, Args, CI->getName(), F.getReturnType()); in replaceFunctionWithOp()
135 if (isa<StructType>(CI->getType())) { in replaceFunctionWithOp()
136 if (Error E = replaceNamedStructUses(CI, *OpCall)) in replaceFunctionWithOp()
139 CI->replaceAllUsesWith(*OpCall); in replaceFunctionWithOp()
141 CI->eraseFromParent(); in replaceFunctionWithOp()
202 void removeResourceGlobals(CallInst *CI) { in removeResourceGlobals() argument
203 for (User *User : make_early_inc_range(CI->users())) { in removeResourceGlobals()
216 void replaceHandleFromBindingCall(CallInst *CI, Value *Replacement) { in replaceHandleFromBindingCall() argument
217 assert(CI->getCalledFunction()->getIntrinsicID() == in replaceHandleFromBindingCall()
220 removeResourceGlobals(CI); in replaceHandleFromBindingCall()
222 auto *NameGlobal = dyn_cast<llvm::GlobalVariable>(CI->getArgOperand(5)); in replaceHandleFromBindingCall()
224 CI->replaceAllUsesWith(Replacement); in replaceHandleFromBindingCall()
225 CI->eraseFromParent(); in replaceHandleFromBindingCall()
236 return replaceFunction(F, [&](CallInst *CI) -> Error { in lowerToCreateHandle() argument
237 IRB.SetInsertPoint(CI); in lowerToCreateHandle()
239 auto *It = DRM.find(CI); in lowerToCreateHandle()
246 Value *IndexOp = CI->getArgOperand(3); in lowerToCreateHandle()
254 CI->getArgOperand(4)}; in lowerToCreateHandle()
256 OpBuilder.tryCreateOp(OpCode::CreateHandle, Args, CI->getName()); in lowerToCreateHandle()
260 Value *Cast = createTmpHandleCast(*OpCall, CI->getType()); in lowerToCreateHandle()
261 replaceHandleFromBindingCall(CI, Cast); in lowerToCreateHandle()
270 return replaceFunction(F, [&](CallInst *CI) -> Error { in lowerToBindAndAnnotateHandle() argument
271 IRB.SetInsertPoint(CI); in lowerToBindAndAnnotateHandle()
273 auto *It = DRM.find(CI); in lowerToBindAndAnnotateHandle()
281 Value *IndexOp = CI->getArgOperand(3); in lowerToBindAndAnnotateHandle()
297 std::array<Value *, 3> BindArgs{ResBind, IndexOp, CI->getArgOperand(4)}; in lowerToBindAndAnnotateHandle()
299 OpCode::CreateHandleFromBinding, BindArgs, CI->getName()); in lowerToBindAndAnnotateHandle()
307 CI->hasName() ? CI->getName() + "_annot" : Twine()); in lowerToBindAndAnnotateHandle()
311 Value *Cast = createTmpHandleCast(*OpAnnotate, CI->getType()); in lowerToBindAndAnnotateHandle()
312 replaceHandleFromBindingCall(CI, Cast); in lowerToBindAndAnnotateHandle()
464 return replaceFunction(F, [&](CallInst *CI) -> Error { in lowerTypedBufferLoad() argument
465 IRB.SetInsertPoint(CI); in lowerTypedBufferLoad()
468 createTmpHandleCast(CI->getArgOperand(0), OpBuilder.getHandleType()); in lowerTypedBufferLoad()
469 Value *Index0 = CI->getArgOperand(1); in lowerTypedBufferLoad()
472 Type *OldTy = CI->getType(); in lowerTypedBufferLoad()
479 OpCode::BufferLoad, Args, CI->getName(), NewRetTy); in lowerTypedBufferLoad()
482 if (Error E = replaceResRetUses(CI, *OpCall, HasCheckBit)) in lowerTypedBufferLoad()
495 return replaceFunction(F, [&](CallInst *CI) -> Error { in lowerRawBufferLoad() argument
496 IRB.SetInsertPoint(CI); in lowerRawBufferLoad()
498 Type *OldTy = cast<StructType>(CI->getType())->getElementType(0); in lowerRawBufferLoad()
503 createTmpHandleCast(CI->getArgOperand(0), OpBuilder.getHandleType()); in lowerRawBufferLoad()
504 Value *Index0 = CI->getArgOperand(1); in lowerRawBufferLoad()
505 Value *Index1 = CI->getArgOperand(2); in lowerRawBufferLoad()
516 CI->getName(), NewRetTy) in lowerRawBufferLoad()
518 {Handle, Index0, Index1}, CI->getName(), in lowerRawBufferLoad()
522 if (Error E = replaceResRetUses(CI, *OpCall, /*HasCheckBit=*/true)) in lowerRawBufferLoad()
532 return replaceFunction(F, [&](CallInst *CI) -> Error { in lowerCBufferLoad() argument
533 IRB.SetInsertPoint(CI); in lowerCBufferLoad()
535 Type *OldTy = cast<StructType>(CI->getType())->getElementType(0); in lowerCBufferLoad()
540 createTmpHandleCast(CI->getArgOperand(0), OpBuilder.getHandleType()); in lowerCBufferLoad()
541 Value *Index = CI->getArgOperand(1); in lowerCBufferLoad()
544 OpCode::CBufferLoadLegacy, {Handle, Index}, CI->getName(), NewRetTy); in lowerCBufferLoad()
547 if (Error E = replaceNamedStructUses(CI, *OpCall)) in lowerCBufferLoad()
550 CI->eraseFromParent(); in lowerCBufferLoad()
559 return replaceFunction(F, [&](CallInst *CI) -> Error { in lowerUpdateCounter() argument
560 IRB.SetInsertPoint(CI); in lowerUpdateCounter()
562 createTmpHandleCast(CI->getArgOperand(0), OpBuilder.getHandleType()); in lowerUpdateCounter()
563 Value *Op1 = CI->getArgOperand(1); in lowerUpdateCounter()
568 OpCode::UpdateCounter, Args, CI->getName(), Int32Ty); in lowerUpdateCounter()
573 CI->replaceAllUsesWith(*OpCall); in lowerUpdateCounter()
574 CI->eraseFromParent(); in lowerUpdateCounter()
593 return replaceFunction(F, [&](CallInst *CI) -> Error { in lowerBufferStore() argument
594 IRB.SetInsertPoint(CI); in lowerBufferStore()
597 createTmpHandleCast(CI->getArgOperand(0), OpBuilder.getHandleType()); in lowerBufferStore()
598 Value *Index0 = CI->getArgOperand(1); in lowerBufferStore()
599 Value *Index1 = IsRaw ? CI->getArgOperand(2) : UndefValue::get(Int32Ty); in lowerBufferStore()
601 Value *Data = CI->getArgOperand(IsRaw ? 3 : 2); in lowerBufferStore()
661 OpBuilder.tryCreateOp(Op, Args, CI->getName()); in lowerBufferStore()
665 CI->eraseFromParent(); in lowerBufferStore()
682 return replaceFunction(F, [&](CallInst *CI) -> Error { in lowerCtpopToCountBits() argument
683 IRB.SetInsertPoint(CI); in lowerCtpopToCountBits()
685 Args.append(CI->arg_begin(), CI->arg_end()); in lowerCtpopToCountBits()
693 dxil::OpCode::CountBits, Args, CI->getName(), RetTy); in lowerCtpopToCountBits()
699 CI->replaceAllUsesWith(*OpCall); in lowerCtpopToCountBits()
700 CI->eraseFromParent(); in lowerCtpopToCountBits()
720 for (User *User : make_early_inc_range(CI->users())) { in lowerCtpopToCountBits()
737 CI->replaceAllUsesWith(Cast); in lowerCtpopToCountBits()
740 CI->eraseFromParent(); in lowerCtpopToCountBits()
747 return replaceFunction(F, [&](CallInst *CI) -> Error { in lowerLifetimeIntrinsic() argument
748 IRB.SetInsertPoint(CI); in lowerLifetimeIntrinsic()
749 Value *Ptr = CI->getArgOperand(1); in lowerLifetimeIntrinsic()
771 CI->eraseFromParent(); in lowerLifetimeIntrinsic()
780 return replaceFunction(F, [&](CallInst *CI) -> Error { in lowerIsFPClass() argument
781 IRB.SetInsertPoint(CI); in lowerIsFPClass()
783 Value *Fl = CI->getArgOperand(0); in lowerIsFPClass()
787 Value *T = CI->getArgOperand(1); in lowerIsFPClass()
810 OpBuilder.tryCreateOp(OpCode, Args, CI->getName(), RetTy); in lowerIsFPClass()
814 CI->replaceAllUsesWith(*OpCall); in lowerIsFPClass()
815 CI->eraseFromParent(); in lowerIsFPClass()