This is an automated email from the ASF dual-hosted git repository. tqchen pushed a commit to branch task791-remove-clangflags in repository https://gitbox.apache.org/repos/asf/tvm.git
commit acfc1ca0b0edf43bc730693b0fde86601505a955 Author: tqchen <[email protected]> AuthorDate: Mon Oct 19 15:20:41 2026 +0000 [REFACTOR][TIRx] Remove Clang warning overrides Use the normal compiler warning flags for the TIRx compiler and runtime. Remove unused workspace-pool and tensor-layout fields while preserving constructor signatures and target lookup behavior. --- tirx/CMakeLists.txt | 1 - tirx/cmake/modules/ClangFlags.cmake | 90 ------------------------- tirx/src/runtime/workspace_pool.cc | 4 +- tirx/src/runtime/workspace_pool.h | 2 - tirx/src/tirx/transform/lower_tensor_layouts.cc | 5 +- 5 files changed, 4 insertions(+), 98 deletions(-) diff --git a/tirx/CMakeLists.txt b/tirx/CMakeLists.txt index c2c31594f8..c328f02c71 100644 --- a/tirx/CMakeLists.txt +++ b/tirx/CMakeLists.txt @@ -243,7 +243,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND NOT "${TVM_TIRX_USE_LLVM}" MATCHES ${I target_link_options(tvm_tirx_compiler PRIVATE "-Wl,--no-relax" "-Wl,--as-needed") endif() include(cmake/modules/Logging.cmake) -include(cmake/modules/ClangFlags.cmake) # ######### Library configuration ########## diff --git a/tirx/cmake/modules/ClangFlags.cmake b/tirx/cmake/modules/ClangFlags.cmake deleted file mode 100644 index b8a6cddb60..0000000000 --- a/tirx/cmake/modules/ClangFlags.cmake +++ /dev/null @@ -1,90 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you 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 -# -# 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. - -# If we are running clang >= 10.0 then enable more checking. Some of these warnings may not exist -# in older versions of clang so we limit the use of older clang for these checks. -if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - EXECUTE_PROCESS(COMMAND ${CMAKE_CXX_COMPILER} --version OUTPUT_VARIABLE clang_full_version) - string (REGEX REPLACE ".*clang version ([0-9]+\\.[0-9]+).*" "\\1" CLANG_VERSION ${clang_full_version}) - message(STATUS "CLANG_VERSION ${CLANG_VERSION}") - # CMake 3.2 does not support VERSION_GREATER_EQUAL - set(CLANG_MINIMUM_VERSION 10.0) - if ((CLANG_VERSION VERSION_GREATER ${CLANG_MINIMUM_VERSION}) - OR - (CLANG_VERSION VERSION_GREATER ${CLANG_MINIMUM_VERSION})) - message(STATUS "Setting enhanced clang warning flags") - - set(warning_opts - # These warnings are only enabled when clang's -Weverything flag is enabled - # but there is no harm in turning them off for all cases. - -Wno-c++98-compat - -Wno-c++98-compat-extra-semi - -Wno-c++98-compat-pedantic - -Wno-padded - -Wno-extra-semi - -Wno-extra-semi-stmt - -Wno-unused-parameter - -Wno-sign-conversion - -Wno-weak-vtables - -Wno-deprecated-copy-dtor - -Wno-global-constructors - -Wno-double-promotion - -Wno-float-equal - -Wno-missing-prototypes - -Wno-implicit-int-float-conversion - -Wno-implicit-float-conversion - -Wno-implicit-int-conversion - -Wno-float-conversion - -Wno-shorten-64-to-32 - -Wno-covered-switch-default - -Wno-unused-exception-parameter - -Wno-return-std-move - -Wno-over-aligned - -Wno-undef - -Wno-inconsistent-missing-destructor-override - -Wno-unreachable-code - -Wno-deprecated-copy - -Wno-implicit-fallthrough - -Wno-unreachable-code-return - -Wno-non-virtual-dtor - # Here we have non-standard warnings that clang has available and are useful - # so enable them if we are using clang. - -Wreserved-id-macro - -Wused-but-marked-unused - -Wdocumentation-unknown-command - -Wcast-qual - -Wzero-as-null-pointer-constant - # These warnings should be enabled one at a time and fixed. - # To enable one of these warnings remove the `no-` after -W so - # -Wno-documentation -> -Wdocumentation - -Wno-documentation - -Wno-shadow-uncaptured-local - -Wno-shadow-field-in-constructor - -Wno-shadow - -Wno-shadow-field - -Wno-exit-time-destructors - -Wno-switch-enum - -Wno-old-style-cast - -Wno-gnu-anonymous-struct - -Wno-nested-anon-types - ) - target_compile_options(tvm_tirx_compiler_objs PRIVATE $<$<COMPILE_LANGUAGE:CXX>: ${warning_opts}>) - target_compile_options(tvm_runtime_objs PRIVATE $<$<COMPILE_LANGUAGE:CXX>: ${warning_opts}>) - - - endif () -endif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") diff --git a/tirx/src/runtime/workspace_pool.cc b/tirx/src/runtime/workspace_pool.cc index 1549d3cbef..5a8ca2176c 100644 --- a/tirx/src/runtime/workspace_pool.cc +++ b/tirx/src/runtime/workspace_pool.cc @@ -146,8 +146,8 @@ class WorkspacePool::Pool { std::vector<Entry> allocated_; }; -WorkspacePool::WorkspacePool(DLDeviceType device_type, DeviceAPI* device, Allocator alloc) - : device_type_(device_type), device_(device), alloc_(alloc) {} +WorkspacePool::WorkspacePool(DLDeviceType, DeviceAPI* device, Allocator alloc) + : device_(device), alloc_(alloc) {} WorkspacePool::~WorkspacePool() { for (auto& streams : array_) { diff --git a/tirx/src/runtime/workspace_pool.h b/tirx/src/runtime/workspace_pool.h index f72e0089af..e57d089759 100644 --- a/tirx/src/runtime/workspace_pool.h +++ b/tirx/src/runtime/workspace_pool.h @@ -75,8 +75,6 @@ class TVM_RUNTIME_DLL WorkspacePool { class Pool; /*! \brief pool of device local array */ std::vector<std::unordered_map<TVMStreamHandle, Pool*>> array_; - /*! \brief device type this pool support */ - DLDeviceType device_type_; /*! \brief The device API */ DeviceAPI* device_; Allocator alloc_; diff --git a/tirx/src/tirx/transform/lower_tensor_layouts.cc b/tirx/src/tirx/transform/lower_tensor_layouts.cc index 8f55b07f57..32fdb59cdf 100644 --- a/tirx/src/tirx/transform/lower_tensor_layouts.cc +++ b/tirx/src/tirx/transform/lower_tensor_layouts.cc @@ -87,8 +87,8 @@ class LayoutApplier : public StmtExprMutatorWithAnalyzer { } public: - explicit LayoutApplier(const sym::Analyzer& analyzer, const Target& target) - : StmtExprMutatorWithAnalyzer(analyzer), target_(target) {} + explicit LayoutApplier(const sym::Analyzer& analyzer, const Target&) + : StmtExprMutatorWithAnalyzer(analyzer) {} protected: ffi::Any VisitAny(const ffi::Any& any) { @@ -371,7 +371,6 @@ class LayoutApplier : public StmtExprMutatorWithAnalyzer { /*! \brief Physical roots of tensor aliases, flattened at each declaration. */ ffi::Map<Var, Var> tensor_aliases_; - const Target& target_; }; namespace {
