Bump llvm to 16.x

This commit is contained in:
Robert Schulze 2024-09-16 20:42:15 +00:00
parent da993ad0a3
commit 7929a8bec0
No known key found for this signature in database
GPG Key ID: 26703B55FB13728A
12 changed files with 53 additions and 30 deletions

View File

@ -21,6 +21,7 @@
#include "Poco/Foundation.h"
#include <Poco/Types.h>
#include <array>
namespace Poco
{

View File

@ -1,4 +1,4 @@
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_LIBCPP_DEBUG=0") # More checks in debug build.
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_LIBCPP_DEBUG_MODE=0") # More checks in debug build.
add_subdirectory(contrib/libcxxabi-cmake)
add_subdirectory(contrib/libcxx-cmake)

@ -1 +1 @@
Subproject commit 2a8967b60cbe5bc2df253712bac343cc5263c5fc
Subproject commit 9ce777247865607163e02fe61c84e573b40dd3ed

View File

@ -27,7 +27,7 @@ set (LLVM_INCLUDE_DIRS
set (LLVM_LIBRARY_DIRS "${ClickHouse_BINARY_DIR}/contrib/llvm-project/llvm")
# NOTE: You should not remove this line since otherwise it will use default 20,
# and llvm cannot be compiled with bundled libcxx and 20 standard.
set (CMAKE_CXX_STANDARD 14)
set (CMAKE_CXX_STANDARD 17)
if (ARCH_AMD64)
set (LLVM_TARGETS_TO_BUILD "X86" CACHE INTERNAL "")

2
contrib/rocksdb vendored

@ -1 +1 @@
Subproject commit 5f003e4a22d2e48e37c98d9620241237cd30dd24
Subproject commit 4d479be3591e7855cecebfb894585e04cd9e4245

View File

@ -1,6 +1,7 @@
#pragma once
#include <base/types.h>
#include <functional>
#include <memory>
namespace re2

View File

@ -9,6 +9,7 @@
#include <unordered_map>
#include <unordered_set>
#include <future>
#include <vector>
namespace nuraft
{

View File

@ -696,7 +696,7 @@ void executeQueryWithParallelReplicas(
context, query_ast, storage_id.database_name, storage_id.table_name, /*remote_table_function_ptr*/ nullptr);
auto header = InterpreterSelectQuery(modified_query_ast, context, SelectQueryOptions(processed_stage).analyze()).getSampleBlock();
executeQueryWithParallelReplicas(query_plan, storage_id, header, processed_stage, modified_query_ast, context, storage_limits);
executeQueryWithParallelReplicas(query_plan, storage_id, header, processed_stage, modified_query_ast, context, storage_limits, nullptr);
}
void executeQueryWithParallelReplicasCustomKey(

View File

@ -87,7 +87,7 @@ void executeQueryWithParallelReplicas(
const ASTPtr & query_ast,
ContextPtr context,
std::shared_ptr<const StorageLimitsList> storage_limits,
QueryPlanStepPtr read_from_merge_tree = nullptr);
QueryPlanStepPtr read_from_merge_tree);
void executeQueryWithParallelReplicas(
QueryPlan & query_plan,

View File

@ -6,7 +6,10 @@
#include <boost/noncopyable.hpp>
#include <llvm/Analysis/CGSCCPassManager.h>
#include <llvm/Analysis/TargetTransformInfo.h>
#include <llvm/Analysis/LoopAnalysisManager.h>
#include <llvm/Passes/PassBuilder.h>
#include <llvm/IR/BasicBlock.h>
#include <llvm/IR/DataLayout.h>
#include <llvm/IR/DerivedTypes.h>
@ -486,29 +489,45 @@ std::string CHJIT::getMangledName(const std::string & name_to_mangle) const
void CHJIT::runOptimizationPassesOnModule(llvm::Module & module) const
{
llvm::PassManagerBuilder pass_manager_builder;
llvm::legacy::PassManager mpm;
llvm::legacy::FunctionPassManager fpm(&module);
pass_manager_builder.OptLevel = 3;
pass_manager_builder.SLPVectorize = true;
pass_manager_builder.LoopVectorize = true;
pass_manager_builder.RerollLoops = true;
pass_manager_builder.VerifyInput = true;
pass_manager_builder.VerifyOutput = true;
machine->adjustPassManager(pass_manager_builder);
/// llvm::PassManagerBuilder pass_manager_builder;
/// llvm::legacy::PassManager mpm;
/// llvm::legacy::FunctionPassManager fpm(&module);
/// pass_manager_builder.OptLevel = 3;
/// pass_manager_builder.SLPVectorize = true;
/// pass_manager_builder.LoopVectorize = true;
/// pass_manager_builder.RerollLoops = true;
/// pass_manager_builder.VerifyInput = true;
/// pass_manager_builder.VerifyOutput = true;
/// machine->adjustPassManager(pass_manager_builder);
fpm.add(llvm::createTargetTransformInfoWrapperPass(machine->getTargetIRAnalysis()));
mpm.add(llvm::createTargetTransformInfoWrapperPass(machine->getTargetIRAnalysis()));
/// fpm.add(llvm::createTargetTransformInfoWrapperPass(machine->getTargetIRAnalysis()));
/// mpm.add(llvm::createTargetTransformInfoWrapperPass(machine->getTargetIRAnalysis()));
///
/// pass_manager_builder.populateFunctionPassManager(fpm);
/// pass_manager_builder.populateModulePassManager(mpm);
///
/// fpm.doInitialization();
/// for (auto & function : module)
/// fpm.run(function);
/// fpm.doFinalization();
///
/// mpm.run(module);
pass_manager_builder.populateFunctionPassManager(fpm);
pass_manager_builder.populateModulePassManager(mpm);
llvm::LoopAnalysisManager lam;
llvm::FunctionAnalysisManager fam;
llvm::CGSCCAnalysisManager cgam;
llvm::ModuleAnalysisManager mam;
fpm.doInitialization();
for (auto & function : module)
fpm.run(function);
fpm.doFinalization();
llvm::PassBuilder pb;
mpm.run(module);
pb.registerModuleAnalyses(mam);
pb.registerCGSCCAnalyses(cgam);
pb.registerFunctionAnalyses(fam);
pb.registerLoopAnalyses(lam);
pb.crossRegisterProxies(lam, fam, cgam, mam);
llvm::ModulePassManager mpm = pb.buildPerModuleDefaultPipeline(llvm::OptimizationLevel::O2);
mpm.run(module, mam);
}
std::unique_ptr<llvm::TargetMachine> CHJIT::getTargetMachine()
@ -541,8 +560,8 @@ std::unique_ptr<llvm::TargetMachine> CHJIT::getTargetMachine()
cpu,
features.getString(),
options,
llvm::None,
llvm::None,
std::nullopt,
std::nullopt,
llvm::CodeGenOpt::Aggressive,
jit);

View File

@ -431,7 +431,8 @@ JoinTreeQueryPlan buildQueryPlanForParallelReplicas(
processed_stage,
modified_query_ast,
context,
storage_limits);
storage_limits,
nullptr);
auto converting = ActionsDAG::makeConvertingActions(
header.getColumnsWithTypeAndName(),

View File

@ -838,7 +838,7 @@ void DWARFBlockInputFormat::parseRanges(
uint64_t offset, bool form_rnglistx, const UnitState & unit, const ColumnVector<UInt64>::MutablePtr & col_ranges_start,
const ColumnVector<UInt64>::MutablePtr & col_ranges_end) const
{
llvm::Optional<llvm::object::SectionedAddress> base_addr;
std::optional<llvm::object::SectionedAddress> base_addr;
if (unit.base_address != UINT64_MAX)
base_addr = llvm::object::SectionedAddress{.Address = unit.base_address};
@ -883,7 +883,7 @@ void DWARFBlockInputFormat::parseRanges(
if (err)
throw Exception(ErrorCodes::CANNOT_PARSE_DWARF, "Error parsing .debug_rnglists list: {}", llvm::toString(std::move(err)));
auto lookup_addr = [&](uint32_t idx) -> llvm::Optional<llvm::object::SectionedAddress>
auto lookup_addr = [&](uint32_t idx) -> std::optional<llvm::object::SectionedAddress>
{
uint64_t addr = fetchFromDebugAddr(unit.debug_addr_base, idx);
return llvm::object::SectionedAddress{.Address = addr};