Browse Source

YQL-15941 no_llvm versions of purecalc and embedded (#707)

* init

* build
Vitaly Stoyan 1 year ago
parent
commit
c59860b697

+ 2 - 0
ydb/library/yql/core/extract_predicate/ut/ya.make

@@ -18,6 +18,8 @@ PEERDIR(
     ydb/library/yql/providers/result/provider
     ydb/library/yql/providers/yt/gateway/file
     ydb/library/yql/providers/yt/provider
+    ydb/library/yql/providers/yt/codec/codegen
+    ydb/library/yql/providers/yt/comp_nodes/llvm
     ydb/library/yql/minikql/comp_nodes/llvm
     ydb/library/yql/minikql/invoke_builtins/llvm
     ydb/library/yql/sql/pg

+ 2 - 0
ydb/library/yql/core/ut/ya.make

@@ -28,6 +28,8 @@ PEERDIR(
     ydb/library/yql/providers/result/provider
     ydb/library/yql/providers/yt/gateway/file
     ydb/library/yql/providers/yt/provider
+    ydb/library/yql/providers/yt/codec/codegen
+    ydb/library/yql/providers/yt/comp_nodes/llvm
     ydb/library/yql/minikql/comp_nodes/llvm
     ydb/library/yql/minikql/invoke_builtins/llvm
     ydb/library/yql/sql/pg

+ 4 - 0
ydb/library/yql/minikql/codegen/codegen.cpp

@@ -230,6 +230,10 @@ namespace {
     }
 }
 
+bool ICodegen::IsCodegenAvailable() {
+    return true;
+}
+
 class TCodegen : public ICodegen, private llvm::JITEventListener {
 public:
     TCodegen(ETarget target, ESanitize sanitize)

+ 2 - 0
ydb/library/yql/minikql/codegen/codegen.h

@@ -67,6 +67,8 @@ public:
 
     using TSharedPtr = std::shared_ptr<ICodegen>;
     static TSharedPtr MakeShared(ETarget target, ESanitize sanitize = ESanitize::Auto);
+
+    static bool IsCodegenAvailable();
 };
 
 }

+ 25 - 0
ydb/library/yql/minikql/codegen/no_llvm/codegen_dummy.cpp

@@ -0,0 +1,25 @@
+#include "codegen.h"
+
+#include <util/generic/yexception.h>
+
+namespace NYql {
+namespace NCodegen {
+
+ICodegen::TPtr ICodegen::Make(ETarget target, ESanitize sanitize) {
+    Y_UNUSED(target);
+    Y_UNUSED(sanitize);
+    throw yexception() << "Codegen is not available";
+}
+
+ICodegen::TSharedPtr ICodegen::MakeShared(ETarget target, ESanitize sanitize) {
+    Y_UNUSED(target);
+    Y_UNUSED(sanitize);
+    throw yexception() << "Codegen is not available";
+}
+
+bool ICodegen::IsCodegenAvailable() {
+    return false;
+}
+
+}
+}

+ 17 - 0
ydb/library/yql/minikql/codegen/no_llvm/ya.make

@@ -0,0 +1,17 @@
+LIBRARY()
+
+SRCDIR(
+    ydb/library/yql/minikql/codegen
+)
+
+ADDINCL(
+    ydb/library/yql/minikql/codegen
+)
+
+SRCS(
+    codegen_dummy.cpp
+)
+
+PROVIDES(MINIKQL_CODEGEN)
+
+END()

+ 1 - 1
ydb/library/yql/minikql/codegen/ya.make

@@ -1 +1 @@
-RECURSE(llvm llvm14)
+RECURSE(no_llvm llvm llvm14)

+ 1 - 1
ydb/library/yql/minikql/computation/mkql_computation_node_graph.cpp

@@ -779,7 +779,7 @@ public:
 #elif defined(MKQL_FORCE_USE_CODEGEN)
         : Codegen(NYql::NCodegen::ICodegen::MakeShared(NYql::NCodegen::ETarget::Native))
 #else
-        : Codegen(opts.OptLLVM != "OFF" || GetEnv(TString("MKQL_FORCE_USE_LLVM")) ? NYql::NCodegen::ICodegen::MakeShared(NYql::NCodegen::ETarget::Native) : NYql::NCodegen::ICodegen::TPtr())
+        : Codegen((NYql::NCodegen::ICodegen::IsCodegenAvailable() && opts.OptLLVM != "OFF") || GetEnv(TString("MKQL_FORCE_USE_LLVM")) ? NYql::NCodegen::ICodegen::MakeShared(NYql::NCodegen::ETarget::Native) : NYql::NCodegen::ICodegen::TPtr())
 #endif
     {
     /// TODO: Enable JIT for AARCH64

+ 0 - 16
ydb/library/yql/providers/common/comp_nodes/ya.make

@@ -41,22 +41,6 @@ PEERDIR(
     ydb/library/yql/providers/common/schema/expr
 )
 
-IF (NOT MKQL_DISABLE_CODEGEN)
-    PEERDIR(
-        ydb/library/yql/minikql/codegen/llvm
-        contrib/libs/llvm12/lib/IR
-        contrib/libs/llvm12/lib/ExecutionEngine/MCJIT
-        contrib/libs/llvm12/lib/Linker
-        contrib/libs/llvm12/lib/Target/X86
-        contrib/libs/llvm12/lib/Target/X86/AsmParser
-        contrib/libs/llvm12/lib/Transforms/IPO
-    )
-ELSE()
-    CFLAGS(
-        -DMKQL_DISABLE_CODEGEN
-    )
-ENDIF()
-
 YQL_LAST_ABI_VERSION()
 
 END()

+ 22 - 0
ydb/library/yql/providers/yt/codec/codegen/no_llvm/ya.make

@@ -0,0 +1,22 @@
+LIBRARY()
+
+ADDINCL(
+    ydb/library/yql/providers/yt/codec/codegen
+)
+
+SRCDIR(
+    ydb/library/yql/providers/yt/codec/codegen
+)
+
+SRCS(
+    yt_codec_cg_dummy.cpp
+)
+
+PEERDIR(
+)
+
+PROVIDES(YT_CODEC_CODEGEN)
+
+YQL_LAST_ABI_VERSION()
+
+END()

Some files were not shown because too many files changed in this diff