Index: include/llvm/CodeGen/GlobalISel/InstructionSelectorImpl.h =================================================================== --- include/llvm/CodeGen/GlobalISel/InstructionSelectorImpl.h +++ include/llvm/CodeGen/GlobalISel/InstructionSelectorImpl.h @@ -205,7 +205,12 @@ CurrentIdx = Default; break; } - const LLT Ty = MRI.getType(MO.getReg()); + + // TableGen is unable to match pointer types, so convert pointers + // to an integer type of the same size. + LLT Ty = MRI.getType(MO.getReg()); + if (Ty.isPointer()) + Ty = LLT::scalar(Ty.getSizeInBits()); const auto TyI = ISelInfo.TypeIDMap.find(Ty); if (TyI == ISelInfo.TypeIDMap.end()) { CurrentIdx = Default;