From 86ff2689a5e6050e24a9bc11aea1364169d7299f Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Tue, 26 Jan 2016 00:55:00 +0000 Subject: Sort intrinsics by LLVM intrinsic name, rather than tablegen def name Step one towards using a simple binary search to lookup intrinsic IDs instead of our crazy table generated switch+memcmp+startswith code that makes Function.cpp take about a minute to compile. See PR24785 and PR11951 for why we should do this. The X86 backend contains tables that need to be sorted on intrinsic ID, so reorder those. llvm-svn: 258757 --- llvm/utils/TableGen/CodeGenTarget.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'llvm/utils/TableGen/CodeGenTarget.cpp') diff --git a/llvm/utils/TableGen/CodeGenTarget.cpp b/llvm/utils/TableGen/CodeGenTarget.cpp index a22418c6eae..7c2c60147ca 100644 --- a/llvm/utils/TableGen/CodeGenTarget.cpp +++ b/llvm/utils/TableGen/CodeGenTarget.cpp @@ -447,6 +447,10 @@ std::vector llvm::LoadIntrinsics(const RecordKeeper &RC, if (isTarget == TargetOnly) Result.push_back(CodeGenIntrinsic(I[i])); } + std::sort(Result.begin(), Result.end(), + [](CodeGenIntrinsic LHS, CodeGenIntrinsic RHS) { + return LHS.Name < RHS.Name; + }); return Result; } -- cgit v1.2.3