Skip to content
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

Bump clang-tidy to 16 #427

Merged
merged 2 commits into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/clang-tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,4 @@ jobs:
shell: bash
run: |
cd build
python3 ../llvm-project/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py -warnings-as-errors=* -p ./ -config-file ../llvm-project/mlir/.clang-tidy -clang-tidy-binary $(which clang-tidy-15) ${{ env.CHANGED_FILES }}
python3 ../llvm-project/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py -warnings-as-errors=* -p ./ -config-file ../llvm-project/mlir/.clang-tidy -clang-tidy-binary $(which clang-tidy-16) ${{ env.CHANGED_FILES }}
22 changes: 11 additions & 11 deletions legacy/core/src/compiler/codegen/codegen_c.cpp
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
/*******************************************************************************
* Copyright 2020-2023 Intel Corporation
/*
* Copyright (C) 2025 Intel Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*******************************************************************************/
* See the License for the specific language governing permissions
* and limitations under the License.
* SPDX-License-Identifier: Apache-2.0
*/

#include "codegen_c.hpp"
#include "../ir/viewer.hpp"
Expand Down Expand Up @@ -1219,9 +1220,8 @@ void c_generator_pass_t::operator()(func_t f) {
c_generator_pass_t::c_generator_pass_t(std::ostream &source,
const context_ptr &ctx, bool gen_wrapper,
c_generator_optional_out_t *optional_out)
: source_(source), context_(ctx),
gen_wrapper_(gen_wrapper), pre_passes_{get_default_precodegen_passes(
ctx, gen_wrapper)},
: source_(source), context_(ctx), gen_wrapper_(gen_wrapper),
pre_passes_{get_default_precodegen_passes(ctx, gen_wrapper)},
optional_out_(optional_out) {
prepare_include(&source_);
if (optional_out_) {
Expand Down
19 changes: 10 additions & 9 deletions legacy/core/src/compiler/codegen/llvm/intrinsic_impl.cpp
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
/*******************************************************************************
* Copyright 2023-2024 Intel Corporation
/*
* Copyright (C) 2025 Intel Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*******************************************************************************/
* See the License for the specific language governing permissions
* and limitations under the License.
* SPDX-License-Identifier: Apache-2.0
*/
#include <algorithm>
#include <fstream>
#include <memory>
Expand Down Expand Up @@ -74,7 +75,7 @@ Value *codegen_llvm_vis_t::make_int_min_max(const intrin_call_c &v, bool ismin,
Value *codegen_llvm_vis_t::make_int_min_max(Value *v1, Value *v2, bool ismin,
type_category cate) {
// fix-me: use smax/smin for newer LLVM
llvm::Value *(llvm::IRBuilder<>::*ptr)(llvm::Value * LHS, llvm::Value * RHS,
llvm::Value *(llvm::IRBuilder<>::*ptr)(llvm::Value *LHS, llvm::Value *RHS,
const llvm::Twine &Name);
if (ismin) {
if (cate == CATE_INT) {
Expand Down
17 changes: 9 additions & 8 deletions legacy/core/src/compiler/ir/graph/anchor_loop_generator.cpp
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
/*******************************************************************************
* Copyright 2023 Intel Corporation
/*
* Copyright (C) 2025 Intel Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*******************************************************************************/
* See the License for the specific language governing permissions
* and limitations under the License.
* SPDX-License-Identifier: Apache-2.0
*/

#include "anchor_loop_generator.hpp"
#include "fusible_op_utils.hpp"
Expand Down
19 changes: 10 additions & 9 deletions legacy/core/src/compiler/ir/graph/anchor_loop_generator.hpp
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
/*******************************************************************************
* Copyright 2023 Intel Corporation
/*
* Copyright (C) 2025 Intel Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*******************************************************************************/
* See the License for the specific language governing permissions
* and limitations under the License.
* SPDX-License-Identifier: Apache-2.0
*/

#ifndef GRAPH_BACKEND_GRAPH_COMPILER_CORE_SRC_COMPILER_IR_GRAPH_ANCHOR_LOOP_GENERATOR_HPP
#define GRAPH_BACKEND_GRAPH_COMPILER_CORE_SRC_COMPILER_IR_GRAPH_ANCHOR_LOOP_GENERATOR_HPP
Expand Down Expand Up @@ -54,7 +55,7 @@ class anchor_loop_generator_t : public body_generator_base_t {
const std::shared_ptr<fusion_anchor_t> &parent_fanchor) const;

void schedule_loops(context_ptr ctx, const void *config, stmt body,
std::vector<for_loop> &fors) const override{};
std::vector<for_loop> &fors) const override {};
float get_gflop() const override { return 0; }
};

Expand Down
21 changes: 12 additions & 9 deletions legacy/core/src/compiler/ir/graph/graph_map.hpp
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
/*******************************************************************************
* Copyright 2022-2023 Intel Corporation
/*
* Copyright (C) 2025 Intel Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*******************************************************************************/
* See the License for the specific language governing permissions
* and limitations under the License.
* SPDX-License-Identifier: Apache-2.0
*/

#ifndef GRAPH_BACKEND_GRAPH_COMPILER_CORE_SRC_COMPILER_IR_GRAPH_GRAPH_MAP_HPP
#define GRAPH_BACKEND_GRAPH_COMPILER_CORE_SRC_COMPILER_IR_GRAPH_GRAPH_MAP_HPP
Expand All @@ -26,7 +27,9 @@ namespace impl {
namespace graph {
namespace gc {

template <typename T> struct is_vector { static constexpr bool value = false; };
template <typename T> struct is_vector {
static constexpr bool value = false;
};

template <typename T, typename Alloc> struct is_vector<std::vector<T, Alloc>> {
static constexpr bool value = true;
Expand Down
19 changes: 10 additions & 9 deletions legacy/core/src/compiler/ir/graph/graph_op.hpp
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
/*******************************************************************************
* Copyright 2020-2023 Intel Corporation
/*
* Copyright (C) 2025 Intel Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*******************************************************************************/
* See the License for the specific language governing permissions
* and limitations under the License.
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef GRAPH_BACKEND_GRAPH_COMPILER_CORE_SRC_COMPILER_IR_GRAPH_GRAPH_OP_HPP
#define GRAPH_BACKEND_GRAPH_COMPILER_CORE_SRC_COMPILER_IR_GRAPH_GRAPH_OP_HPP

Expand Down Expand Up @@ -48,7 +49,7 @@ class graph_op_t : public sc_op {
void query_format(
context_ptr ctx,
std::vector<std::vector<format_stride_pair>> &supported_ins,
std::vector<std::vector<format_stride_pair>> &supported_outs) override{};
std::vector<std::vector<format_stride_pair>> &supported_outs) override {};

// the param graph is created by upper function and passed to this function.
// It should be an empty graph and already synced with external graph.
Expand Down
23 changes: 12 additions & 11 deletions legacy/core/src/compiler/ir/graph/mixed_partition.cpp
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
/*******************************************************************************
* Copyright 2022-2024 Intel Corporation
/*
* Copyright (C) 2025 Intel Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*******************************************************************************/
* See the License for the specific language governing permissions
* and limitations under the License.
* SPDX-License-Identifier: Apache-2.0
*/

#include "mixed_partition.hpp"
#include "binding_axis.hpp"
Expand Down Expand Up @@ -1849,8 +1850,8 @@ static bool try_merge_mixed_parti_parallel(mixed_parti_t *A, mixed_parti_t *B) {

auto append_parti = (dep == parti_dep::l_dep_r) ? A : B,
target_parti = (dep == parti_dep::l_dep_r) ? B : A;
SC_MODULE_INFO << "Start try_merge_mixed_parti_parallel: "
<< "Target: " << target_parti->func_->name_
SC_MODULE_INFO << "Start try_merge_mixed_parti_parallel: " << "Target: "
<< target_parti->func_->name_
<< ", Append: " << append_parti->func_->name_;

auto outer_loops_target = target_parti->get_outer_loops(),
Expand Down Expand Up @@ -4028,7 +4029,7 @@ static void
crossover_dispatcher(const std::vector<mixed_parti_t::ptr> &parti_vec,
parti_merge_kind merge_kind) {
// select merger by merge kind
bool (*merger)(mixed_parti_t * A, mixed_parti_t * B);
bool (*merger)(mixed_parti_t *A, mixed_parti_t *B);
switch (merge_kind) {
case parti_merge_kind::vertical: {
merger = try_merge_mixed_parti_vertically;
Expand Down
19 changes: 10 additions & 9 deletions legacy/core/src/compiler/ir/intrinsics.hpp
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
/*******************************************************************************
* Copyright 2020-2024 Intel Corporation
/*
* Copyright (C) 2025 Intel Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*******************************************************************************/
* See the License for the specific language governing permissions
* and limitations under the License.
* SPDX-License-Identifier: Apache-2.0
*/

#ifndef GRAPH_BACKEND_GRAPH_COMPILER_CORE_SRC_COMPILER_IR_INTRINSICS_HPP
#define GRAPH_BACKEND_GRAPH_COMPILER_CORE_SRC_COMPILER_IR_INTRINSICS_HPP
Expand All @@ -38,7 +39,7 @@ struct intrinsic_handler_t {
};

struct x86_intrinsic_handler_t : public intrinsic_handler_t {
virtual void on_initialize(intrin_call_node &node){};
virtual void on_initialize(intrin_call_node &node) {};
virtual void on_initialize(low_level_intrin_node &node) = 0;
x86_intrinsic_handler_t(const std::string &name);
virtual ~x86_intrinsic_handler_t() = default;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
/*******************************************************************************
* Copyright 2023-2024 Intel Corporation
/*
* Copyright (C) 2025 Intel Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*******************************************************************************/
* See the License for the specific language governing permissions
* and limitations under the License.
* SPDX-License-Identifier: Apache-2.0
*/

#include "dynamic_parallel_transform.hpp"
#include <algorithm>
Expand Down Expand Up @@ -123,8 +124,8 @@ struct parallel_for_scope_t {
bool is_start, uint64_t tid_step,
const std::vector<expr_c> *parent_iters,
const expr_c &cur_iter)
: loop_{loop},
nested_level_{nested_level}, is_start_{is_start}, tid_step_{tid_step} {
: loop_{loop}, nested_level_{nested_level}, is_start_{is_start},
tid_step_{tid_step} {
if (parent_iters) {
iters_ = *parent_iters;
if (cur_iter.defined()) {
Expand Down
Loading
Loading