[llvm] 8dfeb4e - Revert "[SandboxIR][NFC] Delete SandboxIR.h (#110309)"
Vasileios Porpodas via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 27 12:54:04 PDT 2024
Author: Vasileios Porpodas
Date: 2024-09-27T12:53:25-07:00
New Revision: 8dfeb4ef5d60a5c764f0ce249cc4ec69e012ff93
URL: https://github.com/llvm/llvm-project/commit/8dfeb4ef5d60a5c764f0ce249cc4ec69e012ff93
DIFF: https://github.com/llvm/llvm-project/commit/8dfeb4ef5d60a5c764f0ce249cc4ec69e012ff93.diff
LOG: Revert "[SandboxIR][NFC] Delete SandboxIR.h (#110309)"
This reverts commit ca47f48a5c9e81ef8b5c4a5b1fbc473ea5d5497c.
Added:
llvm/include/llvm/SandboxIR/SandboxIR.h
Modified:
llvm/include/llvm/SandboxIR/Constant.h
llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Interval.h
llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Legality.h
llvm/lib/SandboxIR/Module.cpp
llvm/lib/SandboxIR/PassManager.cpp
llvm/lib/SandboxIR/SandboxIR.cpp
llvm/lib/SandboxIR/Type.cpp
llvm/lib/SandboxIR/Value.cpp
llvm/lib/Transforms/Vectorize/SandboxVectorizer/SandboxVectorizer.cpp
llvm/unittests/SandboxIR/PassTest.cpp
llvm/unittests/SandboxIR/RegionTest.cpp
llvm/unittests/SandboxIR/SandboxIRTest.cpp
llvm/unittests/SandboxIR/TypesTest.cpp
llvm/unittests/SandboxIR/UtilsTest.cpp
llvm/unittests/Transforms/Vectorize/SandboxVectorizer/DependencyGraphTest.cpp
llvm/unittests/Transforms/Vectorize/SandboxVectorizer/IntervalTest.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/SandboxIR/Constant.h b/llvm/include/llvm/SandboxIR/Constant.h
index e35d23be6619fe..a8cc66ba9d6540 100644
--- a/llvm/include/llvm/SandboxIR/Constant.h
+++ b/llvm/include/llvm/SandboxIR/Constant.h
@@ -18,7 +18,6 @@
#include "llvm/IR/GlobalValue.h"
#include "llvm/IR/GlobalVariable.h"
#include "llvm/SandboxIR/Argument.h"
-#include "llvm/SandboxIR/BasicBlock.h"
#include "llvm/SandboxIR/Context.h"
#include "llvm/SandboxIR/Type.h"
#include "llvm/SandboxIR/User.h"
diff --git a/llvm/include/llvm/SandboxIR/SandboxIR.h b/llvm/include/llvm/SandboxIR/SandboxIR.h
new file mode 100644
index 00000000000000..85fa7ad8e40640
--- /dev/null
+++ b/llvm/include/llvm/SandboxIR/SandboxIR.h
@@ -0,0 +1,198 @@
+//===- SandboxIR.h ----------------------------------------------*- C++ -*-===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+//
+// Sandbox IR is a lightweight overlay transactional IR on top of LLVM IR.
+// Features:
+// - You can save/rollback the state of the IR at any time.
+// - Any changes made to Sandbox IR will automatically update the underlying
+// LLVM IR so both IRs are always in sync.
+// - Feels like LLVM IR, similar API.
+//
+// SandboxIR forms a class hierarchy that resembles that of LLVM IR
+// but is in the `sandboxir` namespace:
+//
+// namespace sandboxir {
+//
+// Value -+- Argument
+// |
+// +- BasicBlock
+// |
+// +- User ------+- Constant ------ Function
+// |
+// +- Instruction -+- BinaryOperator
+// |
+// +- BranchInst
+// |
+// +- CastInst --------+- AddrSpaceCastInst
+// | |
+// | +- BitCastInst
+// | |
+// | +- FPExtInst
+// | |
+// | +- FPToSIInst
+// | |
+// | +- FPToUIInst
+// | |
+// | +- FPTruncInst
+// | |
+// | +- IntToPtrInst
+// | |
+// | +- PtrToIntInst
+// | |
+// | +- SExtInst
+// | |
+// | +- SIToFPInst
+// | |
+// | +- TruncInst
+// | |
+// | +- UIToFPInst
+// | |
+// | +- ZExtInst
+// |
+// +- CallBase --------+- CallBrInst
+// | |
+// | +- CallInst
+// | |
+// | +- InvokeInst
+// |
+// +- CmpInst ---------+- ICmpInst
+// | |
+// | +- FCmpInst
+// |
+// +- ExtractElementInst
+// |
+// +- GetElementPtrInst
+// |
+// +- InsertElementInst
+// |
+// +- OpaqueInst
+// |
+// +- PHINode
+// |
+// +- ReturnInst
+// |
+// +- SelectInst
+// |
+// +- ShuffleVectorInst
+// |
+// +- ExtractValueInst
+// |
+// +- InsertValueInst
+// |
+// +- StoreInst
+// |
+// +- UnaryInstruction -+- LoadInst
+// | |
+// | +- CastInst
+// |
+// +- UnaryOperator
+// |
+// +- UnreachableInst
+//
+// Use
+//
+// } // namespace sandboxir
+//
+
+#ifndef LLVM_SANDBOXIR_SANDBOXIR_H
+#define LLVM_SANDBOXIR_SANDBOXIR_H
+
+#include "llvm/IR/Function.h"
+#include "llvm/IR/IRBuilder.h"
+#include "llvm/IR/Instruction.h"
+#include "llvm/IR/IntrinsicInst.h"
+#include "llvm/IR/PatternMatch.h"
+#include "llvm/IR/User.h"
+#include "llvm/IR/Value.h"
+#include "llvm/SandboxIR/Argument.h"
+#include "llvm/SandboxIR/BasicBlock.h"
+#include "llvm/SandboxIR/Constant.h"
+#include "llvm/SandboxIR/Context.h"
+#include "llvm/SandboxIR/Module.h"
+#include "llvm/SandboxIR/Tracker.h"
+#include "llvm/SandboxIR/Type.h"
+#include "llvm/SandboxIR/Use.h"
+#include "llvm/SandboxIR/User.h"
+#include "llvm/SandboxIR/Value.h"
+#include "llvm/Support/raw_ostream.h"
+#include <iterator>
+
+namespace llvm {
+
+namespace sandboxir {
+
+class BasicBlock;
+class ConstantInt;
+class ConstantFP;
+class ConstantAggregateZero;
+class ConstantPointerNull;
+class PoisonValue;
+class BlockAddress;
+class DSOLocalEquivalent;
+class ConstantTokenNone;
+class GlobalValue;
+class GlobalObject;
+class GlobalIFunc;
+class GlobalVariable;
+class GlobalAlias;
+class NoCFIValue;
+class ConstantPtrAuth;
+class ConstantExpr;
+class Context;
+class Function;
+class Module;
+class Instruction;
+class VAArgInst;
+class FreezeInst;
+class FenceInst;
+class SelectInst;
+class ExtractElementInst;
+class InsertElementInst;
+class ShuffleVectorInst;
+class ExtractValueInst;
+class InsertValueInst;
+class BranchInst;
+class UnaryInstruction;
+class LoadInst;
+class ReturnInst;
+class StoreInst;
+class User;
+class UnreachableInst;
+class Value;
+class CallBase;
+class CallInst;
+class InvokeInst;
+class CallBrInst;
+class LandingPadInst;
+class FuncletPadInst;
+class CatchPadInst;
+class CleanupPadInst;
+class CatchReturnInst;
+class CleanupReturnInst;
+class GetElementPtrInst;
+class CastInst;
+class PossiblyNonNegInst;
+class PtrToIntInst;
+class BitCastInst;
+class AllocaInst;
+class ResumeInst;
+class CatchSwitchInst;
+class SwitchInst;
+class UnaryOperator;
+class BinaryOperator;
+class PossiblyDisjointInst;
+class AtomicRMWInst;
+class AtomicCmpXchgInst;
+class CmpInst;
+class ICmpInst;
+class FCmpInst;
+
+} // namespace sandboxir
+} // namespace llvm
+
+#endif // LLVM_SANDBOXIR_SANDBOXIR_H
diff --git a/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Interval.h b/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Interval.h
index d088c6c556f3a8..5c40d1eb28c7a6 100644
--- a/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Interval.h
+++ b/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Interval.h
@@ -20,7 +20,7 @@
#ifndef LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_INSTRINTERVAL_H
#define LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_INSTRINTERVAL_H
-#include "llvm/ADT/ArrayRef.h"
+#include "llvm/SandboxIR/SandboxIR.h"
#include <iterator>
namespace llvm::sandboxir {
diff --git a/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Legality.h b/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Legality.h
index 50fa56c5b21940..78c1c0e4c04649 100644
--- a/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Legality.h
+++ b/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Legality.h
@@ -12,12 +12,11 @@
#ifndef LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_LEGALITY_H
#define LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_LEGALITY_H
-#include "llvm/ADT/ArrayRef.h"
+#include "llvm/SandboxIR/SandboxIR.h"
namespace llvm::sandboxir {
class LegalityAnalysis;
-class Value;
enum class LegalityResultID {
Widen, ///> Vectorize by combining scalars to a vector.
diff --git a/llvm/lib/SandboxIR/Module.cpp b/llvm/lib/SandboxIR/Module.cpp
index a6a5fb2aae8a10..7510f621556d41 100644
--- a/llvm/lib/SandboxIR/Module.cpp
+++ b/llvm/lib/SandboxIR/Module.cpp
@@ -7,9 +7,7 @@
//===----------------------------------------------------------------------===//
#include "llvm/SandboxIR/Module.h"
-#include "llvm/SandboxIR/Constant.h"
-#include "llvm/SandboxIR/Context.h"
-#include "llvm/SandboxIR/Value.h"
+#include "llvm/SandboxIR/SandboxIR.h"
using namespace llvm::sandboxir;
diff --git a/llvm/lib/SandboxIR/PassManager.cpp b/llvm/lib/SandboxIR/PassManager.cpp
index 4168420a01ce2f..4abd39b28e87a0 100644
--- a/llvm/lib/SandboxIR/PassManager.cpp
+++ b/llvm/lib/SandboxIR/PassManager.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
#include "llvm/SandboxIR/PassManager.h"
+#include "llvm/SandboxIR/SandboxIR.h"
using namespace llvm::sandboxir;
diff --git a/llvm/lib/SandboxIR/SandboxIR.cpp b/llvm/lib/SandboxIR/SandboxIR.cpp
index 89575da2578db7..63f65bfc88544b 100644
--- a/llvm/lib/SandboxIR/SandboxIR.cpp
+++ b/llvm/lib/SandboxIR/SandboxIR.cpp
@@ -6,13 +6,12 @@
//
//===----------------------------------------------------------------------===//
+#include "llvm/SandboxIR/SandboxIR.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/IR/Constants.h"
#include "llvm/SandboxIR/Argument.h"
#include "llvm/SandboxIR/BasicBlock.h"
-#include "llvm/SandboxIR/Context.h"
-#include "llvm/SandboxIR/User.h"
#include "llvm/Support/Debug.h"
#include <sstream>
diff --git a/llvm/lib/SandboxIR/Type.cpp b/llvm/lib/SandboxIR/Type.cpp
index 7bb788ecf25a64..87dcb726dde351 100644
--- a/llvm/lib/SandboxIR/Type.cpp
+++ b/llvm/lib/SandboxIR/Type.cpp
@@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//
#include "llvm/SandboxIR/Type.h"
-#include "llvm/SandboxIR/Context.h"
+#include "llvm/SandboxIR/SandboxIR.h"
using namespace llvm::sandboxir;
diff --git a/llvm/lib/SandboxIR/Value.cpp b/llvm/lib/SandboxIR/Value.cpp
index b9d91c7e11f747..40cf14c7e9b6f0 100644
--- a/llvm/lib/SandboxIR/Value.cpp
+++ b/llvm/lib/SandboxIR/Value.cpp
@@ -8,7 +8,7 @@
#include "llvm/SandboxIR/Value.h"
#include "llvm/SandboxIR/Context.h"
-#include "llvm/SandboxIR/User.h"
+#include "llvm/SandboxIR/SandboxIR.h"
#include <sstream>
namespace llvm::sandboxir {
diff --git a/llvm/lib/Transforms/Vectorize/SandboxVectorizer/SandboxVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SandboxVectorizer/SandboxVectorizer.cpp
index 80afcb499a2c22..161d300e6e9f2e 100644
--- a/llvm/lib/Transforms/Vectorize/SandboxVectorizer/SandboxVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SandboxVectorizer/SandboxVectorizer.cpp
@@ -8,8 +8,8 @@
#include "llvm/Transforms/Vectorize/SandboxVectorizer/SandboxVectorizer.h"
#include "llvm/Analysis/TargetTransformInfo.h"
-#include "llvm/SandboxIR/Constant.h"
#include "llvm/SandboxIR/PassManager.h"
+#include "llvm/SandboxIR/SandboxIR.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Transforms/Vectorize/SandboxVectorizer/Passes/BottomUpVec.h"
diff --git a/llvm/unittests/SandboxIR/PassTest.cpp b/llvm/unittests/SandboxIR/PassTest.cpp
index 9cd54352735dcb..2eaf369caf084b 100644
--- a/llvm/unittests/SandboxIR/PassTest.cpp
+++ b/llvm/unittests/SandboxIR/PassTest.cpp
@@ -9,9 +9,8 @@
#include "llvm/SandboxIR/Pass.h"
#include "llvm/AsmParser/Parser.h"
#include "llvm/IR/Module.h"
-#include "llvm/SandboxIR/Constant.h"
-#include "llvm/SandboxIR/Context.h"
#include "llvm/SandboxIR/PassManager.h"
+#include "llvm/SandboxIR/SandboxIR.h"
#include "llvm/Support/SourceMgr.h"
#include "gtest/gtest.h"
diff --git a/llvm/unittests/SandboxIR/RegionTest.cpp b/llvm/unittests/SandboxIR/RegionTest.cpp
index f1bb535d9c50e5..dc4dad8fed71c8 100644
--- a/llvm/unittests/SandboxIR/RegionTest.cpp
+++ b/llvm/unittests/SandboxIR/RegionTest.cpp
@@ -8,9 +8,7 @@
#include "llvm/SandboxIR/Region.h"
#include "llvm/AsmParser/Parser.h"
-#include "llvm/SandboxIR/Constant.h"
-#include "llvm/SandboxIR/Context.h"
-#include "llvm/SandboxIR/Instruction.h"
+#include "llvm/SandboxIR/SandboxIR.h"
#include "llvm/Support/SourceMgr.h"
#include "gmock/gmock-matchers.h"
#include "gtest/gtest.h"
diff --git a/llvm/unittests/SandboxIR/SandboxIRTest.cpp b/llvm/unittests/SandboxIR/SandboxIRTest.cpp
index 66a5191b1154b6..964b81fead67e4 100644
--- a/llvm/unittests/SandboxIR/SandboxIRTest.cpp
+++ b/llvm/unittests/SandboxIR/SandboxIRTest.cpp
@@ -6,6 +6,7 @@
//
//===----------------------------------------------------------------------===//
+#include "llvm/SandboxIR/SandboxIR.h"
#include "llvm/AsmParser/Parser.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/Constants.h"
@@ -13,12 +14,7 @@
#include "llvm/IR/Function.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/Module.h"
-#include "llvm/SandboxIR/BasicBlock.h"
-#include "llvm/SandboxIR/Constant.h"
-#include "llvm/SandboxIR/Instruction.h"
-#include "llvm/SandboxIR/Module.h"
#include "llvm/SandboxIR/Utils.h"
-#include "llvm/SandboxIR/Value.h"
#include "llvm/Support/SourceMgr.h"
#include "gmock/gmock-matchers.h"
#include "gtest/gtest.h"
diff --git a/llvm/unittests/SandboxIR/TypesTest.cpp b/llvm/unittests/SandboxIR/TypesTest.cpp
index 9bf02c97948eb0..40aa32fb08ed01 100644
--- a/llvm/unittests/SandboxIR/TypesTest.cpp
+++ b/llvm/unittests/SandboxIR/TypesTest.cpp
@@ -14,8 +14,7 @@
#include "llvm/IR/Function.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/Module.h"
-#include "llvm/SandboxIR/Constant.h"
-#include "llvm/SandboxIR/Context.h"
+#include "llvm/SandboxIR/SandboxIR.h"
#include "llvm/Support/SourceMgr.h"
#include "gtest/gtest.h"
diff --git a/llvm/unittests/SandboxIR/UtilsTest.cpp b/llvm/unittests/SandboxIR/UtilsTest.cpp
index 18d62d95d24333..ded3edf1206a4b 100644
--- a/llvm/unittests/SandboxIR/UtilsTest.cpp
+++ b/llvm/unittests/SandboxIR/UtilsTest.cpp
@@ -13,8 +13,7 @@
#include "llvm/IR/Function.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/Module.h"
-#include "llvm/SandboxIR/Constant.h"
-#include "llvm/SandboxIR/Context.h"
+#include "llvm/SandboxIR/SandboxIR.h"
#include "llvm/Support/SourceMgr.h"
#include "gtest/gtest.h"
diff --git a/llvm/unittests/Transforms/Vectorize/SandboxVectorizer/DependencyGraphTest.cpp b/llvm/unittests/Transforms/Vectorize/SandboxVectorizer/DependencyGraphTest.cpp
index 329d3617a31fa1..f6bfd097f20a4e 100644
--- a/llvm/unittests/Transforms/Vectorize/SandboxVectorizer/DependencyGraphTest.cpp
+++ b/llvm/unittests/Transforms/Vectorize/SandboxVectorizer/DependencyGraphTest.cpp
@@ -8,9 +8,7 @@
#include "llvm/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.h"
#include "llvm/AsmParser/Parser.h"
-#include "llvm/SandboxIR/Constant.h"
-#include "llvm/SandboxIR/Context.h"
-#include "llvm/SandboxIR/Instruction.h"
+#include "llvm/SandboxIR/SandboxIR.h"
#include "llvm/Support/SourceMgr.h"
#include "gmock/gmock-matchers.h"
#include "gtest/gtest.h"
diff --git a/llvm/unittests/Transforms/Vectorize/SandboxVectorizer/IntervalTest.cpp b/llvm/unittests/Transforms/Vectorize/SandboxVectorizer/IntervalTest.cpp
index 0b2411151a9653..bd4d27ece10019 100644
--- a/llvm/unittests/Transforms/Vectorize/SandboxVectorizer/IntervalTest.cpp
+++ b/llvm/unittests/Transforms/Vectorize/SandboxVectorizer/IntervalTest.cpp
@@ -8,8 +8,6 @@
#include "llvm/Transforms/Vectorize/SandboxVectorizer/Interval.h"
#include "llvm/AsmParser/Parser.h"
-#include "llvm/SandboxIR/Constant.h"
-#include "llvm/SandboxIR/Context.h"
#include "llvm/SandboxIR/Instruction.h"
#include "llvm/Support/SourceMgr.h"
#include "gtest/gtest.h"
More information about the llvm-commits
mailing list