diff options
author | Chris Lattner <sabre@nondot.org> | 2012-05-23 05:19:18 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2012-05-23 05:19:18 +0000 |
commit | a48289a672e20587e95bcdd84d5c71d28eb3d2b8 (patch) | |
tree | 1feb8048a82bded579d8bd14d6cc8ec169aea86a /utils/TableGen | |
parent | 82dd67a1c8edfacac45e31a868ef074248bccb12 (diff) | |
download | external_llvm-a48289a672e20587e95bcdd84d5c71d28eb3d2b8.zip external_llvm-a48289a672e20587e95bcdd84d5c71d28eb3d2b8.tar.gz external_llvm-a48289a672e20587e95bcdd84d5c71d28eb3d2b8.tar.bz2 |
small refinement to r157218 to save a tiny amount of table size in the common
case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157312 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen')
-rw-r--r-- | utils/TableGen/IntrinsicEmitter.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/utils/TableGen/IntrinsicEmitter.cpp b/utils/TableGen/IntrinsicEmitter.cpp index a595b1e..2a22c97 100644 --- a/utils/TableGen/IntrinsicEmitter.cpp +++ b/utils/TableGen/IntrinsicEmitter.cpp @@ -338,7 +338,8 @@ enum IIT_Info { IIT_STRUCT4 = 20, IIT_STRUCT5 = 21, IIT_EXTEND_VEC_ARG = 22, - IIT_TRUNC_VEC_ARG = 23 + IIT_TRUNC_VEC_ARG = 23, + IIT_ANYPTR = 24 }; @@ -412,13 +413,17 @@ static void EncodeFixedType(Record *R, unsigned &NextArgNo, } if (VT == MVT::iPTR) { - Sig.push_back(IIT_PTR); unsigned AddrSpace = 0; if (R->isSubClassOf("LLVMQualPointerType")) { AddrSpace = R->getValueAsInt("AddrSpace"); assert(AddrSpace < 256 && "Address space exceeds 255"); } - Sig.push_back(AddrSpace); + if (AddrSpace) { + Sig.push_back(IIT_ANYPTR); + Sig.push_back(AddrSpace); + } else { + Sig.push_back(IIT_PTR); + } return EncodeFixedType(R->getValueAsDef("ElTy"), NextArgNo, Sig); } @@ -491,7 +496,8 @@ void IntrinsicEmitter::EmitGenerator(const std::vector<CodeGenIntrinsic> &Ints, OS << " IIT_STRUCT4 = 20,\n"; OS << " IIT_STRUCT5 = 21,\n"; OS << " IIT_EXTEND_VEC_ARG = 22,\n"; - OS << " IIT_TRUNC_VEC_ARG = 23\n"; + OS << " IIT_TRUNC_VEC_ARG = 23,\n"; + OS << " IIT_ANYPTR = 24\n"; OS << "};\n\n"; |