Skip to content
This repository was archived by the owner on Sep 15, 2025. It is now read-only.

Commit 4b28d14

Browse files
SC llvm teamSC llvm team
authored andcommitted
Merged main:79af7bdd4e41 into amd-gfx:4096badd6dbc
Local branch amd-gfx 4096bad Merged main:16d19aaedf34 into amd-gfx:9ca74663be2c Remote branch main 79af7bd [mlir][tosa] Add `AllElementTypesMatch` trait for `tosa.transpose` (llvm#120964)
2 parents 4096bad + 79af7bd commit 4b28d14

File tree

12 files changed

+47
-31
lines changed

12 files changed

+47
-31
lines changed

clang-tools-extra/clang-tidy/ClangTidyCheck.cpp

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
//===----------------------------------------------------------------------===//
88

99
#include "ClangTidyCheck.h"
10-
#include "llvm/ADT/SmallString.h"
1110
#include "llvm/ADT/StringRef.h"
12-
#include "llvm/Support/Error.h"
11+
#include "llvm/ADT/StringSet.h"
1312
#include "llvm/Support/YAMLParser.h"
1413
#include <optional>
14+
#include <string>
1515

1616
namespace clang::tidy {
1717

@@ -62,16 +62,29 @@ ClangTidyCheck::OptionsView::get(StringRef LocalName) const {
6262
return std::nullopt;
6363
}
6464

65+
static const llvm::StringSet<> DeprecatedGlobalOptions{
66+
"StrictMode",
67+
"IgnoreMacros",
68+
};
69+
6570
static ClangTidyOptions::OptionMap::const_iterator
6671
findPriorityOption(const ClangTidyOptions::OptionMap &Options,
6772
StringRef NamePrefix, StringRef LocalName,
68-
llvm::StringSet<> *Collector) {
73+
ClangTidyContext *Context) {
74+
llvm::StringSet<> *Collector = Context->getOptionsCollector();
6975
if (Collector) {
7076
Collector->insert((NamePrefix + LocalName).str());
7177
Collector->insert(LocalName);
7278
}
7379
auto IterLocal = Options.find((NamePrefix + LocalName).str());
7480
auto IterGlobal = Options.find(LocalName);
81+
// FIXME: temporary solution for deprecation warnings, should be removed
82+
// after 22.x. Warn configuration deps on deprecation global options.
83+
if (IterLocal == Options.end() && IterGlobal != Options.end() &&
84+
DeprecatedGlobalOptions.contains(LocalName))
85+
Context->configurationDiag(
86+
"global option '%0' is deprecated, please use '%1%0' instead.")
87+
<< LocalName << NamePrefix;
7588
if (IterLocal == Options.end())
7689
return IterGlobal;
7790
if (IterGlobal == Options.end())
@@ -83,8 +96,7 @@ findPriorityOption(const ClangTidyOptions::OptionMap &Options,
8396

8497
std::optional<StringRef>
8598
ClangTidyCheck::OptionsView::getLocalOrGlobal(StringRef LocalName) const {
86-
auto Iter = findPriorityOption(CheckOptions, NamePrefix, LocalName,
87-
Context->getOptionsCollector());
99+
auto Iter = findPriorityOption(CheckOptions, NamePrefix, LocalName, Context);
88100
if (Iter != CheckOptions.end())
89101
return StringRef(Iter->getValue().Value);
90102
return std::nullopt;
@@ -117,8 +129,7 @@ ClangTidyCheck::OptionsView::get<bool>(StringRef LocalName) const {
117129
template <>
118130
std::optional<bool>
119131
ClangTidyCheck::OptionsView::getLocalOrGlobal<bool>(StringRef LocalName) const {
120-
auto Iter = findPriorityOption(CheckOptions, NamePrefix, LocalName,
121-
Context->getOptionsCollector());
132+
auto Iter = findPriorityOption(CheckOptions, NamePrefix, LocalName, Context);
122133
if (Iter != CheckOptions.end()) {
123134
if (auto Result = getAsBool(Iter->getValue().Value, Iter->getKey()))
124135
return Result;
@@ -157,10 +168,9 @@ std::optional<int64_t> ClangTidyCheck::OptionsView::getEnumInt(
157168
bool IgnoreCase) const {
158169
if (!CheckGlobal && Context->getOptionsCollector())
159170
Context->getOptionsCollector()->insert((NamePrefix + LocalName).str());
160-
auto Iter = CheckGlobal
161-
? findPriorityOption(CheckOptions, NamePrefix, LocalName,
162-
Context->getOptionsCollector())
163-
: CheckOptions.find((NamePrefix + LocalName).str());
171+
auto Iter = CheckGlobal ? findPriorityOption(CheckOptions, NamePrefix,
172+
LocalName, Context)
173+
: CheckOptions.find((NamePrefix + LocalName).str());
164174
if (Iter == CheckOptions.end())
165175
return std::nullopt;
166176

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ Improvements to clang-tidy
119119

120120
- Removed :program:`clang-tidy`'s global options for most of checks. All options
121121
are changed to local options except `IncludeStyle`, `StrictMode` and
122-
`IgnoreMacros`.
122+
`IgnoreMacros`. Global scoped `StrictMode` and `IgnoreMacros` are deprecated
123+
and will be removed in further releases.
123124

124125
.. csv-table::
125126
:header: "Check", "Options removed from global option"

clang-tools-extra/test/clang-tidy/checkers/modernize/use-std-format-fmt.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %check_clang_tidy %s modernize-use-std-format %t -- \
22
// RUN: -config="{CheckOptions: { \
3-
// RUN: StrictMode: true, \
3+
// RUN: modernize-use-std-format.StrictMode: true, \
44
// RUN: modernize-use-std-format.StrFormatLikeFunctions: 'fmt::sprintf', \
55
// RUN: modernize-use-std-format.ReplacementFormatFunction: 'fmt::format', \
66
// RUN: modernize-use-std-format.FormatHeader: '<fmt/core.h>' \
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// RUN: clang-tidy %s --config="{CheckOptions:{StrictMode: true}}" -checks="-*,modernize-use-std-format" | FileCheck %s
2+
3+
// CHECK: warning: global option 'StrictMode' is deprecated, please use 'modernize-use-std-format.StrictMode' instead. [clang-tidy-config]

clang/include/clang/Basic/DiagnosticDriverKinds.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def err_drv_no_cuda_libdevice : Error<
6767
"libdevice">;
6868

6969
def err_drv_no_rocm_device_lib : Error<
70-
"cannot find ROCm device library%select{| for %1|for ABI version %1}0; provide its path via "
70+
"cannot find ROCm device library%select{| for %1| for ABI version %1}0; provide its path via "
7171
"'--rocm-path' or '--rocm-device-lib-path', or pass '-nogpulib' to build "
7272
"without ROCm device library">;
7373
def err_drv_no_hip_runtime : Error<

clang/test/Driver/hip-device-libs.hip

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,5 +253,5 @@
253253
// NOABI4-NOT: error:
254254
// NOABI4-NOT: "-mlink-builtin-bitcode" "{{.*}}oclc_abi_version_400.bc"
255255
// NOABI4-NOT: "-mlink-builtin-bitcode" "{{.*}}oclc_abi_version_500.bc"
256-
// NOABI5: error: cannot find ROCm device libraryfor ABI version 5; provide its path via '--rocm-path' or '--rocm-device-lib-path', or pass '-nogpulib' to build without ROCm device library
257-
// NOABI6: error: cannot find ROCm device libraryfor ABI version 6; provide its path via '--rocm-path' or '--rocm-device-lib-path', or pass '-nogpulib' to build without ROCm device library
256+
// NOABI5: error: cannot find ROCm device library for ABI version 5; provide its path via '--rocm-path' or '--rocm-device-lib-path', or pass '-nogpulib' to build without ROCm device library
257+
// NOABI6: error: cannot find ROCm device library for ABI version 6; provide its path via '--rocm-path' or '--rocm-device-lib-path', or pass '-nogpulib' to build without ROCm device library

llvm/include/llvm/Config/llvm-config.h.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
/* Indicate that this is LLVM compiled from the amd-gfx branch. */
1818
#define LLVM_HAVE_BRANCH_AMD_GFX
19-
#define LLVM_MAIN_REVISION 522505
19+
#define LLVM_MAIN_REVISION 522509
2020

2121
/* Define if LLVM_ENABLE_DUMP is enabled */
2222
#cmakedefine LLVM_ENABLE_DUMP

llvm/lib/Target/RISCV/RISCVVLOptimizer.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,11 @@ static OperandInfo getOperandInfo(const MachineOperand &MO,
415415
case RISCV::VASUBU_VX:
416416
case RISCV::VASUB_VV:
417417
case RISCV::VASUB_VX:
418+
// Vector Single-Width Fractional Multiply with Rounding and Saturation
419+
// EEW=SEW. EMUL=LMUL. The instruction produces 2*SEW product internally but
420+
// saturates to fit into SEW bits.
421+
case RISCV::VSMUL_VV:
422+
case RISCV::VSMUL_VX:
418423
// Vector Single-Width Scaling Shift Instructions
419424
// EEW=SEW. EMUL=LMUL.
420425
case RISCV::VSSRL_VI:

mlir/include/mlir/Dialect/Tosa/IR/TosaOps.td

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1698,7 +1698,8 @@ def Tosa_TileOp : Tosa_InferShapedTypeOp<"tile"> {
16981698
// Operator: transpose
16991699
//===----------------------------------------------------------------------===//
17001700
def Tosa_TransposeOp : Tosa_InferShapedTypeOp<"transpose",
1701-
[DeclareOpInterfaceMethods<ReifyRankedShapedTypeOpInterface>]> {
1701+
[DeclareOpInterfaceMethods<ReifyRankedShapedTypeOpInterface>,
1702+
AllElementTypesMatch<["input1", "output"]>]> {
17021703
let summary = "Transpose operator";
17031704

17041705
let description = [{

mlir/lib/Dialect/Tosa/IR/TosaCanonicalizations.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,10 +1002,6 @@ OpFoldResult TransposeOp::fold(FoldAdaptor adaptor) {
10021002
return input.reshape(resultTy);
10031003
}
10041004

1005-
// Transpose does not change the input type.
1006-
if (getInput1().getType() != getType())
1007-
return {};
1008-
10091005
// Transpose is not the identity transpose.
10101006
SmallVector<int32_t> perms;
10111007
if (getConstantPerms(perms).failed())

0 commit comments

Comments
 (0)