Lines Matching full:instruction
40 if (const Instruction *User = dyn_cast<Instruction>(U)) {
110 Instruction *Inst) {
125 case Instruction::GetElementPtr:
132 case Instruction::Store:
142 case Instruction::ICmp:
152 case Instruction::Add:
153 case Instruction::Sub:
163 case Instruction::Mul:
170 case Instruction::Or:
171 case Instruction::Xor:
181 case Instruction::And:
199 case Instruction::Shl:
200 case Instruction::LShr:
201 case Instruction::AShr:
202 // Always return TCC_Free for the shift value of a shift instruction.
206 case Instruction::UDiv:
207 case Instruction::SDiv:
208 case Instruction::URem:
209 case Instruction::SRem:
210 case Instruction::Trunc:
211 case Instruction::ZExt:
212 case Instruction::SExt:
213 case Instruction::IntToPtr:
214 case Instruction::PtrToInt:
215 case Instruction::BitCast:
216 case Instruction::PHI:
217 case Instruction::Call:
218 case Instruction::Select:
219 case Instruction::Ret:
220 case Instruction::Load:
289 // Find out if L contains a call, what the machine instruction count
308 NumStores += getMemoryOpCost(Instruction::Store, MemAccessTy,
349 // SystemZ specific: check instruction count (first), and don't care about
429 const Instruction *CxtI) {
445 // needs a divide instruction. A divisor which is a power of two constant
453 Opcode == Instruction::SDiv || Opcode == Instruction::SRem;
455 Opcode == Instruction::UDiv || Opcode == Instruction::URem;
475 // These FP operations are supported with a dedicated instruction for
478 if (Opcode == Instruction::FAdd || Opcode == Instruction::FSub ||
479 Opcode == Instruction::FMul || Opcode == Instruction::FDiv)
483 if (Opcode == Instruction::FRem)
488 if (Opcode == Instruction::Xor) {
490 if (const Instruction *I = dyn_cast<Instruction>(A))
492 (I->getOpcode() == Instruction::Or ||
493 I->getOpcode() == Instruction::And ||
494 I->getOpcode() == Instruction::Xor))
497 (I->getOpcode() == Instruction::Or || ST->hasVectorEnhancements1())))
501 else if (Opcode == Instruction::And || Opcode == Instruction::Or) {
503 if (const Instruction *I = dyn_cast<Instruction>(A))
504 if ((I->hasOneUse() && I->getOpcode() == Instruction::Xor) &&
507 (Opcode == Instruction::And || ST->hasVectorEnhancements1()))))
513 // Or requires one instruction, although it has custom handling for i64.
514 if (Opcode == Instruction::Or)
517 if (Opcode == Instruction::Xor && ScalarBits == 1) {
536 // with one instruction per vector, regardless of element size.
537 if (Opcode == Instruction::Shl || Opcode == Instruction::LShr ||
538 Opcode == Instruction::AShr) {
556 // These FP operations are supported with a single vector instruction for
560 if (Opcode == Instruction::FAdd || Opcode == Instruction::FSub ||
561 Opcode == Instruction::FMul || Opcode == Instruction::FDiv) {
590 if (Opcode == Instruction::FRem) {
609 ArrayRef<const Value *> Args, const Instruction *CxtI) {
618 // moves are done with a single instruction per element.
632 // loads and replicates with a single instruction, adjust the returned
638 // SystemZ supports single instruction permutation / replication.
690 // is one instruction less:
699 // (SrcTy), to the type of the select or extend instruction (DstTy).
724 // cost for a Select / ZExt or SExt instruction.
725 static Type *getCmpOpsType(const Instruction *I, unsigned VF = 1) {
729 else if (Instruction *LogicI = dyn_cast<Instruction>(I->getOperand(0)))
753 const Instruction *I) {
762 if (Opcode == Instruction::ZExt || Opcode == Instruction::UIToFP)
772 const Instruction *I) {
785 if (Opcode == Instruction::SIToFP || Opcode == Instruction::UIToFP) {
794 if ((Opcode == Instruction::FPToSI || Opcode == Instruction::FPToUI) &&
798 if ((Opcode == Instruction::ZExt || Opcode == Instruction::SExt)) {
809 if (Opcode == Instruction::SExt)
811 if (Opcode == Instruction::ZExt)
821 // but a zero-extending load would be just one extra instruction.
822 if (Opcode == Instruction::ZExt && I != nullptr)
830 if (Opcode == Instruction::Trunc && isInt128InVR(Src) && I != nullptr) {
857 if (Opcode == Instruction::Trunc) {
863 if (Opcode == Instruction::ZExt || Opcode == Instruction::SExt) {
866 if (Opcode == Instruction::ZExt)
884 if (Opcode == Instruction::SIToFP || Opcode == Instruction::UIToFP ||
885 Opcode == Instruction::FPToSI || Opcode == Instruction::FPToUI) {
907 (Opcode == Instruction::SIToFP || Opcode == Instruction::UIToFP))
910 (Opcode == Instruction::FPToSI || Opcode == Instruction::FPToUI))
925 if (Opcode == Instruction::FPTrunc) {
934 if (Opcode == Instruction::FPExt) {
952 static unsigned getOperandsExtensionCost(const Instruction *I) {
966 const Instruction *I) {
972 case Instruction::ICmp: {
988 case Instruction::Select:
997 // Called with a compare instruction.
998 if (Opcode == Instruction::ICmp || Opcode == Instruction::FCmp) {
1029 else { // Called with a select instruction.
1030 assert (Opcode == Instruction::Select);
1033 // instruction was passed and the compare instruction is found.
1053 if (Opcode == Instruction::InsertElement && Val->isIntOrIntVectorTy(64))
1056 if (Opcode == Instruction::ExtractElement) {
1071 isFoldableLoad(const LoadInst *Ld, const Instruction *&FoldedValue) {
1075 const Instruction *UserI = cast<Instruction>(*Ld->user_begin());
1091 UserI = cast<Instruction>(*UserI->user_begin());
1094 if ((UserI->getOpcode() == Instruction::Sub ||
1095 UserI->getOpcode() == Instruction::SDiv ||
1096 UserI->getOpcode() == Instruction::UDiv) &&
1104 case Instruction::Add: // SE: 16->32, 16/32->64, z14:16->64. ZE: 32->64
1105 case Instruction::Sub:
1106 case Instruction::ICmp:
1110 case Instruction::Mul: // SE: 16->32, 32->64, z14:16->64
1111 if (UserI->getOpcode() != Instruction::ICmp) {
1120 case Instruction::SDiv:// SE: 32->64
1124 case Instruction::UDiv:
1125 case Instruction::And:
1126 case Instruction::Or:
1127 case Instruction::Xor:
1130 // case Instruction::FCmp:
1131 // case Instruction::FAdd:
1132 // case Instruction::FSub:
1133 // case Instruction::FMul:
1134 // case Instruction::FDiv:
1139 if (UserI->getOpcode() == Instruction::ICmp)
1150 if (const Instruction *I = dyn_cast<Instruction>(V))
1163 const Instruction *I) {
1170 if (!Src->isVectorTy() && Opcode == Instruction::Load && I != nullptr) {
1172 const Instruction *FoldedValue = nullptr;
1174 const Instruction *UserI = cast<Instruction>(*FoldedValue->user_begin());
1183 if (Instruction *OtherOp = dyn_cast<Instruction>(UserI->getOperand(i))){
1210 // Store/Load reversed saves one instruction.
1213 if (Opcode == Instruction::Load && I->hasOneUse()) {
1214 const Instruction *LdUser = cast<Instruction>(*I->user_begin());
1253 if (Opcode == Instruction::Load) {