diff options
author | Chris Lattner <sabre@nondot.org> | 2006-11-14 21:50:27 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-11-14 21:50:27 +0000 |
commit | 717a611f79b47932bb2de9643e02ed25edaec4a5 (patch) | |
tree | 04f8fb0c5a1508fe124f17d67e80816f96070dbb | |
parent | 2f42ed6b0b5161296cdd7e573b49fe631599fc97 (diff) |
minimal hack to get patterns whose result type is iPTR to be selected.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31742 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | utils/TableGen/DAGISelEmitter.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/utils/TableGen/DAGISelEmitter.cpp b/utils/TableGen/DAGISelEmitter.cpp index a35175a20f..ae4874b641 100644 --- a/utils/TableGen/DAGISelEmitter.cpp +++ b/utils/TableGen/DAGISelEmitter.cpp @@ -3725,15 +3725,31 @@ void DAGISelEmitter::EmitInstructionSelector(std::ostream &OS) { OS << " return Select_" << getLegalCName(OpName) << (VTStr != "" ? "_" : "") << VTStr << "(N);\n"; } else { + // Keep track of whether we see a pattern that has an iPtr result. + bool HasPtrPattern = false; + OS << " switch (NVT) {\n"; for (unsigned i = 0, e = OpVTs.size(); i < e; ++i) { std::string &VTStr = OpVTs[i]; assert(!VTStr.empty() && "Unset vtstr?"); + + // If this is a match on iPTR: don't emit it directly, we need special + // code. + if (VTStr == "iPTR") { + HasPtrPattern = true; + continue; + } OS << " case MVT::" << VTStr << ":\n" << " return Select_" << getLegalCName(OpName) << "_" << VTStr << "(N);\n"; } OS << " default:\n"; + + // If there is an iPTR result version of this pattern, emit it here. + if (HasPtrPattern) { + OS << " if (NVT == TLI.getPointerTy())\n"; + OS << " return Select_" << getLegalCName(OpName) <<"_iPTR(N);\n"; + } OS << " break;\n"; OS << " }\n"; OS << " break;\n"; |