Skip to content

Commit 20ddfe8

Browse files
authored
[dxil2spv] Remove dxil2spv prototype (#4512)
Revert "[dxil2spv] Print missing runtime errors (#4481)" This reverts commit 7f8f9ac. Revert "[dxil2spv] Command line parsing and output file (#4454)" This reverts commit 2e49e68. Revert "[dxil2spv] Add additional error checking (#4440)" This reverts commit 3c1918e. Revert "[dxil2spv] Add FileCheck testing (#4431)" This reverts commit d6cec44. Revert "[dxil2spv] Translate DXIL constants to SPIR-V (#4426)" This reverts commit f00b3c2. Revert "[dxil2spv] Translate SV_Position to BuiltIn::Position (#4423)" This reverts commit b292f94. Revert "[dxil2spv] Translate extractValue and bufferStore (#4404)" This reverts commit 1d2a68f. Revert "[dxil2spv] Translate createHandle and bufferLoad (#4389)" This reverts commit 316b849. Revert "[dxil2spv] Support shl instruction (#4388)" This reverts commit 1039a87. Revert "[dxil2spv] Fix build warning (#4371)" This reverts commit 7ecebb3. Revert "[dxil2spv] Add support for dx.op.threadId (#4354)" This reverts commit c248a1e. Revert "[dxil2spv] Add initial compute shader support (#4345)" This reverts commit c701ece. Revert "[dxil2spv] Add error checking to file tests (#4344)" This reverts commit 9f70135. Revert "[dxil2spv] Add passthrough vertex shader and test (#4337)" This reverts commit c99f5a5. Revert "[dxil2spv] SPIR-V validation and related fixes (#4328)" This reverts commit 4958718. Revert "[dxil2spv] Implement simple entry function creation (#4323)" This reverts commit c29a0c7. Revert "[dxil2spv] Read file directly into llvm::MemoryBuffer (#4304)" This reverts commit aa26bfd. Revert "[dxil2spv] Add stage IO variables (#4271)" This reverts commit 2d5f186. Revert "[dxil2spv] Add CompilerInstance object (#4229)" This reverts commit e4cf486. Revert "[dxil2spv] Add initial testing (#4222)" This reverts commit c3a61b1. Revert "[dxil2spv] Construct minimal SPIR-V module (#4216)" This reverts commit e3da12e. Revert "[dxil2spv] Add basic dxil2spv CI test (#4209)" This reverts commit 57d4d2b. Revert "Add initial dxil2spv executable (#4199)" This reverts commit c45db48.
1 parent facd14f commit 20ddfe8

45 files changed

Lines changed: 129 additions & 2894 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,6 @@ endif()
136136
if (${ENABLE_SPIRV_CODEGEN})
137137
add_definitions(-DENABLE_SPIRV_CODEGEN)
138138
endif()
139-
140-
# Building dxil2spv off by default while it's in early development.
141-
option(ENABLE_DXIL2SPV "Enables DXIL to SPIR-V translation." OFF)
142139
# SPIRV change ends
143140

144141
include(VersionFromVCS)

appveyor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ before_build:
4040
build_script:
4141
- cmd: call utils\hct\hctbuild -%PLATFORM% -%CONFIGURATION% -show-cmake-log -spirvtest
4242
- sh: mkdir build && cd build
43-
- sh: cmake .. -GNinja -C ../cmake/caches/PredefinedParams.cmake -DSPIRV_BUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_CXX_FLAGS=-Werror -DENABLE_DXIL2SPV=ON
43+
- sh: cmake .. -GNinja -C ../cmake/caches/PredefinedParams.cmake -DSPIRV_BUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_CXX_FLAGS=-Werror
4444
- sh: ninja
4545

4646
test_script:
@@ -52,7 +52,6 @@ test_script:
5252
- sh: ./bin/dxc -T ps_6_0 -Fo passthru-ps.spv ../tools/clang/test/CodeGenSPIRV/passthru-ps.hlsl2spv -spirv
5353
- sh: ./bin/clang-spirv-tests --spirv-test-root ../tools/clang/test/CodeGenSPIRV/
5454
- sh: ./bin/clang-hlsl-tests --HlslDataDir $PWD/../tools/clang/test/HLSL/
55-
- sh: ./bin/dxil2spv ../tools/clang/test/Dxil2Spv/passthru-ps.ll
5655

5756
after_test:
5857
# Collect artifacts for Windows
@@ -73,3 +72,4 @@ notifications:
7372
on_build_success: true
7473
on_build_failure: true
7574
on_build_status_changed: true
75+

include/dxc/Test/DxcTestUtils.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,6 @@ class FileRunCommandPart {
126126
FileRunCommandResult RunTee(const FileRunCommandResult *Prior);
127127
FileRunCommandResult RunXFail(const FileRunCommandResult *Prior);
128128
FileRunCommandResult RunDxilVer(dxc::DxcDllSupport& DllSupport, const FileRunCommandResult* Prior);
129-
#ifdef ENABLE_DXIL2SPV
130-
FileRunCommandResult RunDxil2Spv(dxc::DxcDllSupport &DllSupport,
131-
const FileRunCommandResult *Prior);
132-
#endif
133129
FileRunCommandResult RunDxcHashTest(dxc::DxcDllSupport &DllSupport);
134130
FileRunCommandResult RunFromPath(const std::string &path, const FileRunCommandResult *Prior);
135131
FileRunCommandResult RunFileCompareText(const FileRunCommandResult *Prior);

tools/clang/include/clang/SPIRV/SpirvBuilder.h

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ class SpirvBuilder {
5252
public:
5353
SpirvBuilder(ASTContext &ac, SpirvContext &c, const SpirvCodeGenOptions &,
5454
FeatureManager &featureMgr);
55-
SpirvBuilder(SpirvContext &c, const SpirvCodeGenOptions &,
56-
FeatureManager &featureMgr);
5755
~SpirvBuilder() = default;
5856

5957
// Forbid copy construction and assignment
@@ -74,9 +72,6 @@ class SpirvBuilder {
7472
SpirvFunction *createSpirvFunction(QualType returnType, SourceLocation,
7573
llvm::StringRef name, bool isPrecise,
7674
bool isNoInline = false);
77-
SpirvFunction *createSpirvFunction(const SpirvType *returnType,
78-
SourceLocation, llvm::StringRef name,
79-
bool isPrecise, bool isNoInline = false);
8075

8176
/// \brief Begins building a SPIR-V function by allocating a SpirvFunction
8277
/// object. Returns the pointer for the function on success. Returns nullptr
@@ -87,10 +82,6 @@ class SpirvBuilder {
8782
llvm::StringRef name = "",
8883
bool isPrecise = false, bool isNoInline = false,
8984
SpirvFunction *func = nullptr);
90-
SpirvFunction *beginFunction(const SpirvType *returnType, SourceLocation,
91-
llvm::StringRef name = "",
92-
bool isPrecise = false, bool isNoInline = false,
93-
SpirvFunction *func = nullptr);
9485

9586
/// \brief Creates and registers a function parameter of the given pointer
9687
/// type in the current function and returns its pointer.
@@ -105,9 +96,6 @@ class SpirvBuilder {
10596
SpirvVariable *addFnVar(QualType valueType, SourceLocation,
10697
llvm::StringRef name = "", bool isPrecise = false,
10798
SpirvInstruction *init = nullptr);
108-
SpirvVariable *addFnVar(const spirv::SpirvType *valueType, SourceLocation,
109-
llvm::StringRef name = "", bool isPrecise = false,
110-
SpirvInstruction *init = nullptr);
11199

112100
/// \brief Ends building of the current function. All basic blocks constructed
113101
/// from the beginning or after ending the previous function will be collected
@@ -238,9 +226,6 @@ class SpirvBuilder {
238226
SpirvBinaryOp *createBinaryOp(spv::Op op, QualType resultType,
239227
SpirvInstruction *lhs, SpirvInstruction *rhs,
240228
SourceLocation loc, SourceRange range = {});
241-
SpirvBinaryOp *createBinaryOp(spv::Op op, const SpirvType *resultType,
242-
SpirvInstruction *lhs, SpirvInstruction *rhs,
243-
SourceLocation loc, SourceRange range = {});
244229

245230
SpirvSpecConstantBinaryOp *createSpecConstantBinaryOp(spv::Op op,
246231
QualType resultType,
@@ -620,10 +605,6 @@ class SpirvBuilder {
620605
SpirvVariable *addStageIOVar(QualType type, spv::StorageClass storageClass,
621606
llvm::StringRef name, bool isPrecise,
622607
SourceLocation loc);
623-
SpirvVariable *addStageIOVar(const SpirvType *type,
624-
spv::StorageClass storageClass,
625-
llvm::StringRef name, bool isPrecise,
626-
SourceLocation loc);
627608

628609
/// \brief Adds a stage builtin variable whose value is of the given type.
629610
///
@@ -633,10 +614,6 @@ class SpirvBuilder {
633614
spv::StorageClass storageClass,
634615
spv::BuiltIn, bool isPrecise,
635616
SourceLocation loc);
636-
SpirvVariable *addStageBuiltinVar(const SpirvType *type,
637-
spv::StorageClass storageClass,
638-
spv::BuiltIn, bool isPrecise,
639-
SourceLocation loc);
640617

641618
/// \brief Adds a module variable. This variable should not have the Function
642619
/// storage class.
@@ -741,12 +718,8 @@ class SpirvBuilder {
741718
/// and add the context to the list of constants in the module.
742719
SpirvConstant *getConstantInt(QualType type, llvm::APInt value,
743720
bool specConst = false);
744-
SpirvConstant *getConstantInt(const SpirvType *type, llvm::APInt value,
745-
bool specConst = false);
746721
SpirvConstant *getConstantFloat(QualType type, llvm::APFloat value,
747722
bool specConst = false);
748-
SpirvConstant *getConstantFloat(const SpirvType *type, llvm::APFloat value,
749-
bool specConst = false);
750723
SpirvConstant *getConstantBool(bool value, bool specConst = false);
751724
SpirvConstant *
752725
getConstantComposite(QualType compositeType,
@@ -763,7 +736,6 @@ class SpirvBuilder {
763736

764737
public:
765738
std::vector<uint32_t> takeModule();
766-
std::vector<uint32_t> takeModuleForDxilToSpv();
767739

768740
protected:
769741
/// Only friend classes are allowed to add capability/extension to the module
@@ -824,7 +796,7 @@ class SpirvBuilder {
824796
SpirvInstruction *var);
825797

826798
private:
827-
ASTContext *astContext;
799+
ASTContext &astContext;
828800
SpirvContext &context; ///< From which we allocate various SPIR-V object
829801
FeatureManager &featureManager;
830802

tools/clang/include/clang/SPIRV/SpirvFunction.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ class SpirvFunction {
2727
SpirvFunction(QualType astReturnType, SourceLocation,
2828
llvm::StringRef name = "", bool precise = false,
2929
bool noInline = false);
30-
SpirvFunction(const SpirvType *spirvReturnType, SourceLocation,
31-
llvm::StringRef name = "", bool precise = false,
32-
bool noInline = false);
3330

3431
~SpirvFunction();
3532

tools/clang/include/clang/SPIRV/SpirvInstruction.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,6 @@ class SpirvInstruction {
222222
// Forbid creating SpirvInstruction directly
223223
SpirvInstruction(Kind kind, spv::Op opcode, QualType astResultType,
224224
SourceLocation loc, SourceRange range = {});
225-
SpirvInstruction(Kind kind, spv::Op opcode, const SpirvType *resultType,
226-
SourceLocation loc, SourceRange range = {});
227225

228226
protected:
229227
const Kind kind;
@@ -1021,9 +1019,6 @@ class SpirvBinaryOp : public SpirvInstruction {
10211019
SpirvBinaryOp(spv::Op opcode, QualType resultType, SourceLocation loc,
10221020
SpirvInstruction *op1, SpirvInstruction *op2,
10231021
SourceRange range = {});
1024-
SpirvBinaryOp(spv::Op opcode, const SpirvType *resultType, SourceLocation loc,
1025-
SpirvInstruction *op1, SpirvInstruction *op2,
1026-
SourceRange range = {});
10271022

10281023
DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvBinaryOp)
10291024

@@ -1157,8 +1152,6 @@ class SpirvConstantInteger : public SpirvConstant {
11571152
public:
11581153
SpirvConstantInteger(QualType type, llvm::APInt value,
11591154
bool isSpecConst = false);
1160-
SpirvConstantInteger(const SpirvType *type, llvm::APInt value,
1161-
bool isSpecConst = false);
11621155

11631156
DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvConstantInteger)
11641157

@@ -1181,8 +1174,6 @@ class SpirvConstantFloat : public SpirvConstant {
11811174
public:
11821175
SpirvConstantFloat(QualType type, llvm::APFloat value,
11831176
bool isSpecConst = false);
1184-
SpirvConstantFloat(const SpirvType *type, llvm::APFloat value,
1185-
bool isSpecConst = false);
11861177

11871178
DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvConstantFloat)
11881179

tools/clang/include/clang/SPIRV/SpirvUtils.h

Lines changed: 0 additions & 39 deletions
This file was deleted.

tools/clang/lib/SPIRV/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ add_clang_library(clangSPIRV
1616
InitListHandler.cpp
1717
LiteralTypeVisitor.cpp
1818
LowerTypeVisitor.cpp
19-
SpirvTypeVisitor.cpp
2019
SortDebugInfoVisitor.cpp
2120
NonUniformVisitor.cpp
2221
PreciseVisitor.cpp
@@ -33,7 +32,6 @@ add_clang_library(clangSPIRV
3332
SpirvType.cpp
3433
SignaturePackingUtil.cpp
3534
String.cpp
36-
SpirvUtils.cpp
3735

3836
LINK_LIBS
3937
clangAST

tools/clang/lib/SPIRV/EmitVisitor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ void EmitVisitor::emitDebugLine(spv::Op op, const SourceLocation &loc,
319319
}
320320

321321
auto fileId = debugMainFileId;
322-
const auto &sm = astContext->getSourceManager();
322+
const auto &sm = astContext.getSourceManager();
323323
const char *fileName = sm.getPresumedLoc(loc).getFilename();
324324
if (fileName)
325325
fileId = getOrCreateOpStringId(fileName);

tools/clang/lib/SPIRV/EmitVisitor.h

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class EmitTypeHandler {
4646
};
4747

4848
public:
49-
EmitTypeHandler(ASTContext *astCtx, SpirvContext &spvContext,
49+
EmitTypeHandler(ASTContext &astCtx, SpirvContext &spvContext,
5050
const SpirvCodeGenOptions &opts, FeatureManager &featureMgr,
5151
std::vector<uint32_t> *debugVec,
5252
std::vector<uint32_t> *decVec,
@@ -145,13 +145,13 @@ class EmitTypeHandler {
145145
template <unsigned N>
146146
DiagnosticBuilder emitError(const char (&message)[N],
147147
SourceLocation loc = {}) {
148-
const auto diagId = astContext->getDiagnostics().getCustomDiagID(
148+
const auto diagId = astContext.getDiagnostics().getCustomDiagID(
149149
clang::DiagnosticsEngine::Error, message);
150-
return astContext->getDiagnostics().Report(loc, diagId);
150+
return astContext.getDiagnostics().Report(loc, diagId);
151151
}
152152

153153
private:
154-
ASTContext *astContext;
154+
ASTContext &astContext;
155155
SpirvContext &context;
156156
FeatureManager featureManager;
157157
std::vector<uint32_t> curTypeInst;
@@ -198,10 +198,9 @@ class EmitVisitor : public Visitor {
198198
};
199199

200200
public:
201-
EmitVisitor(ASTContext *astCtx, SpirvContext &spvCtx,
201+
EmitVisitor(ASTContext &astCtx, SpirvContext &spvCtx,
202202
const SpirvCodeGenOptions &opts, FeatureManager &featureMgr)
203-
: Visitor(opts, spvCtx), astContext(astCtx), featureManager(featureMgr),
204-
id(0),
203+
: Visitor(opts, spvCtx), astContext(astCtx), featureManager(featureMgr), id(0),
205204
typeHandler(astCtx, spvCtx, opts, featureMgr, &debugVariableBinary,
206205
&annotationsBinary, &typeConstantBinary,
207206
[this]() -> uint32_t { return takeNextId(); }),
@@ -396,14 +395,14 @@ class EmitVisitor : public Visitor {
396395
template <unsigned N>
397396
DiagnosticBuilder emitError(const char (&message)[N],
398397
SourceLocation loc = {}) {
399-
const auto diagId = astContext->getDiagnostics().getCustomDiagID(
398+
const auto diagId = astContext.getDiagnostics().getCustomDiagID(
400399
clang::DiagnosticsEngine::Error, message);
401-
return astContext->getDiagnostics().Report(loc, diagId);
400+
return astContext.getDiagnostics().Report(loc, diagId);
402401
}
403402

404403
private:
405404
// Object that holds Clang AST nodes.
406-
ASTContext *astContext;
405+
ASTContext &astContext;
407406
// Feature manager.
408407
FeatureManager featureManager;
409408
// The last result-id that's been used so far.

0 commit comments

Comments
 (0)