diff options
author | samliu <yaxun.liu@amd.com> | 2015-09-03 23:48:55 -0400 |
---|---|---|
committer | samliu <yaxun.liu@amd.com> | 2015-09-03 23:48:55 -0400 |
commit | 8f2472564a2fa8fbcd3d642db920468228bcecdc (patch) | |
tree | b232f6289dec8e999dcc837fa17b8a4e17c97501 /tools | |
parent | d81eb976c125d8a7a3e92b338bf996db210a2b46 (diff) |
[SPIRV] Fix asserts due to ReplaceAllReferencesWith dst/src type mismatch in SPIR loader when lowering islessgreater for double16 type args.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/llvm-spirv/llvm-spirv.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/llvm-spirv/llvm-spirv.cpp b/tools/llvm-spirv/llvm-spirv.cpp index 0dd03f5..b73bf6e 100644 --- a/tools/llvm-spirv/llvm-spirv.cpp +++ b/tools/llvm-spirv/llvm-spirv.cpp @@ -55,6 +55,11 @@ #include "llvm/Support/FileSystem.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Support/ToolOutputFile.h"
+
+#ifndef _SPRV_SUPPORT_TEXT_FMT
+#define _SPRV_SUPPORT_TEXT_FMT
+#endif
+
#include "SPIRV.h"
#include <memory>
@@ -85,12 +90,14 @@ static cl::opt<bool> IsRegularization("s", cl::desc(
"Regularize LLVM to be representable by SPIR-V"));
+#ifdef _SPRV_SUPPORT_TEXT_FMT
static cl::opt<bool>
ToText("to-text", cl::desc("Convert input SPIR-V binary to internal textual format"));
static cl::opt<bool>
ToBinary("to-binary",
cl::desc("Convert input SPIR-V in internal textual format to binary"));
+#endif
static std::string
removeExt(const std::string& FileName) {
@@ -182,6 +189,7 @@ convertSPRVToLLVM() { return 0;
}
+#ifdef _SPRV_SUPPORT_TEXT_FMT
static int
convertSPRV() {
if (ToBinary == ToText) {
@@ -213,6 +221,7 @@ convertSPRV() { } else
return Action(std::cout);
}
+#endif
static int
regularizeLLVM() {
@@ -269,6 +278,7 @@ int main(int ac, char** av) {
cl::ParseCommandLineOptions(ac, av, "LLVM/SPIR-V translator");
+#ifdef _SPRV_SUPPORT_TEXT_FMT
if (ToText && (ToBinary || IsReverse || IsRegularization)) {
errs() << "Cannot use -to-text with -to-binary, -r, -s\n";
return -1;
@@ -281,6 +291,7 @@ main(int ac, char** av) { if (ToBinary || ToText)
return convertSPRV();
+#endif
if (!IsReverse && !IsRegularization)
return convertLLVMToSPRV();
|