[llvm] 63f6e70 - [TableGen] Early exit from ExpandHwModeBasedTypes when there are no HwModes.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 21 17:27:41 PDT 2023


Author: Craig Topper
Date: 2023-04-21T17:27:25-07:00
New Revision: 63f6e70be9c278e9553b331c95fca26bc68f659a

URL: https://github.com/llvm/llvm-project/commit/63f6e70be9c278e9553b331c95fca26bc68f659a
DIFF: https://github.com/llvm/llvm-project/commit/63f6e70be9c278e9553b331c95fca26bc68f659a.diff

LOG: [TableGen] Early exit from ExpandHwModeBasedTypes when there are no HwModes.

Most targets don't use HwModes. For these targets we can skip
collecting the HwModes and copying all the pattern pointers.

Added: 
    

Modified: 
    llvm/utils/TableGen/CodeGenDAGPatterns.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
index f861caa11687..2d8b52c10cc0 100644
--- a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
+++ b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
@@ -4381,6 +4381,9 @@ static void collectModes(std::set<unsigned> &Modes, const TreePatternNode *N) {
 
 void CodeGenDAGPatterns::ExpandHwModeBasedTypes() {
   const CodeGenHwModes &CGH = getTargetInfo().getHwModes();
+  if (CGH.getNumModeIds() == 1)
+    return;
+
   std::vector<PatternToMatch> Copy;
   PatternsToMatch.swap(Copy);
 


        


More information about the llvm-commits mailing list