diff --git a/llvm/utils/TableGen/GlobalISelEmitter.cpp b/llvm/utils/TableGen/GlobalISelEmitter.cpp --- a/llvm/utils/TableGen/GlobalISelEmitter.cpp +++ b/llvm/utils/TableGen/GlobalISelEmitter.cpp @@ -4594,8 +4594,17 @@ return failedImport("Dst pattern child has multiple results"); std::optional OpTyOrNone; - if (ChildTypes.front().isMachineValueType()) - OpTyOrNone = MVTToLLT(ChildTypes.front().getMachineValueType().SimpleTy); + if (ChildTypes.front().isMachineValueType()) { + MVT VT = ChildTypes.front().getMachineValueType(); + // Allow import more patterns like ComplexPattern. + if (VT == MVT::iPTR) + // Since we don't know the exact pointer size for target supporting + // multiple address modes when tables are generated, no LLT is passed + // into LLTCodeGen. + OpTyOrNone = LLTCodeGen(); + else + OpTyOrNone = MVTToLLT(VT.SimpleTy); + } if (!OpTyOrNone) return failedImport("Dst operand has an unsupported type");