[llvm] Reapply "[SandboxIR][NFC] Move Region from SandboxVectorizer to SandboxIR." (#110173) (PR #110181)

Jorge Gorbe Moya via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 26 15:28:52 PDT 2024


https://github.com/slackito created https://github.com/llvm/llvm-project/pull/110181

Re-applies llvm/llvm-project#110173 after fixing build break.

>From fe60f626fb5966039535593b093fde7a7b5f0228 Mon Sep 17 00:00:00 2001
From: Jorge Gorbe Moya <jgorbe at google.com>
Date: Thu, 26 Sep 2024 14:11:18 -0700
Subject: [PATCH] [SandboxIR][NFC] Move Region from SandboxVectorizer to
 SandboxIR.

I'm planning to add RegionPass and RegionPassManager next to the
equivalent FunctionPass and FunctionPassManager in SandboxIR, which
means that SandboxIR has to kwow about Regions.

There's nothing vectorizer-specific about the Region class, so this is
a straightforward file move.
---
 .../Vectorize/SandboxVectorizer => SandboxIR}/Region.h          | 0
 llvm/lib/SandboxIR/CMakeLists.txt                               | 1 +
 .../Vectorize/SandboxVectorizer => SandboxIR}/Region.cpp        | 2 +-
 llvm/lib/Transforms/Vectorize/CMakeLists.txt                    | 1 -
 llvm/unittests/SandboxIR/CMakeLists.txt                         | 1 +
 .../Vectorize/SandboxVectorizer => SandboxIR}/RegionTest.cpp    | 0
 .../Transforms/Vectorize/SandboxVectorizer/CMakeLists.txt       | 1 -
 7 files changed, 3 insertions(+), 3 deletions(-)
 rename llvm/include/llvm/{Transforms/Vectorize/SandboxVectorizer => SandboxIR}/Region.h (100%)
 rename llvm/lib/{Transforms/Vectorize/SandboxVectorizer => SandboxIR}/Region.cpp (96%)
 rename llvm/unittests/{Transforms/Vectorize/SandboxVectorizer => SandboxIR}/RegionTest.cpp (100%)

diff --git a/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Region.h b/llvm/include/llvm/SandboxIR/Region.h
similarity index 100%
rename from llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Region.h
rename to llvm/include/llvm/SandboxIR/Region.h
diff --git a/llvm/lib/SandboxIR/CMakeLists.txt b/llvm/lib/SandboxIR/CMakeLists.txt
index 6386fc908388a0..a1295d67bc54f7 100644
--- a/llvm/lib/SandboxIR/CMakeLists.txt
+++ b/llvm/lib/SandboxIR/CMakeLists.txt
@@ -3,6 +3,7 @@ add_llvm_component_library(LLVMSandboxIR
   Module.cpp
   Pass.cpp
   PassManager.cpp
+  Region.cpp
   SandboxIR.cpp
   Tracker.cpp
   Type.cpp
diff --git a/llvm/lib/Transforms/Vectorize/SandboxVectorizer/Region.cpp b/llvm/lib/SandboxIR/Region.cpp
similarity index 96%
rename from llvm/lib/Transforms/Vectorize/SandboxVectorizer/Region.cpp
rename to llvm/lib/SandboxIR/Region.cpp
index 5f2c28484f62bc..b14c87f44260f9 100644
--- a/llvm/lib/Transforms/Vectorize/SandboxVectorizer/Region.cpp
+++ b/llvm/lib/SandboxIR/Region.cpp
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "llvm/Transforms/Vectorize/SandboxVectorizer/Region.h"
+#include "llvm/SandboxIR/Region.h"
 
 namespace llvm::sandboxir {
 
diff --git a/llvm/lib/Transforms/Vectorize/CMakeLists.txt b/llvm/lib/Transforms/Vectorize/CMakeLists.txt
index 8bd3dbf0695733..eeff4a9f6a8bae 100644
--- a/llvm/lib/Transforms/Vectorize/CMakeLists.txt
+++ b/llvm/lib/Transforms/Vectorize/CMakeLists.txt
@@ -5,7 +5,6 @@ add_llvm_component_library(LLVMVectorize
   LoopVectorize.cpp
   SandboxVectorizer/DependencyGraph.cpp
   SandboxVectorizer/Passes/BottomUpVec.cpp
-  SandboxVectorizer/Region.cpp
   SandboxVectorizer/SandboxVectorizer.cpp
   SLPVectorizer.cpp
   Vectorize.cpp
diff --git a/llvm/unittests/SandboxIR/CMakeLists.txt b/llvm/unittests/SandboxIR/CMakeLists.txt
index 2ab284a511fcaa..622496ada567fc 100644
--- a/llvm/unittests/SandboxIR/CMakeLists.txt
+++ b/llvm/unittests/SandboxIR/CMakeLists.txt
@@ -7,6 +7,7 @@ set(LLVM_LINK_COMPONENTS
 
 add_llvm_unittest(SandboxIRTests
   PassTest.cpp
+  RegionTest.cpp
   SandboxIRTest.cpp
   TrackerTest.cpp
   TypesTest.cpp
diff --git a/llvm/unittests/Transforms/Vectorize/SandboxVectorizer/RegionTest.cpp b/llvm/unittests/SandboxIR/RegionTest.cpp
similarity index 100%
rename from llvm/unittests/Transforms/Vectorize/SandboxVectorizer/RegionTest.cpp
rename to llvm/unittests/SandboxIR/RegionTest.cpp
diff --git a/llvm/unittests/Transforms/Vectorize/SandboxVectorizer/CMakeLists.txt b/llvm/unittests/Transforms/Vectorize/SandboxVectorizer/CMakeLists.txt
index 86b1d968094cab..b0ef71ba2114a1 100644
--- a/llvm/unittests/Transforms/Vectorize/SandboxVectorizer/CMakeLists.txt
+++ b/llvm/unittests/Transforms/Vectorize/SandboxVectorizer/CMakeLists.txt
@@ -11,5 +11,4 @@ add_llvm_unittest(SandboxVectorizerTests
   DependencyGraphTest.cpp
   InstrIntervalTest.cpp
   LegalityTest.cpp
-  RegionTest.cpp
   )



More information about the llvm-commits mailing list