[llvm] [SandboxIR] Delete SandboxIR/SandboxVectorizer (PR #166417)

via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 4 11:24:50 PST 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-transforms

Author: Aiden Grossman (boomanaiden154)

<details>
<summary>Changes</summary>

These components are still experimental, have not recieved commit traffic beyond basic maintenance since May, and it was decided that the people at Google working on the project should focus on other priorities. Given the lack of investment, delete the code for now. If someone wants to revive this, they can revert this patch. For now, delete it so that upstream does not have to bear the maintenance cost.

---

Patch is 1.27 MiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/166417.diff


128 Files Affected:

- (modified) llvm/Maintainers.md (-14) 
- (modified) llvm/benchmarks/CMakeLists.txt (-2) 
- (removed) llvm/benchmarks/SandboxIRBench.cpp (-243) 
- (removed) llvm/docs/SandboxIR.md (-109) 
- (removed) llvm/docs/SandboxVectorizer.md (-280) 
- (modified) llvm/docs/UserGuides.rst (-4) 
- (modified) llvm/docs/Vectorizers.rst (-9) 
- (removed) llvm/include/llvm/SandboxIR/Argument.h (-38) 
- (removed) llvm/include/llvm/SandboxIR/BasicBlock.h (-113) 
- (removed) llvm/include/llvm/SandboxIR/Constant.h (-1519) 
- (removed) llvm/include/llvm/SandboxIR/Context.h (-334) 
- (removed) llvm/include/llvm/SandboxIR/Function.h (-83) 
- (removed) llvm/include/llvm/SandboxIR/Instruction.h (-2632) 
- (removed) llvm/include/llvm/SandboxIR/IntrinsicInst.h (-44) 
- (removed) llvm/include/llvm/SandboxIR/Module.h (-94) 
- (removed) llvm/include/llvm/SandboxIR/Operator.h (-99) 
- (removed) llvm/include/llvm/SandboxIR/Pass.h (-95) 
- (removed) llvm/include/llvm/SandboxIR/PassManager.h (-227) 
- (removed) llvm/include/llvm/SandboxIR/Region.h (-193) 
- (removed) llvm/include/llvm/SandboxIR/Tracker.h (-529) 
- (removed) llvm/include/llvm/SandboxIR/Type.h (-480) 
- (removed) llvm/include/llvm/SandboxIR/Use.h (-72) 
- (removed) llvm/include/llvm/SandboxIR/User.h (-151) 
- (removed) llvm/include/llvm/SandboxIR/Utils.h (-138) 
- (removed) llvm/include/llvm/SandboxIR/Value.h (-316) 
- (removed) llvm/include/llvm/SandboxIR/Values.def (-154) 
- (removed) llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Debug.h (-21) 
- (removed) llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.h (-469) 
- (removed) llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/InstrMaps.h (-110) 
- (removed) llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Interval.h (-244) 
- (removed) llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Legality.h (-362) 
- (removed) llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/BottomUpVec.h (-104) 
- (removed) llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/NullPass.h (-30) 
- (removed) llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/PackReuse.h (-36) 
- (removed) llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/PrintInstructionCount.h (-23) 
- (removed) llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/PrintRegion.h (-29) 
- (removed) llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/RegionsFromBBs.h (-38) 
- (removed) llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/RegionsFromMetadata.h (-38) 
- (removed) llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/SeedCollection.h (-40) 
- (removed) llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/TransactionAcceptOrRevert.h (-30) 
- (removed) llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/TransactionAlwaysAccept.h (-34) 
- (removed) llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/TransactionAlwaysRevert.h (-34) 
- (removed) llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/TransactionSave.h (-28) 
- (removed) llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/SandboxVectorizer.h (-62) 
- (removed) llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/SandboxVectorizerPassBuilder.h (-32) 
- (removed) llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Scheduler.h (-268) 
- (removed) llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/SeedCollector.h (-331) 
- (removed) llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/VecUtils.h (-276) 
- (modified) llvm/include/module.modulemap (-9) 
- (modified) llvm/lib/CMakeLists.txt (-1) 
- (modified) llvm/lib/Passes/PassBuilder.cpp (-1) 
- (modified) llvm/lib/Passes/PassRegistry.def (-1) 
- (removed) llvm/lib/SandboxIR/Argument.cpp (-23) 
- (removed) llvm/lib/SandboxIR/BasicBlock.cpp (-158) 
- (removed) llvm/lib/SandboxIR/CMakeLists.txt (-26) 
- (removed) llvm/lib/SandboxIR/Constant.cpp (-484) 
- (removed) llvm/lib/SandboxIR/Context.cpp (-781) 
- (removed) llvm/lib/SandboxIR/Function.cpp (-62) 
- (removed) llvm/lib/SandboxIR/Instruction.cpp (-1562) 
- (removed) llvm/lib/SandboxIR/Module.cpp (-43) 
- (removed) llvm/lib/SandboxIR/Pass.cpp (-19) 
- (removed) llvm/lib/SandboxIR/PassManager.cpp (-33) 
- (removed) llvm/lib/SandboxIR/Region.cpp (-192) 
- (removed) llvm/lib/SandboxIR/Tracker.cpp (-378) 
- (removed) llvm/lib/SandboxIR/Type.cpp (-127) 
- (removed) llvm/lib/SandboxIR/Use.cpp (-61) 
- (removed) llvm/lib/SandboxIR/User.cpp (-121) 
- (removed) llvm/lib/SandboxIR/Value.cpp (-124) 
- (modified) llvm/lib/Transforms/Vectorize/CMakeLists.txt (-18) 
- (removed) llvm/lib/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.cpp (-665) 
- (removed) llvm/lib/Transforms/Vectorize/SandboxVectorizer/InstrMaps.cpp (-34) 
- (removed) llvm/lib/Transforms/Vectorize/SandboxVectorizer/Interval.cpp (-49) 
- (removed) llvm/lib/Transforms/Vectorize/SandboxVectorizer/Legality.cpp (-259) 
- (removed) llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/BottomUpVec.cpp (-518) 
- (removed) llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/PackReuse.cpp (-53) 
- (removed) llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/PassRegistry.def (-40) 
- (removed) llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/RegionsFromBBs.cpp (-35) 
- (removed) llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/RegionsFromMetadata.cpp (-30) 
- (removed) llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/SeedCollection.cpp (-105) 
- (removed) llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/TransactionAcceptOrRevert.cpp (-45) 
- (removed) llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/TransactionSave.cpp (-21) 
- (removed) llvm/lib/Transforms/Vectorize/SandboxVectorizer/SandboxVectorizer.cpp (-144) 
- (removed) llvm/lib/Transforms/Vectorize/SandboxVectorizer/SandboxVectorizerPassBuilder.cpp (-40) 
- (removed) llvm/lib/Transforms/Vectorize/SandboxVectorizer/Scheduler.cpp (-360) 
- (removed) llvm/lib/Transforms/Vectorize/SandboxVectorizer/SeedCollector.cpp (-212) 
- (removed) llvm/lib/Transforms/Vectorize/SandboxVectorizer/VecUtils.cpp (-32) 
- (removed) llvm/test/Transforms/SandboxVectorizer/X86/lit.local.cfg (-2) 
- (removed) llvm/test/Transforms/SandboxVectorizer/X86/no_implicit_float.ll (-23) 
- (removed) llvm/test/Transforms/SandboxVectorizer/X86/simple_cost_test.ll (-91) 
- (removed) llvm/test/Transforms/SandboxVectorizer/allow_files.ll (-39) 
- (removed) llvm/test/Transforms/SandboxVectorizer/boilerplate.ll (-11) 
- (removed) llvm/test/Transforms/SandboxVectorizer/bottomup_basic.ll (-743) 
- (removed) llvm/test/Transforms/SandboxVectorizer/bottomup_seed_slice.ll (-32) 
- (removed) llvm/test/Transforms/SandboxVectorizer/bottomup_seed_slice_pow2.ll (-34) 
- (removed) llvm/test/Transforms/SandboxVectorizer/cross_bbs.ll (-28) 
- (removed) llvm/test/Transforms/SandboxVectorizer/default_pass_pipeline.ll (-14) 
- (removed) llvm/test/Transforms/SandboxVectorizer/pack.ll (-117) 
- (removed) llvm/test/Transforms/SandboxVectorizer/pack_reuse_basic.ll (-71) 
- (removed) llvm/test/Transforms/SandboxVectorizer/pack_reuse_end_to_end.ll (-45) 
- (removed) llvm/test/Transforms/SandboxVectorizer/print_region_pass.ll (-26) 
- (removed) llvm/test/Transforms/SandboxVectorizer/regions-from-bbs.ll (-31) 
- (removed) llvm/test/Transforms/SandboxVectorizer/regions-from-metadata.ll (-15) 
- (removed) llvm/test/Transforms/SandboxVectorizer/repeated_instrs.ll (-65) 
- (removed) llvm/test/Transforms/SandboxVectorizer/scheduler.ll (-76) 
- (removed) llvm/test/Transforms/SandboxVectorizer/special_opcodes.ll (-97) 
- (removed) llvm/test/Transforms/SandboxVectorizer/stop_at.ll (-61) 
- (removed) llvm/test/Transforms/SandboxVectorizer/stop_bndl.ll (-71) 
- (removed) llvm/test/Transforms/SandboxVectorizer/user_pass_pipeline.ll (-28) 
- (modified) llvm/unittests/CMakeLists.txt (-1) 
- (removed) llvm/unittests/SandboxIR/CMakeLists.txt (-17) 
- (removed) llvm/unittests/SandboxIR/IntrinsicInstTest.cpp (-88) 
- (removed) llvm/unittests/SandboxIR/OperatorTest.cpp (-141) 
- (removed) llvm/unittests/SandboxIR/PassTest.cpp (-351) 
- (removed) llvm/unittests/SandboxIR/RegionTest.cpp (-512) 
- (removed) llvm/unittests/SandboxIR/SandboxIRTest.cpp (-6419) 
- (removed) llvm/unittests/SandboxIR/TrackerTest.cpp (-1920) 
- (removed) llvm/unittests/SandboxIR/TypesTest.cpp (-469) 
- (removed) llvm/unittests/SandboxIR/UtilsTest.cpp (-249) 
- (modified) llvm/unittests/Transforms/Vectorize/CMakeLists.txt (-2) 
- (removed) llvm/unittests/Transforms/Vectorize/SandboxVectorizer/CMakeLists.txt (-19) 
- (removed) llvm/unittests/Transforms/Vectorize/SandboxVectorizer/DependencyGraphTest.cpp (-1192) 
- (removed) llvm/unittests/Transforms/Vectorize/SandboxVectorizer/InstrMapsTest.cpp (-119) 
- (removed) llvm/unittests/Transforms/Vectorize/SandboxVectorizer/IntervalTest.cpp (-449) 
- (removed) llvm/unittests/Transforms/Vectorize/SandboxVectorizer/LegalityTest.cpp (-506) 
- (removed) llvm/unittests/Transforms/Vectorize/SandboxVectorizer/SandboxVectorizerTest.cpp (-63) 
- (removed) llvm/unittests/Transforms/Vectorize/SandboxVectorizer/SchedulerTest.cpp (-881) 
- (removed) llvm/unittests/Transforms/Vectorize/SandboxVectorizer/SeedCollectorTest.cpp (-565) 
- (removed) llvm/unittests/Transforms/Vectorize/SandboxVectorizer/VecUtilsTest.cpp (-619) 


``````````diff
diff --git a/llvm/Maintainers.md b/llvm/Maintainers.md
index 1eba955f9d6ed..d6d69aaf81532 100644
--- a/llvm/Maintainers.md
+++ b/llvm/Maintainers.md
@@ -101,13 +101,6 @@ asbirlea at google.com (email), [alinas](https://github.com/alinas) (GitHub)
 Madhur Amilkanthwar \
 madhura at nvidia.com (email), [madhur13490](https://github.com/madhur13490) (GitHub)
 
-#### SandboxVectorizer
-
-Vasileios Porpodas \
-vporpodas at google.com (email), [vporpo](https://github.com/vporpo) (GitHub) \
-Jorge Gorbe Moya \
-jgorbe at google.com (email), [slackito](https://github.com/slackito) (GitHub)
-
 #### ScalarEvolution, IndVarSimplify
 
 Philip Reames \
@@ -397,13 +390,6 @@ geek4civic at gmail.com (email), [chapuni](https://github.com/chapuni) (GitHub)
 Lang Hames \
 lhames at gmail.com (email), [lhames](https://github.com/lhames) (GitHub)
 
-#### SandboxIR
-
-Vasileios Porpodas \
-vporpodas at google.com (email), [vporpo](https://github.com/vporpo) (GitHub) \
-Jorge Gorbe Moya \
-jgorbe at google.com (email), [slackito](https://github.com/slackito) (GitHub)
-
 #### TableGen
 
 Rahul Joshi \
diff --git a/llvm/benchmarks/CMakeLists.txt b/llvm/benchmarks/CMakeLists.txt
index e411ed4326a36..40a11dc4ed16f 100644
--- a/llvm/benchmarks/CMakeLists.txt
+++ b/llvm/benchmarks/CMakeLists.txt
@@ -1,7 +1,6 @@
 set(LLVM_LINK_COMPONENTS
   AsmParser
   Core
-  SandboxIR
   Support)
 
 add_benchmark(DummyYAML DummyYAML.cpp PARTIAL_SOURCES_INTENDED)
@@ -9,7 +8,6 @@ add_benchmark(xxhash xxhash.cpp PARTIAL_SOURCES_INTENDED)
 add_benchmark(GetIntrinsicForClangBuiltin GetIntrinsicForClangBuiltin.cpp PARTIAL_SOURCES_INTENDED)
 add_benchmark(FormatVariadicBM FormatVariadicBM.cpp PARTIAL_SOURCES_INTENDED)
 add_benchmark(GetIntrinsicInfoTableEntriesBM GetIntrinsicInfoTableEntriesBM.cpp PARTIAL_SOURCES_INTENDED)
-add_benchmark(SandboxIRBench SandboxIRBench.cpp PARTIAL_SOURCES_INTENDED)
 add_benchmark(MustacheBench Mustache.cpp PARTIAL_SOURCES_INTENDED)
 add_benchmark(SpecialCaseListBM SpecialCaseListBM.cpp PARTIAL_SOURCES_INTENDED)
 
diff --git a/llvm/benchmarks/SandboxIRBench.cpp b/llvm/benchmarks/SandboxIRBench.cpp
deleted file mode 100644
index 45f352697868b..0000000000000
--- a/llvm/benchmarks/SandboxIRBench.cpp
+++ /dev/null
@@ -1,243 +0,0 @@
-//===- SandboxIRBench.cpp -------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-//
-// These tests measure the performance of some core SandboxIR functions and
-// compare them against LLVM IR.
-//
-//===----------------------------------------------------------------------===//
-
-#include "benchmark/benchmark.h"
-#include "llvm/AsmParser/Parser.h"
-#include "llvm/IR/BasicBlock.h"
-#include "llvm/IR/DataLayout.h"
-#include "llvm/IR/Function.h"
-#include "llvm/IR/Instruction.h"
-#include "llvm/IR/Module.h"
-#include "llvm/SandboxIR/Function.h"
-#include "llvm/SandboxIR/Instruction.h"
-#include "llvm/SandboxIR/Module.h"
-#include "llvm/Support/SourceMgr.h"
-#include <memory>
-#include <sstream>
-
-using namespace llvm;
-
-static std::unique_ptr<Module> parseIR(LLVMContext &C, const char *IR) {
-  SMDiagnostic Err;
-  std::unique_ptr<Module> M = parseAssemblyString(IR, Err, C);
-  if (!M)
-    Err.print("SandboxIRBench", errs());
-  return M;
-}
-
-enum class IR {
-  LLVM,           ///> LLVM IR
-  SBoxNoTracking, ///> Sandbox IR with tracking disabled
-  SBoxTracking,   ///> Sandbox IR with tracking enabled
-};
-// Traits to get llvm::BasicBlock/sandboxir::BasicBlock from IR::LLVM/IR::SBox.
-template <IR IRTy> struct TypeSelect {};
-template <> struct TypeSelect<IR::LLVM> {
-  using BasicBlock = llvm::BasicBlock;
-};
-template <> struct TypeSelect<IR::SBoxNoTracking> {
-  using BasicBlock = sandboxir::BasicBlock;
-};
-template <> struct TypeSelect<IR::SBoxTracking> {
-  using BasicBlock = sandboxir::BasicBlock;
-};
-
-template <IR IRTy>
-static typename TypeSelect<IRTy>::BasicBlock *
-genIR(std::unique_ptr<llvm::Module> &LLVMM, LLVMContext &LLVMCtx,
-      sandboxir::Context &Ctx,
-      std::function<std::string(unsigned)> GenerateIRStr,
-      unsigned NumInstrs = 0u) {
-  std::string IRStr = GenerateIRStr(NumInstrs);
-  LLVMM = parseIR(LLVMCtx, IRStr.c_str());
-  llvm::Function *LLVMF = &*LLVMM->getFunction("foo");
-  llvm::BasicBlock *LLVMBB = &*LLVMF->begin();
-
-  sandboxir::Function *F = Ctx.createFunction(LLVMF);
-  sandboxir::BasicBlock *BB = &*F->begin();
-  // Start tracking if we are testing with tracking enabled.
-  if constexpr (IRTy == IR::SBoxTracking)
-    Ctx.save();
-
-  if constexpr (IRTy == IR::LLVM)
-    return LLVMBB;
-  else
-    return BB;
-}
-
-template <IR IRTy> static void finalize(sandboxir::Context &Ctx) {
-  // Accept changes if we are tracking.
-  if constexpr (IRTy == IR::SBoxTracking)
-    Ctx.accept();
-}
-
-static std::string generateBBWalkIR(unsigned Size) {
-  std::stringstream SS;
-  SS << "define void @foo(i32 %v1, i32 %v2) {\n";
-  for (auto Cnt : seq<unsigned>(0, Size))
-    SS << "  %add" << Cnt << " = add i32 %v1, %v2\n";
-  SS << "ret void";
-  SS << "}";
-  return SS.str();
-}
-
-template <IR IRTy> static void SBoxIRCreation(benchmark::State &State) {
-  static_assert(IRTy != IR::LLVM, "Expected SBoxTracking or SBoxNoTracking");
-  LLVMContext LLVMCtx;
-  unsigned NumInstrs = State.range(0);
-  std::unique_ptr<llvm::Module> LLVMM;
-  std::string IRStr = generateBBWalkIR(NumInstrs);
-  LLVMM = parseIR(LLVMCtx, IRStr.c_str());
-  llvm::Function *LLVMF = &*LLVMM->getFunction("foo");
-
-  for (auto _ : State) {
-    State.PauseTiming();
-    sandboxir::Context Ctx(LLVMCtx);
-    if constexpr (IRTy == IR::SBoxTracking)
-      Ctx.save();
-    State.ResumeTiming();
-
-    sandboxir::Function *F = Ctx.createFunction(LLVMF);
-    benchmark::DoNotOptimize(F);
-    State.PauseTiming();
-    if constexpr (IRTy == IR::SBoxTracking)
-      Ctx.accept();
-    State.ResumeTiming();
-  }
-}
-
-template <IR IRTy> static void BBWalk(benchmark::State &State) {
-  LLVMContext LLVMCtx;
-  sandboxir::Context Ctx(LLVMCtx);
-  unsigned NumInstrs = State.range(0);
-  std::unique_ptr<llvm::Module> LLVMM;
-  auto *BB = genIR<IRTy>(LLVMM, LLVMCtx, Ctx, generateBBWalkIR, NumInstrs);
-  for (auto _ : State) {
-    // Walk LLVM Instructions.
-    for (auto &I : *BB)
-      benchmark::DoNotOptimize(I);
-  }
-}
-
-static std::string generateGetTypeIR(unsigned Size) {
-  return R"IR(
-define void @foo(i32 %v1, i32 %v2) {
-  %add = add i32 %v1, %v2
-  ret void
-}
-)IR";
-}
-
-template <IR IRTy> static void GetType(benchmark::State &State) {
-  LLVMContext LLVMCtx;
-  sandboxir::Context Ctx(LLVMCtx);
-  std::unique_ptr<llvm::Module> LLVMM;
-  auto *BB = genIR<IRTy>(LLVMM, LLVMCtx, Ctx, generateGetTypeIR);
-  auto *I = &*BB->begin();
-  for (auto _ : State)
-    benchmark::DoNotOptimize(I->getType());
-}
-
-static std::string generateRAUWIR(unsigned Size) {
-  std::stringstream SS;
-  SS << "define void @foo(i32 %v1, i32 %v2) {\n";
-  SS << "  %def1 = add i32 %v1, %v2\n";
-  SS << "  %def2 = add i32 %v1, %v2\n";
-  for (auto Cnt : seq<unsigned>(0, Size))
-    SS << "  %add" << Cnt << " = add i32 %def1, %def1\n";
-  SS << "ret void";
-  SS << "}";
-  return SS.str();
-}
-
-template <IR IRTy> static void RAUW(benchmark::State &State) {
-  LLVMContext LLVMCtx;
-  sandboxir::Context Ctx(LLVMCtx);
-  std::unique_ptr<llvm::Module> LLVMM;
-  unsigned NumInstrs = State.range(0);
-  auto *BB = genIR<IRTy>(LLVMM, LLVMCtx, Ctx, generateRAUWIR, NumInstrs);
-  auto It = BB->begin();
-  auto *Def1 = &*It++;
-  auto *Def2 = &*It++;
-  for (auto _ : State) {
-    Def1->replaceAllUsesWith(Def2);
-    Def2->replaceAllUsesWith(Def1);
-  }
-  finalize<IRTy>(Ctx);
-}
-
-static std::string generateRUOWIR(unsigned NumOperands) {
-  std::stringstream SS;
-  auto GenOps = [&SS, NumOperands]() {
-    for (auto Cnt : seq<unsigned>(0, NumOperands)) {
-      SS << "i8 %arg" << Cnt;
-      bool IsLast = Cnt + 1 == NumOperands;
-      if (!IsLast)
-        SS << ", ";
-    }
-  };
-
-  SS << "define void @foo(";
-  GenOps();
-  SS << ") {\n";
-
-  SS << "   call void @foo(";
-  GenOps();
-  SS << ")\n";
-  SS << "ret void";
-  SS << "}";
-  return SS.str();
-}
-
-template <IR IRTy> static void RUOW(benchmark::State &State) {
-  LLVMContext LLVMCtx;
-  sandboxir::Context Ctx(LLVMCtx);
-  std::unique_ptr<llvm::Module> LLVMM;
-  unsigned NumOperands = State.range(0);
-  auto *BB = genIR<IRTy>(LLVMM, LLVMCtx, Ctx, generateRUOWIR, NumOperands);
-
-  auto It = BB->begin();
-  auto *F = BB->getParent();
-  auto *Arg0 = F->getArg(0);
-  auto *Arg1 = F->getArg(1);
-  auto *Call = &*It++;
-  for (auto _ : State)
-    Call->replaceUsesOfWith(Arg0, Arg1);
-  finalize<IRTy>(Ctx);
-}
-
-// Measure the time it takes to create Sandbox IR without/with tracking.
-BENCHMARK(SBoxIRCreation<IR::SBoxNoTracking>)
-    ->Args({10})
-    ->Args({100})
-    ->Args({1000});
-BENCHMARK(SBoxIRCreation<IR::SBoxTracking>)
-    ->Args({10})
-    ->Args({100})
-    ->Args({1000});
-
-BENCHMARK(GetType<IR::LLVM>);
-BENCHMARK(GetType<IR::SBoxNoTracking>);
-
-BENCHMARK(BBWalk<IR::LLVM>)->Args({1024});
-BENCHMARK(BBWalk<IR::SBoxTracking>)->Args({1024});
-
-BENCHMARK(RAUW<IR::LLVM>)->Args({512});
-BENCHMARK(RAUW<IR::SBoxNoTracking>)->Args({512});
-BENCHMARK(RAUW<IR::SBoxTracking>)->Args({512});
-
-BENCHMARK(RUOW<IR::LLVM>)->Args({4096});
-BENCHMARK(RUOW<IR::SBoxNoTracking>)->Args({4096});
-BENCHMARK(RUOW<IR::SBoxTracking>)->Args({4096});
-
-BENCHMARK_MAIN();
diff --git a/llvm/docs/SandboxIR.md b/llvm/docs/SandboxIR.md
deleted file mode 100644
index d2b612ba95ef1..0000000000000
--- a/llvm/docs/SandboxIR.md
+++ /dev/null
@@ -1,109 +0,0 @@
-# Sandbox IR: A transactional layer over LLVM IR
-
-Sandbox IR is an IR layer on top of LLVM IR that allows you to save/restore its state.
-
-# Quick Start Notes
-
-Within your LLVM pass:
-
-``` C++
-// 1. Include the necessary Sandbox IR header files.
-#include "llvm/SandboxIR/Context.h
-#include "llvm/SandboxIR/Function.h
-
-// 2. Create a sandboxir::Context using LLVMContext `LLVMCtx`.
-sandboxir::Context Ctx(LLVMCtx);
-
-// 3. Create a sandboxir::Function using LLVM IR Function `LLVMF`.
-auto *F = Ctx.createFunction(LLVMF);
-
-// ... Use Sandbox IR in `F` as usual, e.g., iterating, modifying it etc. ...
-
-// 4. Save state when needed.
-Ctx.save();
-
-// ... Modify Sandbox IR ...
-
-// 5. Revert to the saved state.
-Ctx.revert();
-```
-
-Make sure you link against `SandboxIR` in `CMakeLists.txt`:
-
-```
-LINK_COMPONENTS
-...
-SandboxIR
-...
-```
-
-# API
-The Sandbox IR API is designed to feel like LLVM, replicating many common API classes and functions to mirror the LLVM API.
-The class hierarchy is similar (but in the `llvm::sandboxir` namespace).
-For example here is a small part of it:
-```
-namespace sandboxir {
-              Value
-              /  \
-            User BasicBlock ...
-           /   \
-  Instruction Constant
-        /
-     ...
-}
-```
-
-# Design
-
-## Sandbox IR Value <-> LLVM IR Value Mapping
-Each LLVM IR Value maps to a single Sandbox IR Value.
-The reverse is also true in most cases, except for Sandbox IR Instructions that map to more than one LLVM IR Instruction.
-Such instructions can be defined in extensions of the base Sandbox IR.
-
-- Forward mapping: Sandbox IR Value -> LLVM IR Value
-Each Sandbox IR Value contains an `llvm::Value *Val` member variable that points to the corresponding LLVM IR Value.
-
-- Reverse mapping: LLVM IR Value -> Sandbox IR Value
-This mapping is stored in `sandboxir::Context::LLVMValueToValue`.
-
-For example `sandboxir::User::getOperand(OpIdx)` for a `sandboxir::User *U` works as follows:
-- First we find the LLVM User: `llvm::User *LLVMU = U->Val`.
-- Next we get the LLVM Value operand: `llvm::Value *LLVMOp = LLVMU->getOperand(OpIdx)`
-- Finally we get the Sandbox IR operand that corresponds to `LLVMOp` by querying the map in the Sandbox IR context: `retrun Ctx.getValue(LLVMOp)`.
-
-## Sandbox IR is Write-Through
-Sandbox IR is designed to rely on LLVM IR for its state.
-So any change made to Sandbox IR objects directly updates the corresponding LLVM IR.
-
-This has the following benefits:
-- It minimizes the replication of state, and
-- It makes sure that Sandbox IR and LLVM IR are always in sync, which helps avoid bugs and removes the need for a lowering step.
-- No need for serialization/de-serialization infrastructure as we can rely on LLVM IR for it.
-- One can pass actual `llvm::Instruction`s to cost modeling APIs.
-
-Sandbox IR API functions that modify the IR state call the corresponding LLVM IR function that modifies the LLVM IR's state.
-For example, for `sandboxir::User::setOperand(OpIdx, sandboxir::Value *Op)`:
-- We get the corresponding LLVM User: `llvm::User *LLVMU = cast<llvm::User>(Val)`
-- Next we get the corresponding LLVM Operand: `llvm::Value *LLVMOp = Op->Val`
-- Finally we modify `LLVMU`'s operand: `LLVMU->setOperand(OpIdx, LLVMOp)
-
-## IR Change Tracking
-Sandbox IR's state can be saved and restored.
-This is done with the help of the tracker component that is tightly coupled to the public Sandbox IR API functions.
-Please note that nested saves/restores are currently not supported.
-
-To save the state and enable tracking the user needs to call `sandboxir::Context::save()`.
-From this point on any change made to the Sandbox IR state will automatically create a change object and register it with the tracker, without any intervention from the user.
-The changes are accumulated in a vector within the tracker.
-
-To rollback to the saved state the user needs to call `sandboxir::Context::revert()`.
-Reverting back to the saved state is a matter of going over all the accumulated changes in reverse and undoing each individual change.
-
-To accept the changes made to the IR the user needs to call `sandboxir::Context::accept()`.
-Internally this will go through the changes and run any finalization required.
-
-Please note that after a call to `revert()` or `accept()` tracking will stop.
-To start tracking again, the user needs to call `save()`.
-
-# Users of Sandbox IR
-- [The Sandbox Vectorizer](project:SandboxVectorizer.md)
diff --git a/llvm/docs/SandboxVectorizer.md b/llvm/docs/SandboxVectorizer.md
deleted file mode 100644
index 2b2401a4bf92b..0000000000000
--- a/llvm/docs/SandboxVectorizer.md
+++ /dev/null
@@ -1,280 +0,0 @@
-# The Sandbox Vectorizer
-
-```{contents}
-:depth: 4
-```
-
-The Sandbox Vectorizer is a framework for building modular vectorization pipelines on top of [Sandbox IR](#SandboxIR) transactional IR, with a focus on ease of development and testing.
-The default pipeline currently implements a simple SLP-style bottom-up vectorization pipeline.
-
-The transactional IR helps in several ways:
-- It enables a modular design where:
-  - Each vectorization transformation/optimization can be implemented as a separate internal pass that uses actual IR as its input and output.
-  - You can still make end-to-end profitability decisions (i.e., across multiple internal passes), even when the transformations are implemented as separate internal passes.
-  - Each transformation/optimization internal pass can be tested in isolation with lit-tests, as opposed to end-to-end tests.
-- It enables a simpler design by enabling each internal pass commit its state to the IR itself rather than updating helper data-structures that live across the pipeline.
-- Its extensive callback interface helps remove the burden of manually maintaining the vectorizer's components while the IR is being modified.
-
-## Usage
-
-The Sandbox Vectorizer is currently under development and is not enabled by default.
-So in order to use it you have to explicitly run the pass with `opt` like so:
-
-```shell
-$ opt -p=sandbox-vectorizer file.ll
-```
-
-## Internal Pass Pipeline
-
-The Sandbox Vectorizer is designed to be modular and as such it has its own internal pass-pipeline that operates on Sandbox IR.
-Each vectorization phase is implemented as a separate internal pass that runs by the Sandbox Vectorizer's internal pass manager.
-The Sandbox Vectorizer pass itself is an LLVM Function pass.
-
-The following figure shows the basic structure of the Sandbox Vectorizer LLVM Function pass.
-The first component is the conversion of `LLVM IR to Sandbox IR` which converts the LLVM Function to a `sandboxir::Function`.
-From this point on the pass operates on Sandbox IR.
-The main entry point to the internal pass pipeline is the `Sandbox IR Function Pass Manger`, which runs all registered function passes.
-The following figure lists only a single Sandbox IR function pass, the `Seed Collection Pass` which goes over the instructions in the function and collects vectorization candidates, like Stores to consecutive memory addresses, and forms a [Region](#region).
-The `Seed Collection Pass` itself contains its own Region pass pipeline, which in the following example contains a `Transaction Save` pass, a `Bottom-Up Vectorization` pass, a `Pack Reuse` pass and a `Transaction Accept/Revert` pass.
-
-```
-┌────────────────────────────────── Sandbox Vectorizer LLVM Function Pass ─────────────────────────────┐
-│                                                                                                      │
-│ ┌───────┐ ┌────────────────────────── sandboxir::Function Pass Manager ────────────────────────────┐ │
-│ │       │ │                                                                                        │ │
-│ │       │ │ ┌────────────────────────────── Seed Collection Pass ──────────────────────────────┐   │ │
-│ │       │ │ │                                                                                  │   │ │
-│ │       │ │ │ ┌───────┐  For   ┌─────────────── sanboxir::Region Pass Manager ───────────────┐ │   │ │
-│ │LLVM IR│ │ │ │Collect│  each  │ ┌───────────┐ ┌────────────────┐ ┌───────┐ ┌──────────────┐ │ │   │ │
-│ │  to   │ │ │ │ Seeds │ Region │ │Transaction│ │   Bottom─Up    │ │ Pack  │ │ Transaction  │ │ │   │ │
-│ │Sandbox│ │ │ │Create │ ─────> │ │   Save    │ │ Vectorization  │ │ Reuse │ │Accept/Revert │ │ │   │ │
-│ │  IR   │ │ │ │Regions│        │ └───────────┘ └────────────────┘ └───────┘ └──────────────┘ │ │   │ │
-│ │       │ │ │ └───────┘        └─────────────────────────────────────────────────────────────┘ │   │ │
-│ │       │ │ │                                                                                  │...│ │
-│ │       │ │ └──────────────────────────────────────────────────────────────────────────────────┘   │ │
-│ │       │ │                                                                                        │ │
-│ └───────┘ └────────────────────────────────────────────────────────────────────────────────────────┘ │
-│                                                                                                      │
-└──────────────────────────────────────────────────────────────────────────────────────────────────────┘
-```
-
-You can specify your own custom pipeline with the `-sbvec-passes=` argument to `opt`.
-The pipeline shown above is equivalent to this:
-
-```shell
-$ opt -p=sandbox-vectorizer -sbvec-passes='seed-collection<tr-save,bottom-up-vec,pack-reuse,tr-accept>' file.ll
-```
-
-If the user does not define a pipeline, the Sandbox Vectorizer will run its default pass-pipeline, which is set in the constructor of the `SandboxVectorizerPass`.
-
-## Sandbox Vectorizer Passes
-
-The passes in the vectorization pipeline can be found in `Transforms/Vectorize/SandboxVectorizer/Passes` and they are registered in `lib/Transforms/Vectorize/SandboxVectorizer/Passes/PassRegistry.def`.
-
-There are two types of passes: [Transformation Passes](#transformation-passes) that do the actual vectorization-related transformations and optimizations, and [Helper Passes](#helper-passes) that are helping with things like managing the IR transactions, and test-specific things like building regions.
-
-### Transformation Passes
-
-|  **Pass Name**            |         **File Name**       | **Type** |                     **Description**                     |
-|---------------------------|-----------------------------|----------|---------------------------------------------------------|
-| `seed-collection`         | SeedCollection.h            | Function | Col...
[truncated]

``````````

</details>


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


More information about the llvm-commits mailing list