• Home
  • Raw
  • Download

Lines Matching refs:Instr

206   Ice::Operand *convertOperand(const Instruction *Instr, unsigned OpNum) {  in convertOperand()  argument
207 if (OpNum >= Instr->getNumOperands()) { in convertOperand()
210 const Value *Op = Instr->getOperand(OpNum); in convertOperand()
224 Ice::Inst *convertInstruction(const Instruction *Instr) { in convertInstruction() argument
225 switch (Instr->getOpcode()) { in convertInstruction()
227 return convertPHINodeInstruction(cast<PHINode>(Instr)); in convertInstruction()
229 return convertBrInstruction(cast<BranchInst>(Instr)); in convertInstruction()
231 return convertRetInstruction(cast<ReturnInst>(Instr)); in convertInstruction()
233 return convertIntToPtrInstruction(cast<IntToPtrInst>(Instr)); in convertInstruction()
235 return convertPtrToIntInstruction(cast<PtrToIntInst>(Instr)); in convertInstruction()
237 return convertICmpInstruction(cast<ICmpInst>(Instr)); in convertInstruction()
239 return convertFCmpInstruction(cast<FCmpInst>(Instr)); in convertInstruction()
241 return convertSelectInstruction(cast<SelectInst>(Instr)); in convertInstruction()
243 return convertSwitchInstruction(cast<SwitchInst>(Instr)); in convertInstruction()
245 return convertLoadInstruction(cast<LoadInst>(Instr)); in convertInstruction()
247 return convertStoreInstruction(cast<StoreInst>(Instr)); in convertInstruction()
249 return convertCastInstruction(cast<ZExtInst>(Instr), Ice::InstCast::Zext); in convertInstruction()
251 return convertCastInstruction(cast<SExtInst>(Instr), Ice::InstCast::Sext); in convertInstruction()
253 return convertCastInstruction(cast<TruncInst>(Instr), in convertInstruction()
256 return convertCastInstruction(cast<FPTruncInst>(Instr), in convertInstruction()
259 return convertCastInstruction(cast<FPExtInst>(Instr), in convertInstruction()
262 return convertCastInstruction(cast<FPToSIInst>(Instr), in convertInstruction()
265 return convertCastInstruction(cast<FPToUIInst>(Instr), in convertInstruction()
268 return convertCastInstruction(cast<SIToFPInst>(Instr), in convertInstruction()
271 return convertCastInstruction(cast<UIToFPInst>(Instr), in convertInstruction()
274 return convertCastInstruction(cast<BitCastInst>(Instr), in convertInstruction()
277 return convertArithInstruction(Instr, Ice::InstArithmetic::Add); in convertInstruction()
279 return convertArithInstruction(Instr, Ice::InstArithmetic::Sub); in convertInstruction()
281 return convertArithInstruction(Instr, Ice::InstArithmetic::Mul); in convertInstruction()
283 return convertArithInstruction(Instr, Ice::InstArithmetic::Udiv); in convertInstruction()
285 return convertArithInstruction(Instr, Ice::InstArithmetic::Sdiv); in convertInstruction()
287 return convertArithInstruction(Instr, Ice::InstArithmetic::Urem); in convertInstruction()
289 return convertArithInstruction(Instr, Ice::InstArithmetic::Srem); in convertInstruction()
291 return convertArithInstruction(Instr, Ice::InstArithmetic::Shl); in convertInstruction()
293 return convertArithInstruction(Instr, Ice::InstArithmetic::Lshr); in convertInstruction()
295 return convertArithInstruction(Instr, Ice::InstArithmetic::Ashr); in convertInstruction()
297 return convertArithInstruction(Instr, Ice::InstArithmetic::Fadd); in convertInstruction()
299 return convertArithInstruction(Instr, Ice::InstArithmetic::Fsub); in convertInstruction()
301 return convertArithInstruction(Instr, Ice::InstArithmetic::Fmul); in convertInstruction()
303 return convertArithInstruction(Instr, Ice::InstArithmetic::Fdiv); in convertInstruction()
305 return convertArithInstruction(Instr, Ice::InstArithmetic::Frem); in convertInstruction()
307 return convertArithInstruction(Instr, Ice::InstArithmetic::And); in convertInstruction()
309 return convertArithInstruction(Instr, Ice::InstArithmetic::Or); in convertInstruction()
311 return convertArithInstruction(Instr, Ice::InstArithmetic::Xor); in convertInstruction()
313 return convertExtractElementInstruction(cast<ExtractElementInst>(Instr)); in convertInstruction()
315 return convertInsertElementInstruction(cast<InsertElementInst>(Instr)); in convertInstruction()
317 return convertCallInstruction(cast<CallInst>(Instr)); in convertInstruction()
319 return convertAllocaInstruction(cast<AllocaInst>(Instr)); in convertInstruction()
321 return convertUnreachableInstruction(cast<UnreachableInst>(Instr)); in convertInstruction()
324 LLVMObjectAsString(Instr)); in convertInstruction()
331 Ice::Inst *convertLoadInstruction(const LoadInst *Instr) { in convertLoadInstruction() argument
332 Ice::Operand *Src = convertOperand(Instr, 0); in convertLoadInstruction()
333 Ice::Variable *Dest = mapValueToIceVar(Instr); in convertLoadInstruction()
337 Ice::Inst *convertStoreInstruction(const StoreInst *Instr) { in convertStoreInstruction() argument
338 Ice::Operand *Addr = convertOperand(Instr, 1); in convertStoreInstruction()
339 Ice::Operand *Val = convertOperand(Instr, 0); in convertStoreInstruction()
343 Ice::Inst *convertArithInstruction(const Instruction *Instr, in convertArithInstruction() argument
345 const auto BinOp = cast<BinaryOperator>(Instr); in convertArithInstruction()
346 Ice::Operand *Src0 = convertOperand(Instr, 0); in convertArithInstruction()
347 Ice::Operand *Src1 = convertOperand(Instr, 1); in convertArithInstruction()
352 Ice::Inst *convertPHINodeInstruction(const PHINode *Instr) { in convertPHINodeInstruction() argument
353 unsigned NumValues = Instr->getNumIncomingValues(); in convertPHINodeInstruction()
355 Ice::InstPhi::create(Func.get(), NumValues, mapValueToIceVar(Instr)); in convertPHINodeInstruction()
357 IcePhi->addArgument(convertOperand(Instr, N), in convertPHINodeInstruction()
358 mapBasicBlockToNode(Instr->getIncomingBlock(N))); in convertPHINodeInstruction()
363 Ice::Inst *convertBrInstruction(const BranchInst *Instr) { in convertBrInstruction() argument
364 if (Instr->isConditional()) { in convertBrInstruction()
365 Ice::Operand *Src = convertOperand(Instr, 0); in convertBrInstruction()
366 BasicBlock *BBThen = Instr->getSuccessor(0); in convertBrInstruction()
367 BasicBlock *BBElse = Instr->getSuccessor(1); in convertBrInstruction()
372 BasicBlock *BBSucc = Instr->getSuccessor(0); in convertBrInstruction()
377 Ice::Inst *convertIntToPtrInstruction(const IntToPtrInst *Instr) { in convertIntToPtrInstruction() argument
378 Ice::Operand *Src = convertOperand(Instr, 0); in convertIntToPtrInstruction()
379 Ice::Variable *Dest = mapValueToIceVar(Instr, Ice::getPointerType()); in convertIntToPtrInstruction()
383 Ice::Inst *convertPtrToIntInstruction(const PtrToIntInst *Instr) { in convertPtrToIntInstruction() argument
384 Ice::Operand *Src = convertOperand(Instr, 0); in convertPtrToIntInstruction()
385 Ice::Variable *Dest = mapValueToIceVar(Instr); in convertPtrToIntInstruction()
389 Ice::Inst *convertRetInstruction(const ReturnInst *Instr) { in convertRetInstruction() argument
390 Ice::Operand *RetOperand = convertOperand(Instr, 0); in convertRetInstruction()
398 Ice::Inst *convertCastInstruction(const Instruction *Instr, in convertCastInstruction() argument
400 Ice::Operand *Src = convertOperand(Instr, 0); in convertCastInstruction()
401 Ice::Variable *Dest = mapValueToIceVar(Instr); in convertCastInstruction()
405 Ice::Inst *convertICmpInstruction(const ICmpInst *Instr) { in convertICmpInstruction() argument
406 Ice::Operand *Src0 = convertOperand(Instr, 0); in convertICmpInstruction()
407 Ice::Operand *Src1 = convertOperand(Instr, 1); in convertICmpInstruction()
408 Ice::Variable *Dest = mapValueToIceVar(Instr); in convertICmpInstruction()
411 switch (Instr->getPredicate()) { in convertICmpInstruction()
449 Ice::Inst *convertFCmpInstruction(const FCmpInst *Instr) { in convertFCmpInstruction() argument
450 Ice::Operand *Src0 = convertOperand(Instr, 0); in convertFCmpInstruction()
451 Ice::Operand *Src1 = convertOperand(Instr, 1); in convertFCmpInstruction()
452 Ice::Variable *Dest = mapValueToIceVar(Instr); in convertFCmpInstruction()
455 switch (Instr->getPredicate()) { in convertFCmpInstruction()
513 Ice::Inst *convertExtractElementInstruction(const ExtractElementInst *Instr) { in convertExtractElementInstruction() argument
514 Ice::Variable *Dest = mapValueToIceVar(Instr); in convertExtractElementInstruction()
515 Ice::Operand *Source1 = convertValue(Instr->getOperand(0)); in convertExtractElementInstruction()
516 Ice::Operand *Source2 = convertValue(Instr->getOperand(1)); in convertExtractElementInstruction()
520 Ice::Inst *convertInsertElementInstruction(const InsertElementInst *Instr) { in convertInsertElementInstruction() argument
521 Ice::Variable *Dest = mapValueToIceVar(Instr); in convertInsertElementInstruction()
522 Ice::Operand *Source1 = convertValue(Instr->getOperand(0)); in convertInsertElementInstruction()
523 Ice::Operand *Source2 = convertValue(Instr->getOperand(1)); in convertInsertElementInstruction()
524 Ice::Operand *Source3 = convertValue(Instr->getOperand(2)); in convertInsertElementInstruction()
529 Ice::Inst *convertSelectInstruction(const SelectInst *Instr) { in convertSelectInstruction() argument
530 Ice::Variable *Dest = mapValueToIceVar(Instr); in convertSelectInstruction()
531 Ice::Operand *Cond = convertValue(Instr->getCondition()); in convertSelectInstruction()
532 Ice::Operand *Source1 = convertValue(Instr->getTrueValue()); in convertSelectInstruction()
533 Ice::Operand *Source2 = convertValue(Instr->getFalseValue()); in convertSelectInstruction()
537 Ice::Inst *convertSwitchInstruction(const SwitchInst *Instr) { in convertSwitchInstruction() argument
538 Ice::Operand *Source = convertValue(Instr->getCondition()); in convertSwitchInstruction()
539 Ice::CfgNode *LabelDefault = mapBasicBlockToNode(Instr->getDefaultDest()); in convertSwitchInstruction()
540 unsigned NumCases = Instr->getNumCases(); in convertSwitchInstruction()
544 for (SwitchInst::ConstCaseIt I = Instr->case_begin(), E = Instr->case_end(); in convertSwitchInstruction()
553 Ice::Inst *convertCallInstruction(const CallInst *Instr) { in convertCallInstruction() argument
554 Ice::Variable *Dest = mapValueToIceVar(Instr); in convertCallInstruction()
555 Ice::Operand *CallTarget = convertValue(Instr->getCalledValue()); in convertCallInstruction()
556 unsigned NumArgs = Instr->getNumArgOperands(); in convertCallInstruction()
568 LLVMObjectAsString(Instr)); in convertCallInstruction()
578 Instr->isTailCall()); in convertCallInstruction()
581 NewInst->addArg(convertOperand(Instr, i)); in convertCallInstruction()
589 Ice::Inst *convertAllocaInstruction(const AllocaInst *Instr) { in convertAllocaInstruction() argument
591 Ice::Operand *ByteCount = convertValue(Instr->getArraySize()); in convertAllocaInstruction()
592 uint32_t Align = Instr->getAlignment(); in convertAllocaInstruction()
593 Ice::Variable *Dest = mapValueToIceVar(Instr, Ice::getPointerType()); in convertAllocaInstruction()
605 Ice::Inst *Instr = convertInstruction(&II); in convertBasicBlock() local
606 Node->appendInst(Instr); in convertBasicBlock()