From 63f6e70be9c278e9553b331c95fca26bc68f659a Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Fri, 21 Apr 2023 17:27:06 -0700 Subject: [PATCH] [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. --- llvm/utils/TableGen/CodeGenDAGPatterns.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp index f861caa..2d8b52c 100644 --- a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp +++ b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp @@ -4381,6 +4381,9 @@ static void collectModes(std::set &Modes, const TreePatternNode *N) { void CodeGenDAGPatterns::ExpandHwModeBasedTypes() { const CodeGenHwModes &CGH = getTargetInfo().getHwModes(); + if (CGH.getNumModeIds() == 1) + return; + std::vector Copy; PatternsToMatch.swap(Copy); -- 2.7.4