[llvm] 421a40b - TableGen: Don't reconstruct CodeGenDAGTarget

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Sat May 23 09:51:31 PDT 2020


Author: Matt Arsenault
Date: 2020-05-23T12:15:44-04:00
New Revision: 421a40b32520f5a3764a974df44f89e7d80bc6b4

URL: https://github.com/llvm/llvm-project/commit/421a40b32520f5a3764a974df44f89e7d80bc6b4
DIFF: https://github.com/llvm/llvm-project/commit/421a40b32520f5a3764a974df44f89e7d80bc6b4.diff

LOG: TableGen: Don't reconstruct CodeGenDAGTarget

This is quite expensive and it's already available.

Just ReadLegalValueTypes is taking 4 seconds for me in a debug build
for AMDGPU's -gen-instr-info, and this was introducing a second call.

Added: 
    

Modified: 
    llvm/utils/TableGen/InstrInfoEmitter.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/utils/TableGen/InstrInfoEmitter.cpp b/llvm/utils/TableGen/InstrInfoEmitter.cpp
index 2da2bec112f5..f3141735a995 100644
--- a/llvm/utils/TableGen/InstrInfoEmitter.cpp
+++ b/llvm/utils/TableGen/InstrInfoEmitter.cpp
@@ -822,7 +822,7 @@ void InstrInfoEmitter::emitEnums(raw_ostream &OS) {
 
   OS << "namespace llvm {\n\n";
 
-  CodeGenTarget Target(Records);
+  const CodeGenTarget &Target = CDP.getTargetInfo();
 
   // We must emit the PHI opcode first...
   StringRef Namespace = Target.getInstNamespace();


        


More information about the llvm-commits mailing list