Lines Matching defs:CI

85   bool expandBFI(CallInst *CI);
88 bool expandBFM(CallInst *CI);
92 bool isSigned24BitOps(CallInst *CI);
93 void expandSigned24BitOps(CallInst *CI);
97 bool isRWGLocalOpt(CallInst *CI);
101 bool convertAccurateDivide(CallInst *CI);
102 void expandAccurateDivide(CallInst *CI);
111 bool propagateSamplerInst(CallInst *CI);
242 CallInst *CI = isConstVec[x];
243 Constant *CV = dyn_cast<Constant>(CI->getOperand(0));
247 CI->replaceAllUsesWith(Val);
248 CI->eraseFromParent();
301 CallInst *CI = dyn_cast<CallInst>(inst);
302 if (!CI) {
305 if (isSigned24BitOps(CI)) {
306 expandSigned24BitOps(CI);
308 CI->eraseFromParent();
311 if (propagateSamplerInst(CI)) {
314 if (expandBFI(CI) || expandBFM(CI)) {
316 CI->eraseFromParent();
319 if (convertAccurateDivide(CI)) {
320 expandAccurateDivide(CI);
322 CI->eraseFromParent();
326 StringRef calleeName = CI->getOperand(CI->getNumOperands()-1)->getName();
334 isConstVec.push_back(CI);
337 Constant *CV = dyn_cast<Constant>(CI->getOperand(0));
341 CI->replaceAllUsesWith(Val);
343 CI->eraseFromParent();
349 ConstantInt *CV = dyn_cast<ConstantInt>(CI->getOperand(0));
358 CI->replaceAllUsesWith(Val);
360 CI->eraseFromParent();
363 Function *F = dyn_cast<Function>(CI->getOperand(CI->getNumOperands()-1));
367 if (F->getName().startswith("__atom") && !CI->getNumUses()
372 atomicFuncs.push_back(std::make_pair <CallInst*, Function*>(CI, F));
669 CallInst *CI = CallInst::Create(Func, Operands, "BitInsertOpt");
674 CI->dump();
677 CI->insertBefore(inst);
678 inst->replaceAllUsesWith(CI);
834 CallInst *CI = CallInst::Create(Func, Operands, "ByteExtractOpt");
835 CI->setDoesNotAccessMemory();
836 CI->insertBefore(inst);
837 inst->replaceAllUsesWith(CI);
842 AMDGPUPeepholeOpt::expandBFI(CallInst *CI)
844 if (!CI) {
847 Value *LHS = CI->getOperand(CI->getNumOperands() - 1);
851 Type* type = CI->getOperand(0)->getType();
855 negOneConst = ConstantInt::get(CI->getContext(),
863 negOneConst = ConstantInt::get(CI->getContext(),
868 BinaryOperator::Create(Instruction::And, CI->getOperand(0),
869 CI->getOperand(1), "bfi_and", CI);
871 BinaryOperator::Create(Instruction::Xor, CI->getOperand(0), negOneConst,
872 "bfi_not", CI);
873 rhs = BinaryOperator::Create(Instruction::And, rhs, CI->getOperand(2),
874 "bfi_and", CI);
875 lhs = BinaryOperator::Create(Instruction::Or, lhs, rhs, "bfi_or", CI);
876 CI->replaceAllUsesWith(lhs);
881 AMDGPUPeepholeOpt::expandBFM(CallInst *CI)
883 if (!CI) {
886 Value *LHS = CI->getOperand(CI->getNumOperands() - 1);
893 Type* type = CI->getOperand(0)->getType();
910 BinaryOperator::Create(Instruction::And, CI->getOperand(0),
911 newMaskConst, "bfm_mask", CI);
913 lhs, "bfm_shl", CI);
915 newShiftConst, "bfm_sub", CI);
917 BinaryOperator::Create(Instruction::And, CI->getOperand(1),
918 newMaskConst, "bfm_mask", CI);
919 lhs = BinaryOperator::Create(Instruction::Shl, lhs, rhs, "bfm_shl", CI);
920 CI->replaceAllUsesWith(lhs);
977 AMDGPUPeepholeOpt::isSigned24BitOps(CallInst *CI)
979 if (!CI) {
982 Value *LHS = CI->getOperand(CI->getNumOperands() - 1);
995 AMDGPUPeepholeOpt::expandSigned24BitOps(CallInst *CI)
997 assert(isSigned24BitOps(CI) && "Must be a "
999 Value *LHS = CI->getOperand(CI->getNumOperands()-1);
1006 Type *aType = CI->getOperand(0)->getType();
1010 callTypes.push_back(CI->getOperand(0)->getType());
1011 callTypes.push_back(CI->getOperand(1)->getType());
1012 callTypes.push_back(CI->getOperand(2)->getType());
1014 FunctionType::get(CI->getOperand(0)->getType(), callTypes, false);
1022 CI->getParent()->getParent()->getParent()->
1025 CI->getOperand(0),
1026 CI->getOperand(1),
1027 CI->getOperand(2)
1030 nCI->insertBefore(CI);
1031 CI->replaceAllUsesWith(nCI);
1034 BinaryOperator::Create(Instruction::Mul, CI->getOperand(0),
1035 CI->getOperand(1), "imul24", CI);
1036 CI->replaceAllUsesWith(mulOp);
1038 Type *aType = CI->getOperand(0)->getType();
1043 callTypes.push_back(CI->getOperand(0)->getType());
1044 callTypes.push_back(CI->getOperand(1)->getType());
1046 FunctionType::get(CI->getOperand(0)->getType(), callTypes, false);
1054 CI->getParent()->getParent()->getParent()->
1057 CI->getOperand(0),
1058 CI->getOperand(1)
1061 nCI->insertBefore(CI);
1062 CI->replaceAllUsesWith(nCI);
1067 AMDGPUPeepholeOpt::isRWGLocalOpt(CallInst *CI)
1069 return (CI != NULL
1070 && CI->getOperand(CI->getNumOperands() - 1)->getName()
1075 AMDGPUPeepholeOpt::convertAccurateDivide(CallInst *CI)
1077 if (!CI) {
1084 return CI->getOperand(CI->getNumOperands() - 1)->getName().substr(0, 20)
1089 AMDGPUPeepholeOpt::expandAccurateDivide(CallInst *CI)
1091 assert(convertAccurateDivide(CI)
1094 BinaryOperator::Create(Instruction::FDiv, CI->getOperand(0),
1095 CI->getOperand(1), "fdiv32", CI);
1096 CI->replaceAllUsesWith(divOp);
1100 AMDGPUPeepholeOpt::propagateSamplerInst(CallInst *CI)
1106 if (!CI) {
1111 funcNameIdx = CI->getNumOperands() - 1;
1112 StringRef calleeName = CI->getOperand(funcNameIdx)->getName();
1122 Value *sampler = CI->getOperand(samplerIdx);