platform/upstream/llvm.git
22 months ago[mlir] NFC: rename TransformTypeInterface to TransformHandleTypeInterface
Alex Zinenko [Mon, 2 Jan 2023 13:58:53 +0000 (13:58 +0000)]
[mlir] NFC: rename TransformTypeInterface to TransformHandleTypeInterface

This makes it more consistent with the recently added
TransformParamTypeInterface.

Reviewed By: springerm

Differential Revision: https://reviews.llvm.org/D140977

22 months ago[mlir] introduce parameters into the transofrm dialect
Alex Zinenko [Mon, 2 Jan 2023 13:07:02 +0000 (13:07 +0000)]
[mlir] introduce parameters into the transofrm dialect

Introduce a new kind of values into the transform dialect -- parameter
values. These values have a type implementing the new
`TransformParamTypeInterface` and are associated with lists of
attributes rather than lists of payload operations. This mechanism
allows one to wrap numeric calculations, typically heuristics, into
transform operations separate from those at actually applying the
transformation. For example, tile size computation can be now separated
from tiling itself, and not hardcoded in the transform dialect. This
further improves the separation of concerns between transform choice and
implementation.

Reviewed By: springerm

Differential Revision: https://reviews.llvm.org/D140976

22 months ago[bazel] Add missing :Support dependency after 1b8224537070
Benjamin Kramer [Fri, 6 Jan 2023 11:51:01 +0000 (12:51 +0100)]
[bazel] Add missing :Support dependency after 1b8224537070

22 months ago[mlir][tensor] Support parallel_insert_slice in MergeConsecutiveInsertExtractSlicePat...
Matthias Springer [Fri, 6 Jan 2023 10:59:30 +0000 (11:59 +0100)]
[mlir][tensor] Support parallel_insert_slice in MergeConsecutiveInsertExtractSlicePatterns.cpp

Differential Revision: https://reviews.llvm.org/D141116

22 months ago[mlir][linalg] Swap extract_slice(fill(x)) ops
Matthias Springer [Fri, 6 Jan 2023 10:59:41 +0000 (11:59 +0100)]
[mlir][linalg] Swap extract_slice(fill(x)) ops

This pattern is similar to `FoldFillWithTensorReshape`, which performs the same swapping with reshapes.

Fill the smaller extracted tensor slice instead of `x`. This allows for additional simplifications in case `x` is the result of another extract_slice.

Differential Revision: https://reviews.llvm.org/D141117

22 months ago[clang][analyzer] Extend StreamChecker with some new functions.
Balázs Kéri [Fri, 6 Jan 2023 10:21:41 +0000 (11:21 +0100)]
[clang][analyzer] Extend StreamChecker with some new functions.

The stream handling functions `ftell`, `rewind`, `fgetpos`, `fsetpos`
are evaluated in the checker more exactly than before.
New tests are added to test behavior of the checker together with
StdLibraryFunctionsChecker. The option ModelPOSIX of that checker
affects if (most of) the stream functions are recognized, and checker
StdLibraryFunctionArgs generates warnings if constraints for arguments
are not satisfied. The state of `errno` is set by StdLibraryFunctionsChecker
too for every case in the stream functions.
StreamChecker works with the stream state only, does not set the errno state,
and is not dependent on other checkers.

Reviewed By: Szelethus

Differential Revision: https://reviews.llvm.org/D140395

22 months ago[Transforms] Convert some tests to opaque pointers (NFC)
Nikita Popov [Fri, 6 Jan 2023 11:09:52 +0000 (12:09 +0100)]
[Transforms] Convert some tests to opaque pointers (NFC)

22 months ago[AArch64] add GlobalIsel support for scalar CNT instruction
Ties Stuij [Fri, 6 Jan 2023 10:09:46 +0000 (10:09 +0000)]
[AArch64] add GlobalIsel support for scalar CNT instruction

When feature CSSC is available we should use instruction CNT for s32, s64 and
s128 types in GlobalIsel's G_CTPOP.

spec:
https://developer.arm.com/documentation/ddi0602/2022-09/Base-Instructions/CNT--Count-bits-

Reviewed By: aemerson

Differential Revision: https://reviews.llvm.org/D139417

22 months ago[GlobalSplit] Convert test to opaque pointers (NFC)
Nikita Popov [Fri, 6 Jan 2023 11:07:06 +0000 (12:07 +0100)]
[GlobalSplit] Convert test to opaque pointers (NFC)

22 months ago[ConstantFold] Don't drop zero index gep with inrange attribute
Nikita Popov [Fri, 6 Jan 2023 11:02:52 +0000 (12:02 +0100)]
[ConstantFold] Don't drop zero index gep with inrange attribute

This may cause GlobalSplit to fail if opaque pointers are used.

inrange really needs a new representation, but for now restore the
pre-opaque pointers status.

22 months agoNFC Address review comment for D140905
OCHyams [Fri, 6 Jan 2023 10:58:12 +0000 (10:58 +0000)]
NFC Address review comment for D140905

22 months ago[LV] Disable runtime unrolling for vectorized loops.
Florian Hahn [Fri, 6 Jan 2023 10:56:17 +0000 (10:56 +0000)]
[LV] Disable runtime unrolling for vectorized loops.

This patch adds metadata to disable runtime unrolling to the vectorized
loop. If runtime unrolling/interleaving is considered profitable, LV
will interleave the loop directly. There should be no need to perform
runtime unrolling at a later stage.

Note that we already add metadata to disable runtime unrolling to the
scalar loop after vectorization.

The additional unrolling unnecessarily increases code size and compile
time. In addition to that we have several bug reports of unncessary
runtime unrolling for vectorized loops, e.g. PR40961

Compile-time improvements:

  NewPM-O3: -1.04%
  NewPM-ReleaseThinLTO: -0.59%
  NewPM-ReleaseLTO-g: -0.97%

https://llvm-compile-time-tracker.com/compare.php?from=ce1be13a868d0f8afa367975558c1a6175cce33a&to=78bc2e67f22e9e10e61cdb6cdac4bb857d95eb1b&stat=instructions:u

Fixes #40306.

Reviewed By: lebedev.ri, nikic

Differential Revision: https://reviews.llvm.org/D115261

22 months ago[DebugInfo] Replace UndefValue with PoisonValue in setKillLocation
OCHyams [Fri, 6 Jan 2023 10:49:13 +0000 (10:49 +0000)]
[DebugInfo] Replace UndefValue with PoisonValue in setKillLocation

This helps towards the effort to remove UndefValue from LLVM.

Related to https://discourse.llvm.org/t/auto-undef-debug-uses-of-a-deleted-value

Reviewed By: nlopes

Differential Revision: https://reviews.llvm.org/D140905

22 months ago[LoopUnroll] Convert test to opaque pointers (NFC)
Nikita Popov [Fri, 6 Jan 2023 10:47:32 +0000 (11:47 +0100)]
[LoopUnroll] Convert test to opaque pointers (NFC)

22 months ago[LoopUnroll] Name instructions in test (NFC)
Nikita Popov [Fri, 6 Jan 2023 10:46:59 +0000 (11:46 +0100)]
[LoopUnroll] Name instructions in test (NFC)

22 months agoApply clang-tidy fixes for performance-unnecessary-value-param in SparseTensorCodegen...
Mehdi Amini [Thu, 5 Jan 2023 19:28:48 +0000 (19:28 +0000)]
Apply clang-tidy fixes for performance-unnecessary-value-param in SparseTensorCodegen.cpp (NFC)

22 months ago[LoopIdiom] Convert tests to opaque pointers (NFC)
Nikita Popov [Fri, 6 Jan 2023 10:19:48 +0000 (11:19 +0100)]
[LoopIdiom] Convert tests to opaque pointers (NFC)

The differences here are due to SCEVExpander producing GEPs with
explicit offset calculation, a known difference with opaque pointers.

22 months ago[cmake] Add llvm-debuginfod as test dependency
Luke Lau [Thu, 5 Jan 2023 17:46:22 +0000 (17:46 +0000)]
[cmake] Add llvm-debuginfod as test dependency

llvm-debuginfod is used by llvm-lit as of
36f01909a0e29c1014301ed6835687a84bf0e9fa, so adding this dependency
fixes a "note: Did not find llvm-debuginfod" warning from showing up
when running tests.

Differential Revision: https://reviews.llvm.org/D141071

22 months ago[DebugInfo] Prefer setKillLocation rather than replacing operands with undef
OCHyams [Fri, 6 Jan 2023 09:16:50 +0000 (09:16 +0000)]
[DebugInfo] Prefer setKillLocation rather than replacing operands with undef

NFC-ish. There is a functional change but the outputs are semantically
identical. Where we might've before replaced one operand with undef (which
means "this is a kill location marker") the use of `setKillLocation` will
replace all location operands with `undef` (which also means "this is a kill
location marker").

Related to https://discourse.llvm.org/t/auto-undef-debug-uses-of-a-deleted-value

Reviewed By: StephenTozer

Differential Revision: https://reviews.llvm.org/D140904

22 months ago[LoopIdiom] Name instructions in test (NFC)
Nikita Popov [Fri, 6 Jan 2023 10:07:42 +0000 (11:07 +0100)]
[LoopIdiom] Name instructions in test (NFC)

22 months ago[clang][analyzer] Add stream related functions to StdLibraryFunctionsChecker.
Balázs Kéri [Fri, 6 Jan 2023 08:57:37 +0000 (09:57 +0100)]
[clang][analyzer] Add stream related functions to StdLibraryFunctionsChecker.

Additional stream handling functions are added.
These are partially evaluated by StreamChecker, result of the addition is
check for more preconditions and construction of success and failure branches
with specific errno handling.

Reviewed By: Szelethus

Differential Revision: https://reviews.llvm.org/D140387

22 months ago[X86] Add tests for atomic bittest with register/memory operands
Noah Goldstein [Fri, 6 Jan 2023 07:24:15 +0000 (15:24 +0800)]
[X86] Add tests for atomic bittest with register/memory operands

Reviewed By: pengfei

Differential Revision: https://reviews.llvm.org/D140938

22 months ago[libc] Add a section about supported compilers in the documentation
Guillaume Chatelet [Thu, 5 Jan 2023 13:35:09 +0000 (13:35 +0000)]
[libc] Add a section about supported compilers in the documentation

Context https://github.com/llvm/llvm-project/issues/59368

Differential Revision: https://reviews.llvm.org/D141045

22 months ago[DebugInfo][NFC] Rename is/setUndef to is/setKilllocation
OCHyams [Fri, 6 Jan 2023 08:42:18 +0000 (08:42 +0000)]
[DebugInfo][NFC] Rename is/setUndef to is/setKilllocation

These names better reflect the semantics and also the implementation, since
it's not just "undef" operands that are sentinels used to signal that the debug
intrinsic terminates dominating locations definitions.

Related to https://discourse.llvm.org/t/auto-undef-debug-uses-of-a-deleted-value

Reviewed By: StephenTozer

Differential Revision: https://reviews.llvm.org/D140903

22 months ago[lldb] Allow configuring on Windows with python interpreter within a junction
Markus Böck [Fri, 6 Jan 2023 08:54:55 +0000 (09:54 +0100)]
[lldb] Allow configuring on Windows with python interpreter within a junction

The current implementation nicely takes into account when the python interpreter is symlinked (or transitively within a symlinked directory). Sadly, `os.path.islink` returns `false` on Windows if instead of Windows symlinks, junctions are used. This has caused me issues after I started using `scoop` as my package manager on Windows, which creates junctions instead of symlinks.
The fix proposed in this patch is to check whether `realpath` returns a different path to `exe`, and if it does, to simply try again with that path.
The code could also be simplified since `sys.executable` is guaranteed to be absolute, and `os.readlink`, which can return a relative path, is no longer used.

Tested on Windows 11 with Python 3.11 as interpreter and Ubuntu 18.04 with Python 3.6

Differential Revision: https://reviews.llvm.org/D141042

22 months ago[flang] add hlfir.null to implement NULL()
Jean Perier [Fri, 6 Jan 2023 08:57:08 +0000 (09:57 +0100)]
[flang] add hlfir.null to implement NULL()

In HLFIR, the address of a Fortran entity in lowering must be defined
by an operation that has the FortranVariableOpInterface (it is a sanity
requirement to ensure that the mlir::Value propagated in certain places
of lowering can be reasoned about).
fir.zero_bits does not have this interface and it makes little sense to
add it since it can "zero initialize" more types than just addresses.

Creating an hlfir.declare for null addresses is a bit too much (what
would be the name), and it would be noisy in the IR.

Instead add a small hlfir.null operation whose codegen is simply a
replacement by fir.zero_bits.

It may also later help dealing with the NULL(MOLD) cases in a nicer
way (the current lowering of this uses special handling it).

Differential Revision: https://reviews.llvm.org/D141040

22 months ago[CodeGen][AMDGPU] EXTRACT_VECTOR_ELT: input vector element type can differ from outpu...
Juan Manuel MARTINEZ CAAMAÑO [Fri, 6 Jan 2023 08:45:36 +0000 (09:45 +0100)]
[CodeGen][AMDGPU] EXTRACT_VECTOR_ELT: input vector element type can differ from output type

In function SITargetLowering::performExtractVectorElt,
the output type was not considered which could lead to type mismatches
later.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D139943

22 months agoRevert "CodingStandards: restrict CamelCase variable names guideline to llvm/clang...
Nikita Popov [Fri, 6 Jan 2023 08:44:27 +0000 (09:44 +0100)]
Revert "CodingStandards: restrict CamelCase variable names guideline to llvm/clang/clang-tools-extra/polly/bolt"

This reverts commit ee9ccb11036ac46ff9b9f3fa2d459d9d2bce5509.

See https://reviews.llvm.org/D140585#4019417 and following.
Multiple people requested a revert of this change pending further
discussion.

22 months agoRevert "[X86] Revert -fno-plt __tls_get_addr workaround for old GNU ld"
Nikita Popov [Fri, 6 Jan 2023 08:37:45 +0000 (09:37 +0100)]
Revert "[X86] Revert -fno-plt __tls_get_addr workaround for old GNU ld"

This reverts commit 2679e8bba3e166e3174971d040b9457ec7b7d768.

This change is a significant backwards-compatibility break, which
does in fact break the entire Rust ecosystem, which uses an
-fno-plt -mrelax-relocations=0 default.

Please go through pre-commit review for this change in order to
gain broader consensus.

22 months ago[NFC] [Coroutines] Move collectFrameAlloca to decrease the times to iterate the function
Chuanqi Xu [Fri, 6 Jan 2023 08:34:48 +0000 (16:34 +0800)]
[NFC] [Coroutines] Move collectFrameAlloca to decrease the times to iterate the function

Previously in collectFrameAllocas, we will iterate every instruction in
the Function and we will iterate the function again later. It is
redundnt.

22 months ago[Sema] Fix crash when evaluating nested call with value-dependent arg
Pierre van Houtryve [Tue, 13 Dec 2022 08:50:41 +0000 (03:50 -0500)]
[Sema] Fix crash when evaluating nested call with value-dependent arg

Fix an edge case `ExprConstant.cpp`'s `EvaluateWithSubstitution` when called by `CheckEnableIf`

The assertion in `CallStackFrame::getTemporary`
could fail during evaluation of nested calls to a function
using `enable_if` when the second argument was a
value-dependent expression.

This caused a temporary to be created for the second
argument with a given version during the
evaluation of the inner call, but we bailed out
when evaluating the second argument of the
outer call due to the expression being value-dependent.
After bailing out, we tried to clean up the argument's value slot but it
caused an assertion to trigger in `getTemporary` as
a temporary for the second argument existed, but only for the inner call and not the outer call.

See the test case for a more complete description of the issue.

Reviewed By: ahatanak

Differential Revision: https://reviews.llvm.org/D139713

22 months ago[NFC] Test commit.
Benjamin Chetioui [Fri, 6 Jan 2023 07:25:44 +0000 (07:25 +0000)]
[NFC] Test commit.

22 months ago[VP][RISCV] Add vp.abs and RISC-V support.
Yeting Kuo [Thu, 5 Jan 2023 07:01:16 +0000 (15:01 +0800)]
[VP][RISCV] Add vp.abs and RISC-V support.

RISC-V uses ISD::ABS lower method (abs x) -> (smax_vl x (sub_vl 0, x)) for ISD::VP_ABS.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D141033

22 months agoSave the result of getenv() to a string
Akira Hatanaka [Fri, 6 Jan 2023 06:06:50 +0000 (22:06 -0800)]
Save the result of getenv() to a string

The result has to be saved to a string as the result might be
overwritten by subsequent calls to getenv.

https://pubs.opengroup.org/onlinepubs/009696899/functions/getenv.html

See the discussion here: https://reviews.llvm.org/D137996#4029305

22 months ago[X86] Add additional tests to no-shift.ll
Noah Goldstein [Fri, 6 Jan 2023 06:08:25 +0000 (14:08 +0800)]
[X86] Add additional tests to no-shift.ll

Reviewed By: pengfei

Differential Revision: https://reviews.llvm.org/D141076

22 months ago[Driver] Simplify -fsanitize-memory-track-origins handling. NFC
Fangrui Song [Fri, 6 Jan 2023 06:21:13 +0000 (22:21 -0800)]
[Driver] Simplify -fsanitize-memory-track-origins handling. NFC

22 months agoRevert "[Fix]"[-Wunsafe-buffer-usage] Add a new `forEachDescendant` matcher that...
ziqingluo-90 [Fri, 6 Jan 2023 06:02:43 +0000 (22:02 -0800)]
Revert "[Fix]"[-Wunsafe-buffer-usage] Add a new `forEachDescendant` matcher that skips callable declarations""

This reverts commit ef47a0a711f12add401394f7af07a0b4d1635b56.

Revert "[-Wunsafe-buffer-usage] Add a new `forEachDescendant` matcher that skips callable declarations"

This reverts commit b2ac5fd724c44cf662caed84bd8f84af574b981d.

This patch is causing failure in some Sanitizer tests
(https://lab.llvm.org/buildbot/#/builders/5/builds/30522/steps/13/logs/stdio).  Reverting the patch and its' fix.

22 months ago[RegAllocFast] Handle new debug values for spills
Josh Stone [Wed, 4 Jan 2023 00:04:45 +0000 (16:04 -0800)]
[RegAllocFast] Handle new debug values for spills

These new debug values get inserted after the place where the spill
happens, which means they won't be reached by the reverse traversal of
basic block instructions. This would crash or fail assertions if they
contained any virtual registers to be replaced. We can manually handle
the new debug values right away to resolve this.

Fixes https://github.com/llvm/llvm-project/issues/59172

Reviewed By: StephenTozer

Differential Revision: https://reviews.llvm.org/D139590

22 months ago[Sema] Fix a bug where clang doesn't detect uses of unavailable decls
Akira Hatanaka [Fri, 6 Jan 2023 04:09:56 +0000 (20:09 -0800)]
[Sema] Fix a bug where clang doesn't detect uses of unavailable decls
in C++ base or member initializers

Differential Revision: https://reviews.llvm.org/D127442

22 months ago[CodeGen][ObjC] Fix a memory leak that occurs when a non-trivial C
Akira Hatanaka [Fri, 6 Jan 2023 03:48:25 +0000 (19:48 -0800)]
[CodeGen][ObjC] Fix a memory leak that occurs when a non-trivial C
struct property is set using dot notation

Make sure the destructor is called if needed.

Differential Revision: https://reviews.llvm.org/D136639

22 months ago[LoongArch] Add intrinsics for CACOP instruction
Xiaodong Liu [Fri, 6 Jan 2023 01:32:20 +0000 (09:32 +0800)]
[LoongArch] Add intrinsics for CACOP instruction

The CACOP instruction is mainly used for cache initialization
and cache-consistency maintenance.

Depends on D140872

Reviewed By: SixWeining

Differential Revision: https://reviews.llvm.org/D140527

22 months ago[mlir] Fix build error due to -Wsign-compare after revision D140871
Jie Fu [Fri, 6 Jan 2023 03:36:13 +0000 (19:36 -0800)]
[mlir] Fix build error due to -Wsign-compare after revision D140871

This patch fixes build failure due to -Wsign-compare in sparse2SparseRewrite(...) after https://reviews.llvm.org/D140871.

```
llvm-project/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorRewriting.cpp:842:32: error: comparison of integers of different signs: 'uint64_t' (aka 'unsigned long') and 'int64_t' (aka 'long') [-Werror,-Wsign-compare]
        for (uint64_t i = 0; i < rank; i++) {
                             ~ ^ ~~~~
1 error generated.
```

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D141104

22 months ago[clang-format] Disallow decltype in the middle of constraints
Emilia Dreamer [Fri, 6 Jan 2023 03:18:19 +0000 (05:18 +0200)]
[clang-format] Disallow decltype in the middle of constraints

If a function with a `requires` clause as a constraint has a decltype
return type, such as `decltype(auto)`, the decltype was seen to be part
of the constraint clause, rather than as part of the function
declaration, causing it to be placed on the wrong line.

This patch disallows decltype to be a part of these clauses

Fixes https://github.com/llvm/llvm-project/issues/59578

Depends on D140339

Reviewed By: HazardyKnusperkeks, owenpan, MyDeveloperDay

Differential Revision: https://reviews.llvm.org/D140312

22 months ago[clang-format] Remove special logic for parsing concept definitions.
Emilia Dreamer [Fri, 6 Jan 2023 03:13:58 +0000 (05:13 +0200)]
[clang-format] Remove special logic for parsing concept definitions.

Previously, clang-format relied on a special method to parse concept
definitions, `UnwrappedLineParser::parseConcept()`, which deferred to
`UnwrappedLineParser::parseConstraintExpression()`. This is problematic,
because the C++ grammar treats concepts and requires clauses
differently, causing issues such as https://github.com/llvm/llvm-project/issues/55898 and https://github.com/llvm/llvm-project/issues/58130.

This patch removes `parseConcept`, letting the formatter parse concept
definitions as more like what they actually are, fancy bool definitions.

NOTE that because of this, some long concept definitions change in their
formatting, as can be seen in the changed tests. This is because of a
change in split penalties, caused by a change in MightBeFunctionDecl on
the concept definition line, which was previously `true` but with this
patch is now `false`.

One might argue that `false` is a more "correct" value for concept
definitions, but I'd be fine with setting it to `true` again to maintain
compatibility with previous versions.

Fixes https://github.com/llvm/llvm-project/issues/58130

Depends on D140330

Reviewed By: HazardyKnusperkeks, owenpan, MyDeveloperDay

Differential Revision: https://reviews.llvm.org/D140339

22 months ago[clang-format] Require space before noexcept qualifier
Emilia Dreamer [Fri, 6 Jan 2023 03:03:29 +0000 (05:03 +0200)]
[clang-format] Require space before noexcept qualifier

This brings the noexcept qualifier more visually in line with the other
keyword qualifiers, such as "final" and "override".

Originally reported as https://github.com/llvm/llvm-project/issues/44542,
it was closed as "working by design" and reinforcing tests were added
as part of a218706cba90248be0c60bd6a8f10dbcf0270955. The exact spacing
depended on the `PointerAlignment` option, where the default value of
`Right` would leave no space.

This patch seeks to change this behaviour, regardless of the configured
`PointerAlignment` option (matching the previous behaviour of the `Left`
option).

Closes https://github.com/llvm/llvm-project/issues/59729

Reviewed By: HazardyKnusperkeks, owenpan, MyDeveloperDay

Differential Revision: https://reviews.llvm.org/D140767

22 months agoFix for tests on Windows buildbot
Brad Smith [Fri, 6 Jan 2023 02:24:36 +0000 (21:24 -0500)]
Fix for tests on Windows buildbot

22 months ago[PowerPC] remove the ctr clobbers check related to TLS access
Chen Zheng [Fri, 6 Jan 2023 02:22:18 +0000 (21:22 -0500)]
[PowerPC] remove the ctr clobbers check related to TLS access

Dynamic tls access model will be lowered to MI which clobbers CTR in
the loop in ISEL(ADDItlsgdLADDR) and post-isel CTR loop pass will revert
the loop to a normal compare + branch form.

So no need to add this clobber check in hardware loop insertion pass now.

Reviewed By: nemanjai

Differential revision: https://reviews.llvm.org/D140367

22 months ago[Driver] move Fuchsia header search path management to the driver
Brad Smith [Fri, 6 Jan 2023 02:18:12 +0000 (21:18 -0500)]
[Driver] move Fuchsia header search path management to the driver

Fuchsia already implements AddClangSystemIncludeArgs(). So it looks like we
just have to switch over to using it.

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D141073

22 months ago[PowerPC][NFC] add an option to keep the test point
Chen Zheng [Fri, 6 Jan 2023 01:46:52 +0000 (20:46 -0500)]
[PowerPC][NFC] add an option to keep the test point

Passes before hardware loop insertion change the loop to a form which
is not a hardware loop candidate (return early before checking the ctr clobbers).
And the PHI in the loop exit block is also optimized away. This breaks the
previous test point when the case was committed. Fixing this by running this
case just before hardware loop insertion pass.

Reviewed By: nemanjai

Differential revision: https://reviews.llvm.org/D140366

22 months ago[LoongArch] Add "32bit" target feature
Xiaodong Liu [Fri, 6 Jan 2023 01:18:11 +0000 (09:18 +0800)]
[LoongArch] Add "32bit" target feature

There are a few intrinsics or instructions on LoongArch
that are only appropriate for loongarch32 target. So the
feature "32bit" is added to implement it.

Reviewed By: SixWeining

Differential Revision: https://reviews.llvm.org/D140872

22 months ago[LoongArch] Define __GCC_HAVE_SYNC_COMPARE_AND_SWAP macros
Brad Smith [Fri, 6 Jan 2023 01:18:59 +0000 (20:18 -0500)]
[LoongArch] Define __GCC_HAVE_SYNC_COMPARE_AND_SWAP macros

Define __GCC_HAVE_SYNC_COMPARE_AND_SWAP macros

Reviewed By: SixWeining, MaskRay

Differential Revision: https://reviews.llvm.org/D141070

22 months ago[mlir][spirv] Add smul_extended expansion for WebGPU
Jakub Kuderski [Fri, 6 Jan 2023 01:11:46 +0000 (20:11 -0500)]
[mlir][spirv] Add smul_extended expansion for WebGPU

We need this because WGSL does not support extended multiplication ops.

Fixes: https://github.com/llvm/llvm-project/issues/59563

Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D141096

22 months agoRevert "[clang][dataflow] Only model struct fields that are used in the function...
Yitzhak Mandelbaum [Fri, 6 Jan 2023 01:07:28 +0000 (01:07 +0000)]
Revert "[clang][dataflow] Only model struct fields that are used in the function being analyzed."

This reverts commit 5e8f597c2fedc740b71f07dfdb1ef3c2d348b193. It caused msan and ubsan breakages.

22 months ago[RISCV] Rename SDT_RISCVVecCvtX2FOp_VL->SDT_RISCVVecCvtF2XOp_VL. NFC
Craig Topper [Fri, 6 Jan 2023 00:35:59 +0000 (16:35 -0800)]
[RISCV] Rename SDT_RISCVVecCvtX2FOp_VL->SDT_RISCVVecCvtF2XOp_VL. NFC

The instruction name is x.f with the destination type first. The
template name was intended as "convert F to X". So the F comes first.

22 months ago[LSAN][NFC] Removed FinishThreadLocked from the LSAN interface.
Kirill Stoimenov [Fri, 6 Jan 2023 00:08:59 +0000 (00:08 +0000)]
[LSAN][NFC] Removed FinishThreadLocked from the LSAN interface.

It is only used in the LSAN specific part.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D140109

22 months ago[AMDGPU] Switch to autogenerated checks
Jeffrey Byrnes [Fri, 6 Jan 2023 00:22:04 +0000 (16:22 -0800)]
[AMDGPU] Switch to autogenerated checks

22 months ago[NFC][MLIR] Adding better names to lit test for pooling vectorization
Murali Vijayaraghavan [Thu, 5 Jan 2023 23:50:05 +0000 (23:50 +0000)]
[NFC][MLIR] Adding better names to lit test for pooling vectorization

Differential Revision: https://reviews.llvm.org/D141097

22 months ago[mlir][sparse] Replace sparse_tensor.sort with sparse_tensor.sort_coo for sorting...
bixia1 [Thu, 5 Jan 2023 17:39:23 +0000 (09:39 -0800)]
[mlir][sparse] Replace sparse_tensor.sort with sparse_tensor.sort_coo for sorting COO tensors.

Add codegen pattern for sparse_tensor.indices_buffer.

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D140871

22 months ago[mlir][spirv] Fix extended umul expansion for WebGPU
Jakub Kuderski [Thu, 5 Jan 2023 23:37:49 +0000 (18:37 -0500)]
[mlir][spirv] Fix extended umul expansion for WebGPU

Fix an off-by-one error in extended umul extension for WebGPU.
Revert to the long multiplication algorithm originally added to wide
integer emulation, which was deleted in D139776. It is much easier
to see why it is correct.

Add runtime tests based on the mlir-vulkan-runner. These run both with
and without umul extension.

Issue: https://github.com/llvm/llvm-project/issues/59563

Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D141085

22 months ago[clang-format] Add an option to insert a newline at EOF if missing
Owen Pan [Thu, 5 Jan 2023 07:55:10 +0000 (23:55 -0800)]
[clang-format] Add an option to insert a newline at EOF if missing

Closes #38042.

Differential Revision: https://reviews.llvm.org/D141035

22 months ago[mlir][linalg] Vectorize 1D convolution
Murali Vijayaraghavan [Thu, 5 Jan 2023 23:08:11 +0000 (23:08 +0000)]
[mlir][linalg] Vectorize 1D convolution

Differential Revision: https://reviews.llvm.org/D140188

22 months ago[LVI] Look through negations when evaluating conditions
Keno Fischer [Wed, 4 Jan 2023 01:49:17 +0000 (01:49 +0000)]
[LVI] Look through negations when evaluating conditions

This teaches LVI (and thus CVP) to extract range information
from branches whose condition is negated using (`xor %c, true`).
On the implementation side, we switch the cache to additionally
track whether we're looking for the inverted value or not and
otherwise using the existing support for computing inverted
conditions.

I think the biggest question here is why this negation shows up
here at all. After all, it should always be possible for some
other pass to fold such a negation into a branch, comparison or
some other logical operation. Indeed, instcombine does just that.
However, these negations can be otherwise fairly persistent, e.g.
instsimplify is not able to exchange branch conditions from
negations. In addition, jumpthreading, which sits at the same
point in default pass pipeline also handles this pattern, which
adds further evidence that we might expect these negations to
not have been canonicalized away yet at this point in the pass
pipeline.

In the particular case I was looking at there was a bit of a
circular dependency where flags computed by cvp were needed
by instcombine, and incstombine's folding of the negation was
needed for cvp. Adding a second instombine pass would have
worked of course, but instcombine can be somewhat expensive,
so it appeared desirable to not require it to have run
before cvp (as is the case in the default pass pipeline).

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D140933

22 months ago[C] Make (c ? e1 : e2) noreturn only if both e1 and e2 are noreturn
Fangrui Song [Thu, 5 Jan 2023 22:36:36 +0000 (14:36 -0800)]
[C] Make (c ? e1 : e2) noreturn only if both e1 and e2 are noreturn

In C mode, if e1 has __attribute__((noreturn)) but e2 doesn't, `(c ? e1 : e2)`
is incorrectly noreturn and Clang codegen produces `unreachable`
which may lead to miscompiles (see [1] `gawk/support/dfa.c`).
This problem has been known since
8c6b56f39d967347f28dd9c93f1cffddf6d7e4cd (2010) or earlier.

Fix this by making the result type noreturn only if both e1 and e2 are
noreturn, matching GCC.

`_Noreturn` and `[[noreturn]]` do not have the aforementioned problem.

Fix https://github.com/llvm/llvm-project/issues/59792 [1]

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D140868

22 months ago[Transform] Rewrite LowerSwitch using APInt
Peter Rong [Thu, 29 Dec 2022 00:51:07 +0000 (16:51 -0800)]
[Transform] Rewrite LowerSwitch using APInt

This rewrite fixes https://github.com/llvm/llvm-project/issues/59316.

Previously LowerSwitch uses int64_t, which will crash on case branches using integers with more than 64 bits.
Using APInt fixes this problem. This patch also includes a test

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D140747

22 months agoAdd isInAnonymousNamespace() to the dynamic AST matchers
Aaron Ballman [Thu, 5 Jan 2023 22:08:57 +0000 (17:08 -0500)]
Add isInAnonymousNamespace() to the dynamic AST matchers

This was added to the static matchers in
125ccd3751472a0c709498f83671577ffed394a6, but the dynamic matcher was
missed. This adds the dynamic matcher to the list.

22 months agoDisable a part of the unit test CommandLineTest/BadResponseFile for z/OS.
Zibi Sarbinowski [Thu, 5 Jan 2023 21:55:21 +0000 (15:55 -0600)]
Disable a part of the unit test CommandLineTest/BadResponseFile for z/OS.

[Support] Do not run test on z/OS

A part of the unit test CommandLineTest/BadResponseFile, added in
the commit fd3d7a9f8cbb need to be disable for z/OS as it was already done for AIX platform.

Reviewed By: fanbo-meng

Differential Revision: https://reviews.llvm.org/D141084

22 months ago[NFC][IR] Avoid string leak with target extension types.
Joshua Cranmer [Thu, 5 Jan 2023 21:53:29 +0000 (16:53 -0500)]
[NFC][IR] Avoid string leak with target extension types.

Reviewed By: nikic, hctim

Differential Revision: https://reviews.llvm.org/D141083

22 months ago[clang][dataflow] Only model struct fields that are used in the function being analyzed.
Yitzhak Mandelbaum [Tue, 27 Dec 2022 14:21:29 +0000 (14:21 +0000)]
[clang][dataflow] Only model struct fields that are used in the function being analyzed.

Previously, the model for structs modeled all fields in a struct when
`createValue` was called for that type. This patch adds a prepass on the
function under analysis to discover the fields referenced in the scope and then
limits modeling to only those fields.  This reduces wasted memory usage
(modeling unused fields) which can be important for programss that use large
structs.

Note: This patch obviates the need for https://reviews.llvm.org/D123032.

Differential Revision: https://reviews.llvm.org/D140694

22 months agoRevert an unintentional API ABI break
Adrian Prantl [Thu, 5 Jan 2023 21:41:33 +0000 (13:41 -0800)]
Revert an unintentional API ABI break

lldb::LanguageType is used as a parameter in
SBExpressionOptions::SetLanguage(), which actually makes this type API
too. Commit 6eaedbb52f2a616e644e5acc7279c8b07c4cfe82 added a
`: uint16_t` to it, which broke binary compatibility for the SBAPI. This
patch reverts to the original enum.

I tried moving the entire enum into include/API, but that created a
cyclic module dependency between API and Utility. To keep things
simple, this just reverts to the original code and adds a warning.

rdar://103415402

Differential Revision: https://reviews.llvm.org/D141087

22 months agoclang/AMDGPU: Remove flat-address-space from feature map
Matt Arsenault [Mon, 28 Nov 2022 22:55:17 +0000 (17:55 -0500)]
clang/AMDGPU: Remove flat-address-space from feature map

This was only used for checking if is_shared/is_private were legal,
which we're not bothering to do anymore.

This is apparently visible to more than the target attribute (which
seems to silently ignore unrecognized features), so this has the
potential to break something (i.e. see the OpenMP test change)

22 months ago[NFC] [Doc] Fix example for AnnotateTypeDocs
Xiang Li [Thu, 5 Jan 2023 21:29:09 +0000 (16:29 -0500)]
[NFC] [Doc] Fix example for AnnotateTypeDocs

Change clang::annotate into clang::annotate_type.

The example will get error like
error: 'annotate' attribute cannot be applied to types
int* [[clang::annotate("category1", "foo", 1)]] f(int[[clang::annotate("category2")]] *);

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D139935

22 months ago[AMDGPU] Add .uniform_work_group_size metadata to v5
Vang Thao [Thu, 5 Jan 2023 20:40:12 +0000 (20:40 +0000)]
[AMDGPU] Add .uniform_work_group_size metadata to v5

Amdgpu kernel with function attribute "uniform-work-group-size"="true" requires
uniform work group size (i.e. each dimension of global size is a multiple of
corresponding dimension of work group size). hipExtModuleLaunchKernel allows to
launch HIP kernel with non-uniform workgroup size, which makes it necessary for
runtime to check and enforce uniform workgroup size if kernel requires it. To
let runtime be able to enforce that, this metadata is needed to indicate that
the kernel requires uniform workgroup size.

Reviewed By: kzhuravl, arsenm

Differential Revision: https://reviews.llvm.org/D141012

22 months ago[CodeGen] Default TargetOptions::RelaxELFRelocations to true
Fangrui Song [Thu, 5 Jan 2023 21:28:48 +0000 (13:28 -0800)]
[CodeGen] Default TargetOptions::RelaxELFRelocations to true

MC and lld/ELF defaults were flipped in 2016. For Clang: CMake
ENABLE_X86_RELAX_RELOCATIONS defaults to on in 2020. It makes sense for
the TargetOptions default to be true now.

R_X86_64_GOTPCRELX/R_X86_64_REX_GOTPCRELX require GNU ld newer than 2015-10
(subsumed by the current requirement of -fbinutils-version=).

This should fix `rustc -Z plt=no` PIC relocatable files with GNU ld.
(See https://github.com/rust-lang/rust/pull/106380)

22 months ago[clang-format] Improve UnwrappedLineParser::mightFitOnOneLine()
Owen Pan [Mon, 2 Jan 2023 00:02:35 +0000 (16:02 -0800)]
[clang-format] Improve UnwrappedLineParser::mightFitOnOneLine()

Account for an r_brace that precedes an "else if" statement when
calculating whether the line might fit on one line if the r_brace
is removed.

Fixes #59778.

Differential Revision: https://reviews.llvm.org/D140835

22 months agoParse: handle another case of invalid handling for attributes
Saleem Abdulrasool [Thu, 22 Dec 2022 15:46:34 +0000 (15:46 +0000)]
Parse: handle another case of invalid handling for attributes

clang would improperly disallow GNU attributes before C++ standard
attributes when a declaration had a linkage specifier.  Handle this
similarly to the previous case of invalid parsing.  We now better match
the parsing rules from GCC.

Differential Revision: https://reviews.llvm.org/D140507
Reviewed By: aaron.ballman

22 months ago[AMDGPU] MachineScheduler: schedule execution metric added for the UnclusteredHighRPStage
Alexander Timofeev [Wed, 7 Dec 2022 17:36:11 +0000 (18:36 +0100)]
[AMDGPU] MachineScheduler: schedule execution metric added for the UnclusteredHighRPStage

Since the divergence-driven ISel was fully enabled we have more VGPRs available.
         MachineScheduler trying to take advantage of that bumps up the occupancy sacrificing
         the hiding of memory access latency.  This really spoils the initially good schedule.
         A new metric that reflects the latency hiding quality of the schedule has been created
         to make it to balance between occupancy and latency. The metric is based on the latency
         model which computes the bubble to working cycles ratio. Then we use this ratio to decide
         if the higher occupancy schedule is profitable as follows:

             Profit = NewOccupancy/OldOccupancy * OldMetric/NewMetric

Reviewed By: rampitec

Differential Revision: https://reviews.llvm.org/D139710

22 months ago[Fix]"[-Wunsafe-buffer-usage] Add a new `forEachDescendant` matcher that skips callab...
ziqingluo-90 [Thu, 5 Jan 2023 19:48:02 +0000 (11:48 -0800)]
[Fix]"[-Wunsafe-buffer-usage] Add a new `forEachDescendant` matcher that skips callable declarations"

The original patch in commit b2ac5fd724c44cf662caed84bd8f84af574b981d
causes compilation errors which can be reproduced by the
`-fdelayed-template-parsing` flag.  This commit fixes the problem.

Related differential revision: https://reviews.llvm.org/D138329

22 months agoRevert "Revert "[-Wunsafe-buffer-usage] Add a new `forEachDescendant` matcher that...
ziqingluo-90 [Thu, 5 Jan 2023 19:45:25 +0000 (11:45 -0800)]
Revert "Revert "[-Wunsafe-buffer-usage] Add a new `forEachDescendant` matcher that skips callable declarations""

This reverts commit f58b025354ee2d3bcd7ab2399a11429ec940c1e0.

 The previous revert reverts a patch that causes compilation problem on
 windows which can be reproduced using `-fdelayed-template-parsing`.
 I'm now to revert the patch back and commit a fix next.

22 months agoVerifier: Disallow uses of intrinsic global variables
Matt Arsenault [Thu, 24 Nov 2022 21:58:49 +0000 (16:58 -0500)]
Verifier: Disallow uses of intrinsic global variables

appendToGlobalCtors implicitly assumes this is the case, since it
deletes and recreates without trying to update any uses.

This ran into an interesting problem in a few linker tests. During the
link, ConstantExpr casts were speculatively created to replace any
uses that might need them for replacement. These unused ConstantExprs
would hang around and still appear on the use list. It seems like a
bug that those stick around, but I'm not sure where those are supposed
to be cleaned up. Avoid this by not creating the casts for appending
linkage.

Delete one of the casts entirely as it breaks no tests. The verifier
has enforced a specific type for these since 2011, so I don't see why
we would need to handle linking modules with a wrong types. One test
does fail without the second cast (Linker/appending-global-proto.ll,
added by D95126). This test looks contrived; it's using appending
linkage with a regular variable. The LangRef suggests this is illegal
(and suggests another missing verifier check).

22 months agoRemove documentation about the Go bindings
Aaron Ballman [Thu, 5 Jan 2023 19:47:11 +0000 (14:47 -0500)]
Remove documentation about the Go bindings

We removed the Go bindings in https://reviews.llvm.org/D135436 but
missed documentation that talks about the bindings.

22 months ago[RISCV] Prevent constant hoisting for or/and/xor that can use bseti/bclri/binvi.
Craig Topper [Thu, 5 Jan 2023 19:18:26 +0000 (11:18 -0800)]
[RISCV] Prevent constant hoisting for or/and/xor that can use bseti/bclri/binvi.

Reviewed By: reames

Differential Revision: https://reviews.llvm.org/D140928

22 months ago[test] Test __attribute__((noreturn)), _Noreturn, and [[return]] with conditional...
Fangrui Song [Thu, 5 Jan 2023 19:18:17 +0000 (11:18 -0800)]
[test] Test __attribute__((noreturn)), _Noreturn, and [[return]] with conditional operator

22 months ago[lld-macho] Don't support relocations in cstring sections
Jez Ng [Thu, 5 Jan 2023 19:14:11 +0000 (14:14 -0500)]
[lld-macho] Don't support relocations in cstring sections

We can technically handle them, but since they shouldn't come up in any
real-world programs (since ld64 dedups strings unconditionally), there's
no reason to support them.

It's a thoroughly untested code path too -- as evidenced by the fact
that the only test this change breaks is one that verifies that we
reject relocations when dedup'ing. There is no test that covers the case
where we handle relocations in cstring sections when dedup is disabled.

Reviewed By: #lld-macho, oontvoo, keith, thakis

Differential Revision: https://reviews.llvm.org/D141025

22 months ago[profile] Update test to make condition non-redundant.
Florian Hahn [Thu, 5 Jan 2023 19:03:33 +0000 (19:03 +0000)]
[profile] Update test to make condition non-redundant.

The tests contain a redundant condition in the else if branch that can
be simplified with fb13dcf3431c.

Update the condition used to prevent it from getting removed.

Alive2 proof for check removal:
https://alive2.llvm.org/ce/z/iFBnsy

22 months agoFix typos
Luke Drummond [Thu, 5 Jan 2023 18:34:55 +0000 (18:34 +0000)]
Fix typos

I found one typo of "implemnt", then some more.
s/implemnt/implement/g

22 months agoAMDGPU: Fix broken opaque pointer handling in printf pass
Matt Arsenault [Thu, 22 Dec 2022 16:49:00 +0000 (11:49 -0500)]
AMDGPU: Fix broken opaque pointer handling in printf pass

This was directly considering the pointee type, and also applying
special semantics to constant address space.

22 months ago[NFC][YAMLTraits] Use `SmallString<>`+SSO when yamlizing non-strings
Roman Lebedev [Thu, 5 Jan 2023 18:20:32 +0000 (21:20 +0300)]
[NFC][YAMLTraits] Use `SmallString<>`+SSO when yamlizing non-strings

This gets rid of basically all temporary allocations
during YAML serialization of llvm-exegesis snippets,
we go from ~1.8M temporary allocations to 13k.

22 months ago[NFC][exegesis] `SnippetGenerator::generateConfigurations()`: don't forget to `reserve()`
Roman Lebedev [Thu, 5 Jan 2023 17:51:37 +0000 (20:51 +0300)]
[NFC][exegesis] `SnippetGenerator::generateConfigurations()`: don't forget to `reserve()`

22 months ago[lld-macho][test] Simplify classrefs test
Jez Ng [Thu, 5 Jan 2023 18:29:21 +0000 (13:29 -0500)]
[lld-macho][test] Simplify classrefs test

I wasn't previously aware of the `llvm-otool -o` flag; that gives us
output that's a lot easier to parse.

Reviewed By: #lld-macho, thakis

Differential Revision: https://reviews.llvm.org/D141024

22 months ago[clang] Correct -frewrite-includes generation of line control directives with mixed...
Tom Honermann [Wed, 4 Jan 2023 03:41:33 +0000 (19:41 -0800)]
[clang] Correct -frewrite-includes generation of line control directives with mixed EOL forms.

Previously, if a header file and a source file used different end of line
(EOL) forms, preprocessed output generated with the -frewrite-includes option
would, in some cases, generate line control directives with the wrong line
number due to an error in how source file lines were counted.

Fixes https://github.com/llvm/llvm-project/issues/59736

Reviewed By: cor3ntin

Differential Revision: https://reviews.llvm.org/D140984

22 months ago[AArch64] Regenerate fp16-vector-nvcast.ll check lines. NFC
David Green [Thu, 5 Jan 2023 18:16:58 +0000 (18:16 +0000)]
[AArch64] Regenerate fp16-vector-nvcast.ll check lines. NFC

22 months ago[SLP] Unify GEP cost modeling for load, store and GEP nodes.
Valery N Dmitriev [Wed, 28 Dec 2022 21:22:53 +0000 (13:22 -0800)]
[SLP] Unify GEP cost modeling for load, store and GEP nodes.

Make a separate routine for GEPs cost calculation and make
the approach uniform across load, store and GEP tree nodes.
Additional issue fixed is GEP cost savings were applied twice
for ScatterVectorize nodes (aka gather load) making them look
unrealistically profitable for vectorization.

Differential Revision: https://reviews.llvm.org/D140789

22 months ago[libc] Make the sidebar colors have a higher constract in the white background.
Siva Chandra Reddy [Thu, 5 Jan 2023 09:26:15 +0000 (01:26 -0800)]
[libc] Make the sidebar colors have a higher constract in the white background.

Reviewed By: jeffbailey

Differential Revision: https://reviews.llvm.org/D141039

22 months ago[libc] Add document for a recipe to do a full standalone cross-build.
Siva Chandra Reddy [Thu, 5 Jan 2023 09:09:28 +0000 (01:09 -0800)]
[libc] Add document for a recipe to do a full standalone cross-build.

Reviewed By: jeffbailey

Differential Revision: https://reviews.llvm.org/D141037

22 months ago[mlir][sparse] Add operator sparse_tensor.indices_buffer.
bixia1 [Thu, 5 Jan 2023 00:01:35 +0000 (16:01 -0800)]
[mlir][sparse] Add operator sparse_tensor.indices_buffer.

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D140762

22 months ago[InstCombine] add tests for cmp of pow2 mask; NFC
Sanjay Patel [Wed, 4 Jan 2023 21:00:25 +0000 (16:00 -0500)]
[InstCombine] add tests for cmp of pow2 mask; NFC

22 months ago[libc] Add documentation on hacking with vscode
Jeff Bailey [Thu, 5 Jan 2023 17:27:16 +0000 (17:27 +0000)]
[libc] Add documentation on hacking with vscode

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D140826

22 months ago[NFC][exegesis] `BenchmarkCodeStreamer`: use existing RegNameToRegNo map
Roman Lebedev [Thu, 5 Jan 2023 17:11:38 +0000 (20:11 +0300)]
[NFC][exegesis] `BenchmarkCodeStreamer`: use existing RegNameToRegNo map

22 months ago[NFC][AttributesTest] Fix signedness warnings
Roman Lebedev [Thu, 5 Jan 2023 17:10:35 +0000 (20:10 +0300)]
[NFC][AttributesTest] Fix signedness warnings

22 months ago[RISCV][NFC] Refine the patch of D141061
Kito Cheng [Thu, 5 Jan 2023 16:48:22 +0000 (00:48 +0800)]
[RISCV][NFC] Refine the patch of D141061

Just saw Craig's comment after I commit, he has suggest a good NFC
for that change.