-
Notifications
You must be signed in to change notification settings - Fork 10.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DirectX] Rename DXILOperationCommon.h to DXILABI.h. NFC #78224
Merged
bogner
merged 2 commits into
main
from
users/bogner/sprdirectx-rename-dxiloperationcommonh-to-dxilabih-nfc
Jan 29, 2024
Merged
[DirectX] Rename DXILOperationCommon.h to DXILABI.h. NFC #78224
bogner
merged 2 commits into
main
from
users/bogner/sprdirectx-rename-dxiloperationcommonh-to-dxilabih-nfc
Jan 29, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Created using spr 1.3.5-bogner
@llvm/pr-subscribers-backend-directx @llvm/pr-subscribers-llvm-support Author: Justin Bogner (bogner) ChangesThis is a good place to put all of the ABI-sensitive DXIL values that Full diff: https://github.com/llvm/llvm-project/pull/78224.diff 4 Files Affected:
diff --git a/llvm/include/llvm/Support/DXILABI.h b/llvm/include/llvm/Support/DXILABI.h
new file mode 100644
index 00000000000000..e2a8fbad16bb3f
--- /dev/null
+++ b/llvm/include/llvm/Support/DXILABI.h
@@ -0,0 +1,45 @@
+//===-- DXILABI.h - ABI Sensitive Values for DXIL ---------------*- 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
+//
+//===----------------------------------------------------------------------===//
+//
+// This file contains definitions of various constants and enums that are
+// required to remain stable as per the DXIL format's requirements.
+//
+// Documentation for DXIL can be found in
+// https://github.com/Microsoft/DirectXShaderCompiler/blob/main/docs/DXIL.rst.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_SUPPORT_DXILABI_H
+#define LLVM_SUPPORT_DXILABI_H
+
+#include "llvm/ADT/StringSwitch.h"
+
+namespace llvm {
+namespace dxil {
+
+enum class ParameterKind : uint8_t {
+ INVALID = 0,
+ VOID,
+ HALF,
+ FLOAT,
+ DOUBLE,
+ I1,
+ I8,
+ I16,
+ I32,
+ I64,
+ OVERLOAD,
+ CBUFFER_RET,
+ RESOURCE_RET,
+ DXIL_HANDLE,
+};
+
+} // namespace dxil
+} // namespace llvm
+
+#endif // LLVM_SUPPORT_DXILABI_H
diff --git a/llvm/include/llvm/Support/DXILOperationCommon.h b/llvm/include/llvm/Support/DXILOperationCommon.h
deleted file mode 100644
index 134f92710b6264..00000000000000
--- a/llvm/include/llvm/Support/DXILOperationCommon.h
+++ /dev/null
@@ -1,63 +0,0 @@
-//===-- DXILOperationCommon.h - DXIL Operation ------------------*- 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
-//
-//===----------------------------------------------------------------------===//
-//
-// This file is created to share common definitions used by both the
-// DXILOpBuilder and the table
-// generator.
-// Documentation for DXIL can be found in
-// https://github.com/Microsoft/DirectXShaderCompiler/blob/main/docs/DXIL.rst.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SUPPORT_DXILOPERATIONCOMMON_H
-#define LLVM_SUPPORT_DXILOPERATIONCOMMON_H
-
-#include "llvm/ADT/StringSwitch.h"
-
-namespace llvm {
-namespace dxil {
-
-enum class ParameterKind : uint8_t {
- INVALID = 0,
- VOID,
- HALF,
- FLOAT,
- DOUBLE,
- I1,
- I8,
- I16,
- I32,
- I64,
- OVERLOAD,
- CBUFFER_RET,
- RESOURCE_RET,
- DXIL_HANDLE,
-};
-
-inline ParameterKind parameterTypeNameToKind(StringRef Name) {
- return StringSwitch<ParameterKind>(Name)
- .Case("void", ParameterKind::VOID)
- .Case("half", ParameterKind::HALF)
- .Case("float", ParameterKind::FLOAT)
- .Case("double", ParameterKind::DOUBLE)
- .Case("i1", ParameterKind::I1)
- .Case("i8", ParameterKind::I8)
- .Case("i16", ParameterKind::I16)
- .Case("i32", ParameterKind::I32)
- .Case("i64", ParameterKind::I64)
- .Case("$o", ParameterKind::OVERLOAD)
- .Case("dx.types.Handle", ParameterKind::DXIL_HANDLE)
- .Case("dx.types.CBufRet", ParameterKind::CBUFFER_RET)
- .Case("dx.types.ResRet", ParameterKind::RESOURCE_RET)
- .Default(ParameterKind::INVALID);
-}
-
-} // namespace dxil
-} // namespace llvm
-
-#endif
diff --git a/llvm/lib/Target/DirectX/DXILOpBuilder.cpp b/llvm/lib/Target/DirectX/DXILOpBuilder.cpp
index 59fe6d45757aad..42180a865b72e3 100644
--- a/llvm/lib/Target/DirectX/DXILOpBuilder.cpp
+++ b/llvm/lib/Target/DirectX/DXILOpBuilder.cpp
@@ -13,7 +13,7 @@
#include "DXILConstants.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/Module.h"
-#include "llvm/Support/DXILOperationCommon.h"
+#include "llvm/Support/DXILABI.h"
#include "llvm/Support/ErrorHandling.h"
using namespace llvm;
diff --git a/llvm/utils/TableGen/DXILEmitter.cpp b/llvm/utils/TableGen/DXILEmitter.cpp
index a199463961be41..ddc7cfb8134470 100644
--- a/llvm/utils/TableGen/DXILEmitter.cpp
+++ b/llvm/utils/TableGen/DXILEmitter.cpp
@@ -16,7 +16,7 @@
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringSet.h"
#include "llvm/ADT/StringSwitch.h"
-#include "llvm/Support/DXILOperationCommon.h"
+#include "llvm/Support/DXILABI.h"
#include "llvm/TableGen/Record.h"
#include "llvm/TableGen/TableGenBackend.h"
@@ -103,6 +103,24 @@ struct DXILOperationData {
};
} // end anonymous namespace
+static ParameterKind parameterTypeNameToKind(StringRef Name) {
+ return StringSwitch<ParameterKind>(Name)
+ .Case("void", ParameterKind::VOID)
+ .Case("half", ParameterKind::HALF)
+ .Case("float", ParameterKind::FLOAT)
+ .Case("double", ParameterKind::DOUBLE)
+ .Case("i1", ParameterKind::I1)
+ .Case("i8", ParameterKind::I8)
+ .Case("i16", ParameterKind::I16)
+ .Case("i32", ParameterKind::I32)
+ .Case("i64", ParameterKind::I64)
+ .Case("$o", ParameterKind::OVERLOAD)
+ .Case("dx.types.Handle", ParameterKind::DXIL_HANDLE)
+ .Case("dx.types.CBufRet", ParameterKind::CBUFFER_RET)
+ .Case("dx.types.ResRet", ParameterKind::RESOURCE_RET)
+ .Default(ParameterKind::INVALID);
+}
+
DXILParam::DXILParam(const Record *R) {
Name = R->getValueAsString("name");
Pos = R->getValueAsInt("pos");
|
llvm-beanz
approved these changes
Jan 29, 2024
bogner
deleted the
users/bogner/sprdirectx-rename-dxiloperationcommonh-to-dxilabih-nfc
branch
January 29, 2024 17:19
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a good place to put all of the ABI-sensitive DXIL values that
we'll need in both reading and writing contexts.