Browse Source

Use new pass manager in opt to support clang-16 in cmake build

ignat 1 year ago
parent
commit
30f30da73c

+ 5 - 2
build/plugins/llvm_bc.py

@@ -23,10 +23,13 @@ def onllvm_bc(unit, *args):
             llvm_compile([rel_path, bc_path])
         bcs.append(bc_path)
     unit.onllvm_link([merged_bc] + bcs)
-    opt_opts = ['-O2', '-globalopt', '-globaldce']
+    passes = ['default<O2>', 'globalopt', 'globaldce']
+    opt_opts = []
     if symbols:
+        passes += ['internalize']
         # XXX: '#' used instead of ',' to overcome ymake tendency to split everything by comma
-        opt_opts += ['-internalize', '-internalize-public-api-list=' + '#'.join(symbols)]
+        opt_opts += ['-internalize-public-api-list=' + '#'.join(symbols)]
+    opt_opts += ['-passes={}'.format('${__COMMA__}'.join(passes))]
     unit.onllvm_opt([merged_bc, out_bc] + opt_opts)
     if 'GENERATE_MACHINE_CODE' in kwds:
         unit.onllvm_llc([out_bc, '-O2'])

+ 1 - 4
ydb/library/yql/minikql/codegen/ut/CMakeLists.darwin-arm64.txt

@@ -81,11 +81,8 @@ add_custom_command(
   ${CMAKE_BINARY_DIR}/ydb/library/yql/minikql/codegen/ut/Funcs_merged.bc
   -o
   ${CMAKE_BINARY_DIR}/ydb/library/yql/minikql/codegen/ut/Funcs_optimized.bc
-  -O2
-  -globalopt
-  -globaldce
-  -internalize
   -internalize-public-api-list=fib#sum_sqr#sum_sqr2#sum_sqr_128#sum_sqr_128_ir#str_size
+  -passes=default<O2>,globalopt,globaldce,internalize
 )
 add_custom_command(
   OUTPUT

+ 1 - 4
ydb/library/yql/minikql/codegen/ut/CMakeLists.darwin-x86_64.txt

@@ -82,11 +82,8 @@ add_custom_command(
   ${CMAKE_BINARY_DIR}/ydb/library/yql/minikql/codegen/ut/Funcs_merged.bc
   -o
   ${CMAKE_BINARY_DIR}/ydb/library/yql/minikql/codegen/ut/Funcs_optimized.bc
-  -O2
-  -globalopt
-  -globaldce
-  -internalize
   -internalize-public-api-list=fib#sum_sqr#sum_sqr2#sum_sqr_128#sum_sqr_128_ir#str_size
+  -passes=default<O2>,globalopt,globaldce,internalize
 )
 add_custom_command(
   OUTPUT

+ 1 - 4
ydb/library/yql/minikql/codegen/ut/CMakeLists.linux-aarch64.txt

@@ -85,11 +85,8 @@ add_custom_command(
   ${CMAKE_BINARY_DIR}/ydb/library/yql/minikql/codegen/ut/Funcs_merged.bc
   -o
   ${CMAKE_BINARY_DIR}/ydb/library/yql/minikql/codegen/ut/Funcs_optimized.bc
-  -O2
-  -globalopt
-  -globaldce
-  -internalize
   -internalize-public-api-list=fib#sum_sqr#sum_sqr2#sum_sqr_128#sum_sqr_128_ir#str_size
+  -passes=default<O2>,globalopt,globaldce,internalize
 )
 add_custom_command(
   OUTPUT

+ 1 - 4
ydb/library/yql/minikql/codegen/ut/CMakeLists.linux-x86_64.txt

@@ -86,11 +86,8 @@ add_custom_command(
   ${CMAKE_BINARY_DIR}/ydb/library/yql/minikql/codegen/ut/Funcs_merged.bc
   -o
   ${CMAKE_BINARY_DIR}/ydb/library/yql/minikql/codegen/ut/Funcs_optimized.bc
-  -O2
-  -globalopt
-  -globaldce
-  -internalize
   -internalize-public-api-list=fib#sum_sqr#sum_sqr2#sum_sqr_128#sum_sqr_128_ir#str_size
+  -passes=default<O2>,globalopt,globaldce,internalize
 )
 add_custom_command(
   OUTPUT

+ 1 - 4
ydb/library/yql/minikql/codegen/ut/CMakeLists.windows-x86_64.txt

@@ -75,11 +75,8 @@ add_custom_command(
   ${CMAKE_BINARY_DIR}/ydb/library/yql/minikql/codegen/ut/Funcs_merged.bc
   -o
   ${CMAKE_BINARY_DIR}/ydb/library/yql/minikql/codegen/ut/Funcs_optimized.bc
-  -O2
-  -globalopt
-  -globaldce
-  -internalize
   -internalize-public-api-list=fib#sum_sqr#sum_sqr2#sum_sqr_128#sum_sqr_128_ir#str_size
+  -passes=default<O2>,globalopt,globaldce,internalize
 )
 add_custom_command(
   OUTPUT

+ 1 - 4
ydb/library/yql/providers/yt/codec/codegen/CMakeLists.darwin-arm64.txt

@@ -73,11 +73,8 @@ add_custom_command(
   ${CMAKE_BINARY_DIR}/ydb/library/yql/providers/yt/codec/codegen/YtCodecFuncs_merged.bc
   -o
   ${CMAKE_BINARY_DIR}/ydb/library/yql/providers/yt/codec/codegen/YtCodecFuncs_optimized.bc
-  -O2
-  -globalopt
-  -globaldce
-  -internalize
   -internalize-public-api-list=WriteJust#WriteNothing#WriteBool#Write8#Write16#Write32#Write64#Write120#WriteDecimal32#WriteDecimal64#WriteDecimal128#WriteFloat#WriteDouble#WriteString#ReadBool#ReadInt8#ReadUint8#ReadInt16#ReadUint16#ReadInt32#ReadUint32#ReadInt64#ReadUint64#ReadInt120#ReadDecimal32#ReadDecimal64#ReadDecimal128#ReadFloat#ReadDouble#ReadOptional#ReadVariantData#SkipFixedData#SkipVarData#ReadTzDate#ReadTzDatetime#ReadTzTimestamp#WriteTzDate#WriteTzDatetime#WriteTzTimestamp#GetWrittenBytes#FillZero
+  -passes=default<O2>,globalopt,globaldce,internalize
 )
 add_custom_command(
   OUTPUT

+ 1 - 4
ydb/library/yql/providers/yt/codec/codegen/CMakeLists.darwin-x86_64.txt

@@ -73,11 +73,8 @@ add_custom_command(
   ${CMAKE_BINARY_DIR}/ydb/library/yql/providers/yt/codec/codegen/YtCodecFuncs_merged.bc
   -o
   ${CMAKE_BINARY_DIR}/ydb/library/yql/providers/yt/codec/codegen/YtCodecFuncs_optimized.bc
-  -O2
-  -globalopt
-  -globaldce
-  -internalize
   -internalize-public-api-list=WriteJust#WriteNothing#WriteBool#Write8#Write16#Write32#Write64#Write120#WriteDecimal32#WriteDecimal64#WriteDecimal128#WriteFloat#WriteDouble#WriteString#ReadBool#ReadInt8#ReadUint8#ReadInt16#ReadUint16#ReadInt32#ReadUint32#ReadInt64#ReadUint64#ReadInt120#ReadDecimal32#ReadDecimal64#ReadDecimal128#ReadFloat#ReadDouble#ReadOptional#ReadVariantData#SkipFixedData#SkipVarData#ReadTzDate#ReadTzDatetime#ReadTzTimestamp#WriteTzDate#WriteTzDatetime#WriteTzTimestamp#GetWrittenBytes#FillZero
+  -passes=default<O2>,globalopt,globaldce,internalize
 )
 add_custom_command(
   OUTPUT

+ 1 - 4
ydb/library/yql/providers/yt/codec/codegen/CMakeLists.linux-aarch64.txt

@@ -75,11 +75,8 @@ add_custom_command(
   ${CMAKE_BINARY_DIR}/ydb/library/yql/providers/yt/codec/codegen/YtCodecFuncs_merged.bc
   -o
   ${CMAKE_BINARY_DIR}/ydb/library/yql/providers/yt/codec/codegen/YtCodecFuncs_optimized.bc
-  -O2
-  -globalopt
-  -globaldce
-  -internalize
   -internalize-public-api-list=WriteJust#WriteNothing#WriteBool#Write8#Write16#Write32#Write64#Write120#WriteDecimal32#WriteDecimal64#WriteDecimal128#WriteFloat#WriteDouble#WriteString#ReadBool#ReadInt8#ReadUint8#ReadInt16#ReadUint16#ReadInt32#ReadUint32#ReadInt64#ReadUint64#ReadInt120#ReadDecimal32#ReadDecimal64#ReadDecimal128#ReadFloat#ReadDouble#ReadOptional#ReadVariantData#SkipFixedData#SkipVarData#ReadTzDate#ReadTzDatetime#ReadTzTimestamp#WriteTzDate#WriteTzDatetime#WriteTzTimestamp#GetWrittenBytes#FillZero
+  -passes=default<O2>,globalopt,globaldce,internalize
 )
 add_custom_command(
   OUTPUT

+ 1 - 4
ydb/library/yql/providers/yt/codec/codegen/CMakeLists.linux-x86_64.txt

@@ -75,11 +75,8 @@ add_custom_command(
   ${CMAKE_BINARY_DIR}/ydb/library/yql/providers/yt/codec/codegen/YtCodecFuncs_merged.bc
   -o
   ${CMAKE_BINARY_DIR}/ydb/library/yql/providers/yt/codec/codegen/YtCodecFuncs_optimized.bc
-  -O2
-  -globalopt
-  -globaldce
-  -internalize
   -internalize-public-api-list=WriteJust#WriteNothing#WriteBool#Write8#Write16#Write32#Write64#Write120#WriteDecimal32#WriteDecimal64#WriteDecimal128#WriteFloat#WriteDouble#WriteString#ReadBool#ReadInt8#ReadUint8#ReadInt16#ReadUint16#ReadInt32#ReadUint32#ReadInt64#ReadUint64#ReadInt120#ReadDecimal32#ReadDecimal64#ReadDecimal128#ReadFloat#ReadDouble#ReadOptional#ReadVariantData#SkipFixedData#SkipVarData#ReadTzDate#ReadTzDatetime#ReadTzTimestamp#WriteTzDate#WriteTzDatetime#WriteTzTimestamp#GetWrittenBytes#FillZero
+  -passes=default<O2>,globalopt,globaldce,internalize
 )
 add_custom_command(
   OUTPUT

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