[llvm] [TableGen] Merge GlobalISel library into llvm-tblgen (PR #73634)

via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 28 02:56:11 PST 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-globalisel

Author: Pierre van Houtryve (Pierre-vh)

<details>
<summary>Changes</summary>

This "library" isn't really necessary. The subfolder is more of a group of related files than a separate library. Moreover, Patterns.cpp uses CodeGenInstruction so we had a circular dependency.

This patch brings all of those files into the llvm-tblgen target to make things easier to manage. We can always split it back up if necessary someday.

---
Full diff: https://github.com/llvm/llvm-project/pull/73634.diff


3 Files Affected:

- (modified) llvm/utils/TableGen/CMakeLists.txt (+5-3) 
- (removed) llvm/utils/TableGen/GlobalISel/CMakeLists.txt (-20) 
- (modified) llvm/utils/TableGen/GlobalISel/Patterns.cpp (+1-1) 


``````````diff
diff --git a/llvm/utils/TableGen/CMakeLists.txt b/llvm/utils/TableGen/CMakeLists.txt
index 071ea3bc07054bb..faaedf3c561d8af 100644
--- a/llvm/utils/TableGen/CMakeLists.txt
+++ b/llvm/utils/TableGen/CMakeLists.txt
@@ -1,5 +1,3 @@
-add_subdirectory(GlobalISel)
-
 add_llvm_library(LLVMTableGenCommon STATIC OBJECT EXCLUDE_FROM_ALL
   Attributes.cpp
   CodeGenIntrinsics.cpp
@@ -33,6 +31,10 @@ set(LLVM_LINK_COMPONENTS
 add_tablegen(llvm-tblgen LLVM
   DESTINATION "${LLVM_TOOLS_INSTALL_DIR}"
   EXPORT LLVM
+  GlobalISel/CodeExpander.cpp
+  GlobalISel/CXXPredicates.cpp
+  GlobalISel/MatchDataInfo.cpp
+  GlobalISel/Patterns.cpp
   AsmMatcherEmitter.cpp
   AsmWriterEmitter.cpp
   AsmWriterInst.cpp
@@ -92,5 +94,5 @@ add_tablegen(llvm-tblgen LLVM
   DEPENDS
   intrinsics_gen # via llvm-min-tablegen
   )
-target_link_libraries(llvm-tblgen PRIVATE LLVMTableGenGlobalISel)
+target_include_directories(llvm-tblgen PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}")
 set_target_properties(llvm-tblgen PROPERTIES FOLDER "Tablegenning")
diff --git a/llvm/utils/TableGen/GlobalISel/CMakeLists.txt b/llvm/utils/TableGen/GlobalISel/CMakeLists.txt
deleted file mode 100644
index 7262c405839934a..000000000000000
--- a/llvm/utils/TableGen/GlobalISel/CMakeLists.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-set(LLVM_LINK_COMPONENTS
-  Support
-  TableGen
-  )
-
-add_llvm_library(LLVMTableGenGlobalISel STATIC DISABLE_LLVM_LINK_LLVM_DYLIB
-  CodeExpander.cpp
-  CXXPredicates.cpp
-  MatchDataInfo.cpp
-  Patterns.cpp
-
-  DEPENDS
-  vt_gen
-  )
-
-# Users may include its headers as "GlobalISel/*.h"
-target_include_directories(LLVMTableGenGlobalISel
-  INTERFACE
-  $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
-  )
diff --git a/llvm/utils/TableGen/GlobalISel/Patterns.cpp b/llvm/utils/TableGen/GlobalISel/Patterns.cpp
index 0a6d05e06dca128..9186cfb0ee948f3 100644
--- a/llvm/utils/TableGen/GlobalISel/Patterns.cpp
+++ b/llvm/utils/TableGen/GlobalISel/Patterns.cpp
@@ -7,7 +7,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "Patterns.h"
-#include "../CodeGenInstruction.h"
+#include "CodeGenInstruction.h"
 #include "CXXPredicates.h"
 #include "CodeExpander.h"
 #include "CodeExpansions.h"

``````````

</details>


https://github.com/llvm/llvm-project/pull/73634


More information about the llvm-commits mailing list