reference, declaration → definition definition → references, declarations, derived classes, virtual overrides reference to multiple definitions → definitions unreferenced |
919 report("Unexpected generic instruction in a Selected function", MI); 921 const MCInstrDesc &MCID = MI->getDesc(); 922 unsigned NumOps = MI->getNumOperands(); 935 const MachineOperand *MO = &MI->getOperand(I); 937 report("generic instruction must use register operands", MI); 958 for (unsigned I = 0; I < MI->getNumOperands(); ++I) { 959 const MachineOperand *MO = &MI->getOperand(I); 965 if (MI->getNumOperands() < MCID.getNumOperands()) 969 if (!TII->verifyInstruction(*MI, ErrorInfo)) 970 report(ErrorInfo.data(), MI); 973 switch (MI->getOpcode()) { 976 if (MI->getNumOperands() < MCID.getNumOperands()) 979 LLT DstTy = MRI->getType(MI->getOperand(0).getReg()); 981 report("Instruction cannot use a vector result type", MI); 983 if (MI->getOpcode() == TargetOpcode::G_CONSTANT) { 984 if (!MI->getOperand(1).isCImm()) { 985 report("G_CONSTANT operand must be cimm", MI); 989 const ConstantInt *CI = MI->getOperand(1).getCImm(); 991 report("inconsistent constant size", MI); 993 if (!MI->getOperand(1).isFPImm()) { 994 report("G_FCONSTANT operand must be fpimm", MI); 997 const ConstantFP *CF = MI->getOperand(1).getFPImm(); 1001 report("inconsistent constant size", MI); 1011 LLT ValTy = MRI->getType(MI->getOperand(0).getReg()); 1012 LLT PtrTy = MRI->getType(MI->getOperand(1).getReg()); 1014 report("Generic memory instruction must access a pointer", MI); 1018 if (!MI->hasOneMemOperand()) { 1020 MI); 1022 const MachineMemOperand &MMO = **MI->memoperands_begin(); 1023 if (MI->getOpcode() == TargetOpcode::G_ZEXTLOAD || 1024 MI->getOpcode() == TargetOpcode::G_SEXTLOAD) { 1026 report("Generic extload must have a narrower memory type", MI); 1027 } else if (MI->getOpcode() == TargetOpcode::G_LOAD) { 1029 report("load memory size cannot exceed result size", MI); 1030 } else if (MI->getOpcode() == TargetOpcode::G_STORE) { 1032 report("store memory size cannot exceed value size", MI); 1039 LLT DstTy = MRI->getType(MI->getOperand(0).getReg()); 1041 !std::all_of(MI->operands_begin() + 1, MI->operands_end(), 1041 !std::all_of(MI->operands_begin() + 1, MI->operands_end(), 1052 MI); 1056 LLT DstTy = MRI->getType(MI->getOperand(0).getReg()); 1057 LLT SrcTy = MRI->getType(MI->getOperand(1).getReg()); 1062 report("bitcast cannot convert between pointers and other types", MI); 1065 report("bitcast sizes must match", MI); 1071 LLT DstTy = MRI->getType(MI->getOperand(0).getReg()); 1072 LLT SrcTy = MRI->getType(MI->getOperand(1).getReg()); 1076 verifyVectorElementMatch(DstTy, SrcTy, MI); 1081 if (MI->getOpcode() == TargetOpcode::G_INTTOPTR) { 1083 report("inttoptr result type must be a pointer", MI); 1085 report("inttoptr source type must not be a pointer", MI); 1086 } else if (MI->getOpcode() == TargetOpcode::G_PTRTOINT) { 1088 report("ptrtoint source type must be a pointer", MI); 1090 report("ptrtoint result type must not be a pointer", MI); 1092 assert(MI->getOpcode() == TargetOpcode::G_ADDRSPACE_CAST); 1094 report("addrspacecast types must be pointers", MI); 1097 report("addrspacecast must convert different address spaces", MI); 1104 LLT DstTy = MRI->getType(MI->getOperand(0).getReg()); 1105 LLT PtrTy = MRI->getType(MI->getOperand(1).getReg()); 1106 LLT OffsetTy = MRI->getType(MI->getOperand(2).getReg()); 1111 report("gep first operand must be a pointer", MI); 1114 report("gep offset operand must not be a pointer", MI); 1131 LLT DstTy = MRI->getType(MI->getOperand(0).getReg()); 1132 LLT SrcTy = MRI->getType(MI->getOperand(1).getReg()); 1139 report("Generic extend/truncate can not operate on pointers", MI); 1141 verifyVectorElementMatch(DstTy, SrcTy, MI); 1145 switch (MI->getOpcode()) { 1148 report("Generic extend has destination type no larger than source", MI); 1154 MI); 1160 LLT SelTy = MRI->getType(MI->getOperand(0).getReg()); 1161 LLT CondTy = MRI->getType(MI->getOperand(1).getReg()); 1167 verifyVectorElementMatch(SelTy, CondTy, MI); 1175 LLT DstTy = MRI->getType(MI->getOperand(0).getReg()); 1176 LLT SrcTy = MRI->getType(MI->getOperand(1).getReg()); 1178 report("G_MERGE_VALUES cannot operate on vectors", MI); 1180 const unsigned NumOps = MI->getNumOperands(); 1182 report("G_MERGE_VALUES result size is inconsistent", MI); 1185 if (MRI->getType(MI->getOperand(I).getReg()) != SrcTy) 1186 report("G_MERGE_VALUES source types do not match", MI); 1192 LLT DstTy = MRI->getType(MI->getOperand(0).getReg()); 1193 LLT SrcTy = MRI->getType(MI->getOperand(MI->getNumOperands()-1).getReg()); 1193 LLT SrcTy = MRI->getType(MI->getOperand(MI->getNumOperands()-1).getReg()); 1195 for (unsigned i = 0; i < MI->getNumOperands()-1; ++i) { 1196 if (MRI->getType(MI->getOperand(i).getReg()) != DstTy) 1197 report("G_UNMERGE_VALUES destination types do not match", MI); 1200 (DstTy.getSizeInBits() * (MI->getNumOperands() - 1))) { 1202 MI); 1209 LLT DstTy = MRI->getType(MI->getOperand(0).getReg()); 1210 LLT SrcEltTy = MRI->getType(MI->getOperand(1).getReg()); 1212 report("G_BUILD_VECTOR must produce a vector from scalar operands", MI); 1217 report("G_BUILD_VECTOR result element type must match source type", MI); 1219 if (DstTy.getNumElements() != MI->getNumOperands() - 1) 1220 report("G_BUILD_VECTOR must have an operand for each elemement", MI); 1222 for (unsigned i = 2; i < MI->getNumOperands(); ++i) { 1223 if (MRI->getType(MI->getOperand(1).getReg()) != 1224 MRI->getType(MI->getOperand(i).getReg())) 1225 report("G_BUILD_VECTOR source operand types are not homogeneous", MI); 1233 LLT DstTy = MRI->getType(MI->getOperand(0).getReg()); 1234 LLT SrcEltTy = MRI->getType(MI->getOperand(1).getReg()); 1237 MI); 1238 for (unsigned i = 2; i < MI->getNumOperands(); ++i) { 1239 if (MRI->getType(MI->getOperand(1).getReg()) != 1240 MRI->getType(MI->getOperand(i).getReg())) 1242 MI); 1247 MI); 1253 LLT DstTy = MRI->getType(MI->getOperand(0).getReg()); 1254 LLT SrcTy = MRI->getType(MI->getOperand(1).getReg()); 1257 MI); 1258 for (unsigned i = 2; i < MI->getNumOperands(); ++i) { 1259 if (MRI->getType(MI->getOperand(1).getReg()) != 1260 MRI->getType(MI->getOperand(i).getReg())) 1261 report("G_CONCAT_VECTOR source operand types are not homogeneous", MI); 1264 SrcTy.getNumElements() * (MI->getNumOperands() - 1)) 1265 report("G_CONCAT_VECTOR num dest and source elements should match", MI); 1270 LLT DstTy = MRI->getType(MI->getOperand(0).getReg()); 1271 LLT SrcTy = MRI->getType(MI->getOperand(2).getReg()); 1275 report("Generic vector icmp/fcmp must preserve number of lanes", MI); 1280 const MachineOperand &SrcOp = MI->getOperand(1); 1282 report("extract source must be a register", MI); 1286 const MachineOperand &OffsetOp = MI->getOperand(2); 1288 report("extract offset must be a constant", MI); 1292 unsigned DstSize = MRI->getType(MI->getOperand(0).getReg()).getSizeInBits(); 1295 report("extract source must be larger than result", MI); 1298 report("extract reads past end of register", MI); 1302 const MachineOperand &SrcOp = MI->getOperand(2); 1304 report("insert source must be a register", MI); 1308 const MachineOperand &OffsetOp = MI->getOperand(3); 1310 report("insert offset must be a constant", MI); 1314 unsigned DstSize = MRI->getType(MI->getOperand(0).getReg()).getSizeInBits(); 1318 report("inserted size must be smaller than total register", MI); 1321 report("insert writes past end of register", MI); 1326 if (!MI->getOperand(1).isJTI()) 1327 report("G_JUMP_TABLE source operand must be a jump table index", MI); 1328 LLT DstTy = MRI->getType(MI->getOperand(0).getReg()); 1330 report("G_JUMP_TABLE dest operand must have a pointer type", MI); 1334 if (!MRI->getType(MI->getOperand(0).getReg()).isPointer()) 1335 report("G_BRJT src operand 0 must be a pointer type", MI); 1337 if (!MI->getOperand(1).isJTI()) 1338 report("G_BRJT src operand 1 must be a jump table index", MI); 1340 const auto &IdxOp = MI->getOperand(2); 1342 report("G_BRJT src operand 2 must be a scalar reg type", MI); 1349 const MachineOperand &IntrIDOp = MI->getOperand(MI->getNumExplicitDefs()); 1349 const MachineOperand &IntrIDOp = MI->getOperand(MI->getNumExplicitDefs()); 1351 report("G_INTRINSIC first src operand must be an intrinsic ID", MI); 1355 bool NoSideEffects = MI->getOpcode() == TargetOpcode::G_INTRINSIC; 1363 report("G_INTRINSIC used with intrinsic that accesses memory", MI); 1367 report("G_INTRINSIC_W_SIDE_EFFECTS used with readnone intrinsic", MI); 1373 if (MI->getNumOperands() != 5) 1374 report("Expected memcpy intrinsic to have 5 operands", MI); 1377 if (MI->getNumOperands() != 5) 1378 report("Expected memmove intrinsic to have 5 operands", MI); 1381 if (MI->getNumOperands() != 5) 1382 report("Expected memset intrinsic to have 5 operands", MI); 1388 if (!MI->getOperand(2).isImm()) { 1389 report("G_SEXT_INREG expects an immediate operand #2", MI); 1393 LLT DstTy = MRI->getType(MI->getOperand(0).getReg()); 1394 LLT SrcTy = MRI->getType(MI->getOperand(1).getReg()); 1395 verifyVectorElementMatch(DstTy, SrcTy, MI); 1397 int64_t Imm = MI->getOperand(2).getImm(); 1399 report("G_SEXT_INREG size must be >= 1", MI); 1401 report("G_SEXT_INREG size must be less than source bit width", MI); 1405 const MachineOperand &MaskOp = MI->getOperand(3); 1407 report("Incorrect mask operand type for G_SHUFFLE_VECTOR", MI); 1414 report("Invalid shufflemask constant type", MI); 1419 report("Invalid shufflemask constant type", MI); 1423 LLT DstTy = MRI->getType(MI->getOperand(0).getReg()); 1424 LLT Src0Ty = MRI->getType(MI->getOperand(1).getReg()); 1425 LLT Src1Ty = MRI->getType(MI->getOperand(2).getReg()); 1428 report("Source operands must be the same type", MI); 1431 report("G_SHUFFLE_VECTOR cannot change element type", MI); 1442 report("Wrong result type for shufflemask", MI); 1449 report("Out of bounds shuffle index", MI); 1455 const MachineOperand &DstOp = MI->getOperand(0); 1456 const MachineOperand &AllocOp = MI->getOperand(1); 1457 const MachineOperand &AlignOp = MI->getOperand(2); 1460 report("dst operand 0 must be a pointer type", MI); 1465 report("src operand 1 must be a scalar reg type", MI); 1470 report("src operand 2 must be an immediate type", MI);