llvm.org GIT mirror llvm / 717a611
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 Chris Lattner 13 years ago
1 changed file(s) with 16 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
37243724 OS << " return Select_" << getLegalCName(OpName)
37253725 << (VTStr != "" ? "_" : "") << VTStr << "(N);\n";
37263726 } else {
3727 // Keep track of whether we see a pattern that has an iPtr result.
3728 bool HasPtrPattern = false;
3729
37273730 OS << " switch (NVT) {\n";
37283731 for (unsigned i = 0, e = OpVTs.size(); i < e; ++i) {
37293732 std::string &VTStr = OpVTs[i];
37303733 assert(!VTStr.empty() && "Unset vtstr?");
3734
3735 // If this is a match on iPTR: don't emit it directly, we need special
3736 // code.
3737 if (VTStr == "iPTR") {
3738 HasPtrPattern = true;
3739 continue;
3740 }
37313741 OS << " case MVT::" << VTStr << ":\n"
37323742 << " return Select_" << getLegalCName(OpName)
37333743 << "_" << VTStr << "(N);\n";
37343744 }
37353745 OS << " default:\n";
3746
3747 // If there is an iPTR result version of this pattern, emit it here.
3748 if (HasPtrPattern) {
3749 OS << " if (NVT == TLI.getPointerTy())\n";
3750 OS << " return Select_" << getLegalCName(OpName) <<"_iPTR(N);\n";
3751 }
37363752 OS << " break;\n";
37373753 OS << " }\n";
37383754 OS << " break;\n";