When I create a new vector const with following code, I’ll get a MachineInstr %0:(<2 x s32>) = G_BUILD_VECTOR %1:(s32), %2:_(s32) missing regbank information, this is different from the normal format %0:fpr(<2 x s32>) = G_BUILD_VECTOR %1:gpr(s32), %2:gpr(s32), so how to add related regbank information or is the wrong interface used ?
New error unknown operand type in function lowerOperand because the const type is “MachineOperand::MO_CImmediate” after adding MRI.setRegClass(C0.getReg(0), &AArch64::GPR64RegClass) to fix above " LLVM ERROR: VReg has no regclass after selection"
You’re looking at code that’s too early. The error is telling you the instruction wasn’t properly selected. The register banks need to be constrained to a real instruction with final register classes during the selection pass. You’ve somehow let a generic instruction get past selection