platform/upstream/llvm.git
12 months ago[mlir] Fix build after D155680
Matthias Springer [Fri, 21 Jul 2023 11:33:54 +0000 (13:33 +0200)]
[mlir] Fix build after D155680

12 months ago[mlir] Update bazel build after rG70c2e0618a0f3c09ed7149d88b4987b932eb6705
Alexander Belyaev [Fri, 21 Jul 2023 11:16:31 +0000 (13:16 +0200)]
[mlir] Update bazel build after rG70c2e0618a0f3c09ed7149d88b4987b932eb6705

12 months ago[Clang] Fix access to an unitinialized variable
Corentin Jabot [Fri, 21 Jul 2023 10:32:23 +0000 (12:32 +0200)]
[Clang] Fix access to an unitinialized variable

This fixes the spurious test failure introduced in f9caa12328b2

12 months agoRevert "[LIT] Added an option to llvm-lit to emit the necessary test coverage data...
Shivam Gupta [Fri, 21 Jul 2023 10:29:56 +0000 (15:59 +0530)]
Revert "[LIT] Added an option to llvm-lit to emit the necessary test coverage data, divided per test case"

This reverts commit d8e26bccb3016d255298b7db78fe8bf05dd880b2.
Test case are meant to run only when LLVM_INDIVIDUAL_TEST_COVERAGE is set.

12 months ago[OpenMP] [OMPT] [6/8] Added callback support for target data operations, target submi...
Michael Halkenhaeuser [Wed, 8 Jun 2022 23:33:01 +0000 (16:33 -0700)]
[OpenMP] [OMPT] [6/8] Added callback support for target data operations, target submit, and target regions.

This patch adds support for invoking target callbacks but does not yet
invoke them. A new structure OmptInterface has been added that tracks
thread local states including correlation ids. This structure defines
methods that will be called from the device independent target library
with information related to a target entry point for which a callback
is invoked. These methods in turn use the callback functions maintained
by OmptDeviceCallbacksTy to invoke the tool supplied callbacks.

Depends on D124652

Patch from John Mellor-Crummey <johnmc@rice.edu>
With contributions from:
Dhruva Chakrabarti <Dhruva.Chakrabarti@amd.com>

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

12 months ago[mlir][bufferization] Remove cleanup pipeline from bufferization pass
Matthias Springer [Fri, 21 Jul 2023 10:10:36 +0000 (12:10 +0200)]
[mlir][bufferization] Remove cleanup pipeline from bufferization pass

To keep the pass simple, users should apply cleanup passes manually when necessary. In particular, `-cse -canonicalize` are often desireable to fold away self-copies that are created by the bufferization.

This addresses a comment in D120191.

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

12 months ago[AMDGPU] [NFC] Fixed a typo in SIShrinkInstructions.cpp
Pranav Taneja [Fri, 21 Jul 2023 10:03:37 +0000 (15:33 +0530)]
[AMDGPU] [NFC] Fixed a typo in SIShrinkInstructions.cpp

Reviewed By: pravinjagtap

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

12 months ago[AMDGPU][RFC] Update isLegalAddressingMode for GFX9 SMEM signed offsets
Jay Foad [Tue, 18 Jul 2023 12:38:31 +0000 (13:38 +0100)]
[AMDGPU][RFC] Update isLegalAddressingMode for GFX9 SMEM signed offsets

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

12 months ago[AMDGPU] Add tests for SMEM addressing modes in CodeGenPrepare
Jay Foad [Thu, 20 Jul 2023 15:51:48 +0000 (16:51 +0100)]
[AMDGPU] Add tests for SMEM addressing modes in CodeGenPrepare

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

12 months ago[LIT] Added an option to llvm-lit to emit the necessary test coverage data, divided...
Shivam Gupta [Fri, 21 Jul 2023 09:26:02 +0000 (14:56 +0530)]
[LIT] Added an option to llvm-lit to emit the necessary test coverage data, divided per test case

This patch is the first part of https://llvm.org/OpenProjects.html#llvm_patch_coverage.

We have first define a new variable LLVM_TEST_COVERAGE which when set, pass --emit-coverage option to
llvm-lit which will help in setting a unique value to LLVM_PROFILE_FILE for each RUN. So for example
coverage data for test case llvm/test/Analysis/AliasSet/memtransfer.ll will be emitted as
build/test/Analysis/AliasSet/memtransfer.profraw

Reviewed By: hnrklssn

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

12 months ago[mlir][transform][structured][python] Allow str arg in match_op_names.
Ingo Müller [Thu, 20 Jul 2023 09:58:41 +0000 (09:58 +0000)]
[mlir][transform][structured][python] Allow str arg in match_op_names.

Allow the `names` argument in `MatchOp.match_op_names` to be of type
`str` in addition to `Sequence[str]`. In this case, the argument is
treated as a list with one name, i.e., it is possible to write
`MatchOp.match_op_names(..., "test.dummy")` instead of
`MatchOp.match_op_names(..., ["test.dummy"])`.

Reviewed By: ftynse

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

12 months ago[mlir][linalg][transform] Extend diagnostics of FuseIntoContainingOp.
Ingo Müller [Thu, 20 Jul 2023 08:57:22 +0000 (08:57 +0000)]
[mlir][linalg][transform] Extend diagnostics of FuseIntoContainingOp.

This patch extends the diagnostic output of `FuseIntoContainingOp` when
it fails to find the next producer by also provided the location of the
affected transform op.

Reviewed By: ftynse

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

12 months ago[mlir][nvgpu] Add `tma.create.descriptor` to create tensor map descriptor
Guray Ozen [Fri, 21 Jul 2023 09:12:56 +0000 (11:12 +0200)]
[mlir][nvgpu] Add `tma.create.descriptor` to create tensor map descriptor

The Op creates a tensor map descriptor object representing tiled memory region. The descriptor is used by Tensor Memory Access (TMA). The `tensor` is the source tensor to be tiled. The `boxDimensions` is the size of the tiled memory region in each dimension.

The pattern here lowers `tma.create.descriptor` to a runtime function call that eventually calls calls CUDA Driver's `cuTensorMapEncodeTiled`. For more information see below:
https://docs.nvidia.com/cuda/cuda-driver-api/group__CUDA__TENSOR__MEMORY.html

Depends on D155453

Reviewed By: nicolasvasilache

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

12 months ago[RISCV] Add SDNode patterns for vrol.[vv,vx] and vror.[vv,vx,vi]
Luke Lau [Mon, 17 Jul 2023 11:11:21 +0000 (12:11 +0100)]
[RISCV] Add SDNode patterns for vrol.[vv,vx] and vror.[vv,vx,vi]

These correspond to ROTL/ROTR nodes

Reviewed By: craig.topper

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

12 months ago[mlir][test] Add missing LIT config for `mlir-cpu-config` + emulator
Andrzej Warzynski [Fri, 21 Jul 2023 07:25:12 +0000 (07:25 +0000)]
[mlir][test] Add missing LIT config for `mlir-cpu-config` + emulator

Similarly to when using `lli`, make sure that when using
`mlir-cpu-runner` with an emulator, a full path to `mlir-cpu-runner` is
used. Otherwise `mlir-cpu-runner` won't be found and you will get the
following error:
```
Error while loading mlir-cpu-runner: No such file or directory
```

This patch should fix:
  * https://lab.llvm.org/buildbot/#/builders/179
The breakage was originally introduced in
https://reviews.llvm.org/D155405.

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

12 months ago[mlir] allow region branch spec from parent op to itself
Alex Zinenko [Thu, 20 Jul 2023 12:24:44 +0000 (12:24 +0000)]
[mlir] allow region branch spec from parent op to itself

RegionBranchOpInterface did not allow the operation with regions to
specify itself as successors. Therefore, this implied that the control
is always transferred to a region before being transferred back to the
parent op. Since the region can only transfer the control back to the
parent op from a terminator, this transitively implied that the first
block of any region with a RegionBranchOpInterface is always executed
until the terminator can transfer the control flow back. This is
trivially false for any conditional-like operation that may or may not
execute the region, as well as for loop-like operations that may not
execute the body.

Remove the restriction from the interface description and update the
only transform that relied on it.

See
https://discourse.llvm.org/t/rfc-region-control-flow-interfaces-should-encode-region-not-executed-correctly/72103.

Depends On: https://reviews.llvm.org/D155757

Reviewed By: Mogball, springerm

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

12 months ago[mlir] allow dense dataflow to customize call and region operations
Alex Zinenko [Wed, 19 Jul 2023 21:58:01 +0000 (21:58 +0000)]
[mlir] allow dense dataflow to customize call and region operations

Initial implementations of dense dataflow analyses feature special cases
for operations that have region- or call-based control flow by
leveraging the corresponding interfaces. This is not necessarily
sufficient as these operations may influence the dataflow state by
themselves as well we through the control flow. For example,
`linalg.generic` and similar operations have region-based control flow
and their proper memory effects, so any memory-related analyses such as
last-writer require processing `linalg.generic` directly instead of, or
in addition to, the region-based flow.

Provide hooks to customize the processing of operations with region-
cand call-based contol flow in forward and backward dense dataflow
analysis. These hooks are trigerred when control flow is transferred
between the "main" operation, i.e. the call or the region owner, and
another region. Such an apporach allows the analyses to update the
lattice before and/or after the regions. In the `linalg.generic`
example, the reads from memory are interpreted as happening before the
body region and the writes to memory are interpreted as happening after
the body region. Using these hooks in generic analysis may require
introducing additional interfaces, but for now assume that the specific
analysis have spceial cases for the (rare) operaitons with call- and
region-based control flow that need additional processing.

Reviewed By: Mogball, phisiart

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

12 months ago[RISCV] Remove VPatBinaryExtVL_WV_WX multiclass. NFC
Luke Lau [Thu, 20 Jul 2023 11:59:13 +0000 (12:59 +0100)]
[RISCV] Remove VPatBinaryExtVL_WV_WX multiclass. NFC

It's no longer needed now that the sext/zext patterns have been merged.

Reviewed By: craig.topper

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

12 months ago[RISCV] Add patterns for vnsr[a,l].wx where shift amount has different type than...
Luke Lau [Wed, 19 Jul 2023 13:13:50 +0000 (14:13 +0100)]
[RISCV] Add patterns for vnsr[a,l].wx where shift amount has different type than vector element

We're currently only matching scalar shift amounts where the type is the same
as the vector element type. But because only the bottom log2(2*SEW) bits are
used, only 7 bits will be used at most so we can use any scalar type >= i8.

This patch adds patterns for the case above, as well as for when the shift
amount type is the same as the widened element type and doesn't need extended.

Reviewed By: craig.topper

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

12 months ago[RISCV] Add tests for vnsr[l,a].wx patterns that could be matched
Luke Lau [Wed, 19 Jul 2023 12:18:36 +0000 (13:18 +0100)]
[RISCV] Add tests for vnsr[l,a].wx patterns that could be matched

These patterns of ([l,a]shr v, ([s,z]ext splat)) only pick up the cases where
the scalar has the same type as the vector element. However since only the low
log2(SEW) bits of the scalar are read, we could use any scalar type that has
been extended.

Reviewed By: craig.topper

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

12 months ago[SystemZ] Allow symbols in immediate asm operands
Ilya Leoshkevich [Thu, 20 Jul 2023 08:11:24 +0000 (10:11 +0200)]
[SystemZ] Allow symbols in immediate asm operands

Currently mentioning any symbols in immediate asm operands is not
supported, for example:

    error: invalid operand for instruction
    lghi %r4,foo_end-foo

The immediate problem is that is*Imm() and print*Operand() functions do
not accept MCExprs, but simply relaxing these checks is not enough:
after symbol addresses are computed, range checks need to run against
resolved values.

Add a number of SystemZ::FixupKind members for each kind of immediate
value and process them in SystemZMCAsmBackend::applyFixup(). Only
perform the range checks, do not change anything.

Adjust the tests: move previously failing cases like the one shown
above out of insn-bad.s.

Reviewed By: uweigand

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

12 months ago[mlir] Fix bazel build after b96bd025b35761ae181da7e1796708c46e59f5d5
Alexander Belyaev [Fri, 21 Jul 2023 09:08:44 +0000 (11:08 +0200)]
[mlir] Fix bazel build after b96bd025b35761ae181da7e1796708c46e59f5d5

12 months ago[Clang] Fix constraint checking of non-generic lambdas.
Corentin Jabot [Mon, 3 Jul 2023 17:02:24 +0000 (19:02 +0200)]
[Clang] Fix constraint checking of non-generic lambdas.

A lambda call operator can be a templated entity -
and therefore have constraints while not being a function template

   template<class T> void f() {
     []() requires false { }();
   }

In that case, we would check the constraints of the call operator
which is non-viable. However, we would find a viable candidate:
the conversion operator to function pointer, and use it to
perform a surrogate call.
These constraints were not checked because:
 * We never check the constraints of surrogate functions
 * The lambda conversion operator has non constraints.

From the wording, it is not clear what the intent is but
it seems reasonable to expect the constraints of the lambda conversion
operator to be checked and it is consistent with GCC and MSVC.

This patch also improve the diagnostics for constraint failure
on surrogate calls.

Fixes #63181

Reviewed By: #clang-language-wg, aaron.ballman

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

12 months ago[X86] Expand constant expressions in test (NFC)
Nikita Popov [Fri, 21 Jul 2023 08:39:45 +0000 (10:39 +0200)]
[X86] Expand constant expressions in test (NFC)

12 months ago[mlir][nvgpu] Improve finding module Op to for `mbarrier.create`
Guray Ozen [Fri, 21 Jul 2023 08:36:29 +0000 (10:36 +0200)]
[mlir][nvgpu] Improve finding module Op to for `mbarrier.create`

Current transformation expects module op to be two level higher, however, it is not always the case. This work searches module op in a while loop.

Reviewed By: nicolasvasilache

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

12 months ago[mlir][nvgpu] Add nvgpu.tma.async.load and nvgpu.tma.descriptor
Guray Ozen [Thu, 20 Jul 2023 11:56:11 +0000 (13:56 +0200)]
[mlir][nvgpu] Add nvgpu.tma.async.load and nvgpu.tma.descriptor

This work adds `nvgpu.tma.async.load` Op that requests tma load asyncronusly using mbarrier object.

It also creates nvgpu.tma.descriptor type. The type is supposed be created by `cuTensorMapEncodeTiled` cuda drivers api.

Reviewed By: nicolasvasilache

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

12 months ago[mlir] remove RegionBranchOpInterface from linalg ops
Alex Zinenko [Thu, 20 Jul 2023 13:53:51 +0000 (13:53 +0000)]
[mlir] remove RegionBranchOpInterface from linalg ops

Linalg structure ops do not implement control flow in the way expected
by RegionBranchOpInterface, and the interface implementation isn't
actually used anywhere. The presence of this interface without correct
implementation is confusing for, e.g., dataflow analyses.

Reviewed By: springerm

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

12 months ago[LoopIdiom] Regenerate test checks (NFC)
Nikita Popov [Fri, 21 Jul 2023 08:12:05 +0000 (10:12 +0200)]
[LoopIdiom] Regenerate test checks (NFC)

12 months ago[InstCombine] Regenerate test checks (NFC)
Nikita Popov [Fri, 21 Jul 2023 08:11:35 +0000 (10:11 +0200)]
[InstCombine] Regenerate test checks (NFC)

12 months agoReapply [IR] Mark and constant expressions as undesirable
Nikita Popov [Thu, 20 Jul 2023 12:31:18 +0000 (14:31 +0200)]
Reapply [IR] Mark and constant expressions as undesirable

Reapply after fixing an issue in canonicalizeLogicFirst() exposed
by this change (218f97578b26f7a89f7f8ed0748c31ef0181f80a).

-----

In preparation for removing support for and expressions, mark them
as undesirable. As such, we will no longer implicitly create such
expressions, but they still exist.

12 months ago[bazel] add missing dep for llvm/unittests:frontend_tests
Haojian Wu [Fri, 21 Jul 2023 08:09:44 +0000 (10:09 +0200)]
[bazel] add missing dep for llvm/unittests:frontend_tests

12 months ago[IR] Accept non-Instruction in BinaryOperator::CreateWithCopiedFlags() (NFC)
Nikita Popov [Fri, 21 Jul 2023 07:58:22 +0000 (09:58 +0200)]
[IR] Accept non-Instruction in BinaryOperator::CreateWithCopiedFlags() (NFC)

The underlying copyIRFlags() API accepts arbitrary values and can
work with flags on operators (i.e. instructions or constant
expressions). Remove the arbitrary limitation that the
CreateWithCopiedFlags() API imposes, so we can directly pass through
values matched by PatternMatch, which can be constant expressions.

The attached test case works fine now, but would crash with an
upcoming change to not produce and constant expressions.

12 months ago[AArch64] Basic vector bswap costs
David Green [Fri, 21 Jul 2023 07:48:53 +0000 (08:48 +0100)]
[AArch64] Basic vector bswap costs

This adds some basic vector bswap costs, providing the type is supported.

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

12 months ago[NFC] Remove needless nullchecks.
Sindhu Chittireddy [Wed, 12 Jul 2023 18:01:19 +0000 (11:01 -0700)]
[NFC] Remove needless nullchecks.

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

12 months ago[llvm-exegesis] Guard `__builtin_thread_pointer` behind a configure check
Markus Böck [Fri, 21 Jul 2023 05:43:43 +0000 (07:43 +0200)]
[llvm-exegesis] Guard `__builtin_thread_pointer` behind a configure check

Due to arguably a bug in GCC[0], using `__has_builtin` is not sufficient to check whether `__builtin_thread_pointer` can actually be compiled by GCC. This makes it impossible to compile LLVM with `llvm-exegesis` enabled with e.g. GCC 10 as it does have the builtin, but no implementation for architectures such as x86.

This patch works around this issue by making it a cmake configure check whether the builtin can be compiled and used, rather than relying on the broken preprocessor macro.

[0] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96952, demonstration: https://godbolt.org/z/9z5nWM6Ef

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

12 months ago[mlir] Add opt-in default property bytecode read and write implementation
Markus Böck [Fri, 21 Jul 2023 05:40:10 +0000 (07:40 +0200)]
[mlir] Add opt-in default property bytecode read and write implementation

Using properties currently requires at the very least implementing four methods/code snippets:
* `convertToAttribute`
* `convertFromAttribute`
* `writeToMlirBytecode`
* `readFromMlirBytecode`

This makes replacing attributes with properties harder than it has to be: Attributes by default do not require immediately defining custom bytecode encoding.

This patch therefore adds opt-in implementations of `writeToMlirBytecode` and `readFromMlirBytecode` that work with the default implementations of `convertToAttribute` and `convertFromAttribute`. They are provided by `defvar`s in `OpBase.td` and can be used by adding:
```
let writeToMlirBytecode = writeMlirBytecodeWithConvertToAttribute;
let readFromMlirBytecode = readMlirBytecodeUsingConvertFromAttribute;
```
to ones TableGen definition.

While this bytecode encoding is almost certainly not ideal for a given property, it allows more incremental use of properties and getting something sane working before optimizing the bytecode format.

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

12 months ago[gn build] Port c3648f37d0ed
LLVM GN Syncbot [Fri, 21 Jul 2023 05:54:11 +0000 (05:54 +0000)]
[gn build] Port c3648f37d0ed

12 months ago[libc++][hardening] Don't trigger uncategorized assertions in the hardened mode.
varconst [Fri, 21 Jul 2023 05:50:37 +0000 (22:50 -0700)]
[libc++][hardening] Don't trigger uncategorized assertions in the hardened mode.

The hardened mode is intended to only include security-critical,
relatively low-overhead checks that are intended to be usable in
production. By default, assertions are excluded from this mode.

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

12 months ago[libc++][ranges] Implement `ranges::to`.
varconst [Sat, 15 Jul 2023 03:54:38 +0000 (20:54 -0700)]
[libc++][ranges] Implement `ranges::to`.

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

12 months ago[modularize] Stabilize iteration order when processing module maps
Fangrui Song [Fri, 21 Jul 2023 05:44:23 +0000 (22:44 -0700)]
[modularize] Stabilize iteration order when processing module maps

Many diagnostics (e.g., ProblemsDuplicate.modularize,
ProblemsDisplayLists.modularize) are dependent on the iteration order of
StringMap, which is not guaranteed to be deterministic
(https://llvm.org/docs/ProgrammersManual.html#llvm-adt-stringmap-h).
clang::ModuleMap::Modules is a StringMap. For now, sort by name in
modularize.

12 months agoSarif: stabilize artifacts order
Fangrui Song [Fri, 21 Jul 2023 04:37:50 +0000 (21:37 -0700)]
Sarif: stabilize artifacts order

StringMap iteration order is not guaranteed to be deterministic
(https://llvm.org/docs/ProgrammersManual.html#llvm-adt-stringmap-h).

12 months ago[Driver] -fopenmp-targets=: stabilize OrderedOffloadingToolchains value order
Fangrui Song [Fri, 21 Jul 2023 04:17:04 +0000 (21:17 -0700)]
[Driver] -fopenmp-targets=: stabilize OrderedOffloadingToolchains value order

to make actions deterministic.
StringSet iteration order is not guaranteed to be deterministic
(https://llvm.org/docs/ProgrammersManual.html#llvm-adt-stringmap-h).

12 months ago[lldb] Fix -Wreturn-type in RegisterInfos_x86_64_with_base_shared.cpp (NFC)
Jie Fu [Fri, 21 Jul 2023 03:41:28 +0000 (11:41 +0800)]
[lldb] Fix -Wreturn-type in RegisterInfos_x86_64_with_base_shared.cpp (NFC)

/data/llvm-project/lldb/source/Plugins/Process/Utility/RegisterInfos_x86_64_with_base_shared.cpp:319:1: error: non-void function does
not return a value in all control paths [-Werror,-Wreturn-type]
}
^
1 error generated.

12 months ago[RISCV] precommit for removing useless copy from undef subreg
Piyou Chen [Fri, 21 Jul 2023 03:19:02 +0000 (20:19 -0700)]
[RISCV] precommit for removing useless copy from undef subreg

testcase from https://github.com/llvm/llvm-project/issues/63554

Reviewed By: kito-cheng

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

12 months ago[clang] fix for D155342
Nick Desaulniers [Fri, 21 Jul 2023 03:30:37 +0000 (20:30 -0700)]
[clang] fix for D155342

12 months ago[clang][JumpDiagnostics] ignore non-asm goto target scopes
Nick Desaulniers [Fri, 21 Jul 2023 02:58:17 +0000 (19:58 -0700)]
[clang][JumpDiagnostics] ignore non-asm goto target scopes

The current behavior of JumpScopeChecker::VerifyIndirectOrAsmJumps was
to cross validate the scope of every jumping statement (goto, asm goto)
against the scope of every label (even if the label was not even a
possible target of the asm goto).

When we have multiple asm goto's with unique targets, we could trigger
false positive build errors complaining that labels that weren't even in
the asm goto's label list could not be jumped to.  Example:

    error: cannot jump from this asm goto statement to one of its possible targets
    asm goto(""::::foo);
    note: possible target of asm goto statement
    bar:
    ^

Fixes: https://github.com/ClangBuiltLinux/linux/issues/1886

Reviewed By: void, jyu2, rjmccall

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

12 months ago[llvm][utils] Use literal type name for non-template data formatters (NFC)
Dave Lee [Tue, 11 Jul 2023 18:24:31 +0000 (11:24 -0700)]
[llvm][utils] Use literal type name for non-template data formatters (NFC)

These don't need to be regex.

12 months ago[lldb] Delete unused LibcxxOptionalSummaryProvider (NFC)
Dave Lee [Fri, 14 Jul 2023 17:25:24 +0000 (10:25 -0700)]
[lldb] Delete unused LibcxxOptionalSummaryProvider (NFC)

No longer needed following refactoring in D115178.

12 months ago[lldb] Identify Swift-implemented ObjC classes
Dave Lee [Tue, 11 Jul 2023 20:20:49 +0000 (13:20 -0700)]
[lldb] Identify Swift-implemented ObjC classes

Classes implemented in Swift can be exposed to ObjC. For those classes, the ObjC
metadata is incomplete. Specifically, the encoded types of the ivars are incomplete. As
one might expect, the Swift metadata _is_ complete. In such cases, the Swift runtime
should be consulted when determining the dynamic type of a value.

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

12 months ago[BOLT] Improve Linux Kernel ORC reader
Maksim Panchenko [Wed, 19 Jul 2023 23:55:32 +0000 (16:55 -0700)]
[BOLT] Improve Linux Kernel ORC reader

  * Sort ORC entries in the internal table. Older Linux kernels did not
    sort them in the file (only during boot time).
  * Add an option to dump sorted ORC tables (--dump-orc).
  * Associate entries in the internal ORC table with a BinaryFunction
    even when we are not changing the function.
  * If the function doesn't have ORC entry at the start, propagate ORC
    state from a previous entry.

Reviewed By: Amir

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

12 months ago[llvm-profdata] Stabilize iteration order for InstrProfWriter
Fangrui Song [Fri, 21 Jul 2023 01:31:41 +0000 (18:31 -0700)]
[llvm-profdata] Stabilize iteration order for InstrProfWriter

If two functions are inserted to the same bucket, their order in the
serialized profile is dependent on StringMap iteration order, which is
not guaranteed to be deterministic.
(https://llvm.org/docs/ProgrammersManual.html#llvm-adt-stringmap-h).
Use a sort like we do in writeText.

12 months ago[libc++][hardening][NFC] Rename `HardenedMode.rst` to `Hardening.rst`.
Konstantin Varlamov [Fri, 21 Jul 2023 00:41:37 +0000 (17:41 -0700)]
[libc++][hardening][NFC] Rename `HardenedMode.rst` to `Hardening.rst`.

This addresses a comment from https://reviews.llvm.org/D154997.

12 months ago[RISCV] Expand memset.inline test coverage [nfc]
Philip Reames [Thu, 20 Jul 2023 23:46:45 +0000 (16:46 -0700)]
[RISCV] Expand memset.inline test coverage [nfc]

Add coverage for unaligned overlap cases, and for vector stores.

Note that the vector memset here is coming from store combining, not memset lowering.

12 months ago[clang][test] Remove unused variable 'SM' (NFC)
Jie Fu [Thu, 20 Jul 2023 23:59:30 +0000 (07:59 +0800)]
[clang][test] Remove unused variable 'SM' (NFC)

/data/llvm-project/clang/unittests/AST/DeclTest.cpp:153:18: error: unused variable 'SM' [-Werror,-Wunused-variable]
  SourceManager &SM = Ctx.getSourceManager();
                 ^
1 error generated.

12 months agoAMDGPU: Add flag to disable fdiv processing in IR pass
Matt Arsenault [Wed, 19 Jul 2023 12:39:05 +0000 (08:39 -0400)]
AMDGPU: Add flag to disable fdiv processing in IR pass

We kind of have to have multiple implementations of fdiv split between
the two selectors with some pre-processing. Add yet another test to
check for consistency of interpretation of flag combinations. We have
quite a bit of test redundancy here already, but there are so many
possible interesting permutations it's unwieldy to cover every detail
in any one of them. We have a number of overlapping fdiv tests but
it's hard to follow everything going on as it is.

12 months agoAMDGPU: Expand rsq testing to cover contract flag
Matt Arsenault [Mon, 17 Jul 2023 15:11:25 +0000 (11:11 -0400)]
AMDGPU: Expand rsq testing to cover contract flag

The 1.0/sqrt(x) -> rsq(x) fold increases precision and probably needs
a contract flag.

12 months ago[gn build] Port 49b3c3355f9c
LLVM GN Syncbot [Thu, 20 Jul 2023 23:36:14 +0000 (23:36 +0000)]
[gn build] Port 49b3c3355f9c

12 months ago[clang] adds `conceptDecl` as an ASTMatcher
Christopher Di Bella [Thu, 20 Jul 2023 22:31:48 +0000 (22:31 +0000)]
[clang] adds `conceptDecl` as an ASTMatcher

Closes #63934

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

12 months ago[lldb][x86_64] Support fs_base/gs_base register in Linux
Jeffrey Tan [Mon, 17 Jul 2023 23:15:06 +0000 (16:15 -0700)]
[lldb][x86_64] Support fs_base/gs_base register in Linux

Summary:
[lldb][x86_64] This patch adds fs_base/gs_base support for Linux x86_64.

Originally, I plan to split the diff into two parts, one to refactoring lldb_xxx_x86_64 => x86_64::lldb_xxx across code base and the other one for adding fs_base/gs_base, but it turns out to be a non-trivial effort to split and very error prone so I decided to keep a single diff to get feedback.

GDB supports fs_base/gs_base registers while LLDB does not. Since both linux coredump note section and ptrace
supports them it is a missing feature.

For context, this is a required feature to support getting pthread pointer on linux from both live and dump debugging.
See thread below for details:
https://discourse.llvm.org/t/how-to-get-pthread-pointer-from-lldb/70542/2?u=jeffreytan81

Implementation wise, we have initially tried `#ifdef` approach to reuse the code but it is introducing very tricky bugs and proves
hard to maintain. Instead the diff completely separates the registers between x86_64 and x86_64_with_base so that non-linux related
implementations can use x86_64 registers while linux uses x86_64_with_base.
Here are the list of changes done in the patch:
* Registers in lldb-x86-register-enums.h are separated into two: x86_64 and x86_64_with_base
* fs_base/gs_base are added into x86_64_with_base
* All linux files are change to use x86_64::lldb_xxx => x86_64_with_base::lldb_xxx
* Support linux elf-core:
* A new RegisterContextLinuxCore_x86_64 class is added for ThreadElfCore
* RegisterContextLinuxCore_x86_64 overrides and uses its own register set supports fs_base/gs_base
* RegisterInfos_x86_64_with_base/RegisterInfos_x86_64_with_base_shared ared added to provide g_contained_XXX/g_invalidate_XXX and RegInfo related code sharing.
* `RegisterContextPOSIX_x86 ::m_gpr_x86_64` seems to be unused so I removed it.
* `NativeRegisterContextDBReg_x86::GetDR()` is overridden in `NativeRegisterContextLinux_x86_64` to make watchpoint work.

Reviewers:clayborg,labath,jingham,jdoerfert,JDevlieghere,kusmour,GeorgeHuyubo

Subscribers:

Tasks:

Tags:

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

12 months agoAMDGPU: Fold fsub [+-0] into fneg when folding source modifiers
Matt Arsenault [Tue, 18 Jul 2023 21:46:31 +0000 (17:46 -0400)]
AMDGPU: Fold fsub [+-0] into fneg when folding source modifiers

This isn't always folded to fneg for a freestanding fsub depending on
the denormal mode. When matching source modifiers, we're implicitly
canonicalizing the input so we can fold it here.

Doesn't bother handling the VOP3P case since it's only relevant with
DAZ, which nobody really uses with f16.

For f64, tests show an existing bug where DAGCombiner tries to respect
the denormal mode for fsub -0, x, but not after it's lowered to fadd
-0, (fneg x). Either the fold is wrong or we shouldn't restrict the
fsub case based on the denormal mode.

https://reviews.llvm.org/D155652

12 months agoAMDGPU: Regenerate test checks
Matt Arsenault [Thu, 20 Jul 2023 23:11:23 +0000 (19:11 -0400)]
AMDGPU: Regenerate test checks

Mostly a workaround for recent reverts in update_test_checks

12 months ago[mlir][sparse] Improve `DimLvlMapParser`'s handling of variable bindings
wren romano [Wed, 19 Jul 2023 23:55:22 +0000 (16:55 -0700)]
[mlir][sparse] Improve `DimLvlMapParser`'s handling of variable bindings

This commit comprises a number of related changes:

(1) Reintroduces the semantic distinction between `parseVarUsage` vs `parseVarBinding`, adds documentation explaining the distinction, and adds commentary to the one place that violates the desired/intended semantics.

(2) Improves documentation/commentary about the forward-declaration of level-vars, and about the meaning of the `bool` parameter to `parseLvlSpec`.

(2) Removes the `VarEnv::addVars` method, and instead has `DimLvlMapParser` handle the conversion issues directly.  In particular, the parser now stores and maintains the `{dims,lvls}AndSymbols` arrays, thereby avoiding the O(n^2) behavior of scanning through the entire `VarEnv` for each `parse{Dim,Lvl}Spec` call.  Unfortunately there still remains another source of O(n^2) behavior, namely: the `AsmParser::parseAffineExpr` method will copy the `DimLvlMapParser::{dims,lvls}AndSymbols` arrays into `AffineParser::dimsAndSymbols` on each `parse{Dim,Lvl}Spec` call; but fixing that would require extensive changes to `AffineParser` itself.

Depends On D155532

Reviewed By: Peiming

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

12 months ago[libc] Fix line reporting in assertion failure
Jon Chesterfield [Thu, 20 Jul 2023 22:44:32 +0000 (23:44 +0100)]
[libc] Fix line reporting in assertion failure

Was passing zeros to the string print function.

Reviewed By: jhuber6

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

12 months agoAMDGPU: Add baseline test for folding fsub into fneg modifiers
Matt Arsenault [Tue, 18 Jul 2023 21:52:35 +0000 (17:52 -0400)]
AMDGPU: Add baseline test for folding fsub into fneg modifiers

12 months agoRemove IncrementFalseAlarmsAndReviseHitCount, unused ivars
Jason Molenda [Thu, 20 Jul 2023 22:14:07 +0000 (15:14 -0700)]
Remove IncrementFalseAlarmsAndReviseHitCount, unused ivars

Reading through the Watchpoint class, I found this method
that wasn't being used properly, and a couple of ivars that
weren't used at all.  Cleanup.

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

12 months agoclang/HIP: Directly use f32 exp and log builtins
Matt Arsenault [Thu, 13 Jul 2023 12:45:46 +0000 (08:45 -0400)]
clang/HIP: Directly use f32 exp and log builtins

These are now lowered correctly by the backend, and you get proper
fast math flags when directly handled.

12 months agoAMDGPU: Filter out contract flags when lowering exp
Matt Arsenault [Thu, 20 Jul 2023 21:43:27 +0000 (17:43 -0400)]
AMDGPU: Filter out contract flags when lowering exp

It is unsafe to contract the fsub into the fmul. It also increases
code size by duplicating a constant.

12 months agoAMDGPU: Add some new baseline tests for exp lowering
Matt Arsenault [Thu, 20 Jul 2023 21:38:25 +0000 (17:38 -0400)]
AMDGPU: Add some new baseline tests for exp lowering

12 months ago[nfc] Renamed ICallPromotionFunc to InidrectCallPromoter
Mircea Trofin [Thu, 20 Jul 2023 21:37:22 +0000 (14:37 -0700)]
[nfc] Renamed ICallPromotionFunc to InidrectCallPromoter

For (subjectively) more clarity; also updated the comment describing it.

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

12 months ago[RISCV] Add memset.inline test coverage with and without V [nfc]
Philip Reames [Thu, 20 Jul 2023 21:59:59 +0000 (14:59 -0700)]
[RISCV] Add memset.inline test coverage with and without V [nfc]

12 months ago[gn build] Port 37e5baf318b1
LLVM GN Syncbot [Thu, 20 Jul 2023 21:50:59 +0000 (21:50 +0000)]
[gn build] Port 37e5baf318b1

12 months ago[libc][NFC] mark vprintf functions as inline
Michael Jones [Thu, 20 Jul 2023 21:47:02 +0000 (14:47 -0700)]
[libc][NFC] mark vprintf functions as inline

The functions are in a header, and so must be marked inline to avoid
symbol conflicts.

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

12 months ago[libc++][PSTL] Implement std::sort
Nikolas Klauser [Thu, 20 Jul 2023 21:45:19 +0000 (14:45 -0700)]
[libc++][PSTL] Implement std::sort

Reviewed By: #libc, ldionne

Spies: ldionne, libcxx-commits, mgrang

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

12 months ago[unittest] Improve OpenMPIRBuilderTest after D149162
Fangrui Song [Thu, 20 Jul 2023 21:37:54 +0000 (14:37 -0700)]
[unittest] Improve OpenMPIRBuilderTest after D149162

Make it less sensitive to omp_offload.info operands order and improve
the failure diagnostic.

Caught by D155789

12 months ago[nfc] small maintainability IndirectCallPromotion changes
Mircea Trofin [Thu, 13 Jul 2023 15:59:41 +0000 (08:59 -0700)]
[nfc] small maintainability IndirectCallPromotion changes

- we can remove the `Module` field, it's obtainable from `F` and used in
  only one place
- a few fields can be `const`-ed, thus enforcing compile-time
  initialization checking (and we don't need to support `operator=`)

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

12 months ago[OpenMP][Reduction] Allow PLUS (+) operator on reduction clauses in OMP > 52
Fazlay Rabbi [Tue, 18 Jul 2023 19:51:53 +0000 (12:51 -0700)]
[OpenMP][Reduction] Allow PLUS (+) operator on reduction clauses in OMP > 52

Currently, clang gives an incorrect reduction identifier error for the PLUS
operator for OpenMP version > 52. But, PLUS operator is allowed in OpenMP
version > 52. This revision fixes this issue and also modified the error
messages to show the correct expected operators in the message based on the OpenMP
version used (prior to OMP 6.0 and since OMP 6.0).

Test Src:
void foo() {
  int a = 0 ;
  #pragma omp parallel reduction(+:a)
    ;
  #pragma omp parallel reduction(-:a)
    ;
}

Before this revision:

$ clang -fopenmp -fopenmp-version=60 test.c -c
test.c:3:34: error: incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'int'
    3 |   #pragma omp parallel reduction(+:a)
      |                                  ^
test.c:5:34: error: incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'int'
    5 |   #pragma omp parallel reduction(-:a)
      |                                  ^
2 errors generated.

Wit this revision:

$  clang -fopenmp -fopenmp-version=60 test.c -c
test.c:5:34: error: incorrect reduction identifier, expected one of '+', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'int'
    5 |   #pragma omp parallel reduction(-:a)
      |
1 error generated.

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

12 months ago[mlir][spirv] Extract more ops from the main implementation file. NFC.
varconst [Thu, 20 Jul 2023 21:11:31 +0000 (17:11 -0400)]
[mlir][spirv] Extract more ops from the main implementation file. NFC.

Continue to work outlined in D155747 and split the main SPIR-V ops
implementation file into a few smaller and quicker to compile files.

Move control flow and memory ops to their own implementation files.
Create new `.cpp` files for tablegened code.

After this change, the `SPIRVOps.cpp` is 2k LoC-long and takes a
reasonable amount of time to compile.

Reviewed By: antiagainst

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

12 months ago[scudo] Clean up tests.
Christopher Ferris [Wed, 19 Jul 2023 20:26:38 +0000 (13:26 -0700)]
[scudo] Clean up tests.

Modify the tests so that all clang warnings can be turned up to high.

Fix all places flagged by -Wconversion.

Fix a few unused variables not marked with UNUSED.

For the memtag testing, only compile some tests for 64 bit since
compiling them on 32 bit leads to warnings/errors. All of the tests
are already skipped on 32 bit OSes, so this will not affect any
real tests.

Reviewed By: Chia-hungDuan

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

12 months agoRevert "[gold] Add preliminary FatLTO support to the Gold plugin"
Paul Kirth [Thu, 20 Jul 2023 20:53:08 +0000 (20:53 +0000)]
Revert "[gold] Add preliminary FatLTO support to the Gold plugin"

This reverts commit 421e4026111315d002879b1e7a0cf3aacd00f488.

One of the test needs a requires line, but we've also seen some issues
for downstream projects that may need coordination, so I'm reverting
this for until we can address those issues. see
https://reviews.llvm.org/D152973#4520240 for context.

12 months ago[RISCV] Revise check names for unaligned memory op tests [nfc]
Philip Reames [Thu, 20 Jul 2023 20:34:22 +0000 (13:34 -0700)]
[RISCV] Revise check names for unaligned memory op tests [nfc]

This has come up a few times in review; the current ones seem to be universally confusing.  Even I as the original author of most of these get confused.  Switch to using the SLOW/FAST naming used by x86, hopefully that's a bit clearer.

12 months ago[Sanitizers][Darwin][Test] XFAIL symbolize_pc test on Darwin/TSan+UBSan
Mariusz Borsa [Thu, 20 Jul 2023 19:54:49 +0000 (12:54 -0700)]
[Sanitizers][Darwin][Test] XFAIL symbolize_pc test on Darwin/TSan+UBSan

12 months ago[libc++] Make sure we use the libdispatch backend on Apple platforms
Louis Dionne [Tue, 18 Jul 2023 22:02:09 +0000 (18:02 -0400)]
[libc++] Make sure we use the libdispatch backend on Apple platforms

The Apple.cmake cache wasn't set up properly, so we wouldn't enable
the libdispatch backend by default on Apple platforms. This patch
fixes the issue and adds a test.

We also need to make various drive-by fixes:
- Drop the usage of std::vector in libdispatch.h to avoid changing
  the transitive includes only on Apple platforms.
- Fix includes
- Use __construct at since construct_at is unavailable in C++17
- Get rid of the (unused) __get_memory_resource function since that
  adds a back-deployment requirement and we don't use it right now.
- Fix bugs in the chunking logic around boundary conditions.

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

12 months ago[libc++][Modules] Make top level modules for all C++ headers with OS/clang versions
Ian Anderson [Wed, 12 Jul 2023 21:23:26 +0000 (14:23 -0700)]
[libc++][Modules] Make top level modules for all C++ headers with OS/clang versions

The headers that include_next compiler and OS headers need to be in different top level modules in order to avoid module cycles. e.g. libc++'s stdlib.h will #include_next stdlib.h from the compiler and then the C library. Either of those are likely to include stddef.h, which will come back up to the libc++ module map and create a module cycle. Putting stdlib.h and stddef.h (and the rest of the C standard library headers) in top level modules resolves this by letting the order go cxx_stdlib_h -> os_stdlib_h -> cxx_stddef_h -> os_stddef_h.

All of those headers' dependencies then need to be moved into top level modules themselves to avoid module cycles between the new top level level cstd modules. This starts to get complicated, as the libc++ C headers, by standard, have to include many of the C++ headers, which include the private detail headers, which are intertwined. e.g. some `__algorithm` headers include `__memory` headers and vice versa.

Make top level modules for all of the libc++ headers to easily guarantee that the modules aren't cyclic.

Add enough module exports to fix `check-cxx` and `run-buildbot generic-modules`.

`__stop_token/intrusive_shared_ptr.h` uses `__atomic/atomic.h` but has no include path to it. Add that include.
`math.h` absorbs `bits/atomic_wide_counter.h` on some platforms that don't have modules, work around that by including `math.h` in `__threading_support`.
<mutex> doesn't actually require threads, there are a few pieces like once_flag that work without threads. Remove the requirement from its module.
AIX is no longer able to support modular builds.

Reviewed By: ldionne, #libc

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

12 months ago[InstCombine] Fold binop of `select` and cast of `select` condition
Antonio Frighetto [Wed, 5 Jul 2023 14:34:09 +0000 (16:34 +0200)]
[InstCombine] Fold binop of `select` and cast of `select` condition

Simplify binary operations, whose operands involve a `select`
instruction and a cast of the `select` condition. Specifically,
the binop is canonicalized into a `select` with folded arguments
as follows:

(Binop (zext C), (select C, T, F))
  -> (select C, (binop 1, T), (binop 0, F))

(Binop (sext C), (select C, T, F))
  -> (select C, (binop -1, T), (binop 0, F))

Proofs: https://alive2.llvm.org/ce/z/c_JwwM

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

12 months ago[InstCombine] Introduce tests for D153963
Antonio Frighetto [Thu, 20 Jul 2023 19:31:28 +0000 (19:31 +0000)]
[InstCombine] Introduce tests for D153963

Introduce test cases for folding binops of
`select` and cast of the `select` condition.

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

12 months ago[ODS] Use Adaptor Trait for Shaped Type Inference
Amanda Tang [Thu, 13 Jul 2023 22:54:30 +0000 (22:54 +0000)]
[ODS] Use Adaptor Trait for Shaped Type Inference

Author inferReturnTypeComponents methods with the Op Adaptor by using the InferShapedTypeOpAdaptor.

Reviewed By: jpienaar

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

12 months agoSpeculatively fix Clang build bots
Aaron Ballman [Thu, 20 Jul 2023 19:10:02 +0000 (15:10 -0400)]
Speculatively fix Clang build bots

This is intended to address the issues found in:
https://lab.llvm.org/buildbot/#/builders/192/builds/3337
https://lab.llvm.org/buildbot/#/builders/124/builds/7968

12 months ago[mlir][test] Add emulator to the mlir-cpu-runner invocation
Andrzej Warzynski [Thu, 20 Jul 2023 18:57:01 +0000 (18:57 +0000)]
[mlir][test] Add emulator to the mlir-cpu-runner invocation

In https://reviews.llvm.org/D146917, MLIR's LIT configuration was
updated to allow us to use `mlir-cpu-runner` to run Arm SVE integration
tests. That update broke the following buildbot that doesn't support
SVE:

  https://lab.llvm.org/buildbot/#/builders/179/builds/6704

While that bot doesn't support SVE, it can run SVE tests under
emulation. This patch makes sure that whenever an Arm emulator is set
(via `RM_EMULATOR_EXECUTABLE` CMake variable), it is used to run both
`lli` _and_ `mlir-cpu-runner`.

I am sending this without a review as it's a rather trivial change and I
want to quickly fix the spurious bot failure.

12 months ago[clang][NFC] Use a more accurate size type in the new operation
CaprYang [Thu, 20 Jul 2023 18:53:56 +0000 (14:53 -0400)]
[clang][NFC] Use a more accurate size type in the new operation

This prevents issues when PointerWidth and the SizeType width are not same.

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

12 months ago[BOLT][DWARF] Replace MD5 with hash_combine
Alexander Yermolovich [Thu, 20 Jul 2023 18:51:06 +0000 (11:51 -0700)]
[BOLT][DWARF] Replace MD5 with hash_combine

Slight performance improvement, based on perf.

Collected on clang-17 built with DWARF4 + split dwarf.
MD5
8:46.50 real,   713.38 user,    64.19 sys,      0 amem, 41933136 mmem
8:27.44 real,   708.55 user,    63.83 sys,      0 amem, 41906576 mmem
8:40.37 real,   724.63 user,    62.56 sys,      0 amem, 42319572 mmem

hash_combine

8:03.99 real,   681.92 user,    60.04 sys,      0 amem, 42459204 mmem
8:02.92 real,   685.20 user,    62.56 sys,      0 amem, 41879164 mmem
7:57.85 real,   690.27 user,    60.12 sys,      0 amem, 41806240 mmem

Reviewed By: maksfb

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

12 months ago[BOLT][DWARF] Fix performance regression running BOLT on binaries build with DWARF4
Alexander Yermolovich [Thu, 20 Jul 2023 18:47:36 +0000 (11:47 -0700)]
[BOLT][DWARF] Fix performance regression running BOLT on binaries build with DWARF4

In one of the previous diffs LocBuffer was changed to pass by value. This lead to
performance regression running BOLT on binaries with DWARF4 split dwarf.

Reviewed By: maksfb

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

12 months ago[mlir][AMDGPU] Define wrappers for WMMA matrix ops
Giuseppe Rossini [Thu, 20 Jul 2023 18:24:03 +0000 (18:24 +0000)]
[mlir][AMDGPU] Define wrappers for WMMA matrix ops

Wave Matrix Multiply Accumulate (WMMA) is the instruction to accelerate
matrix multiplication on RDNA3 architectures.  LLVM already provides a
set of intrinsics to generate wmma instructions. This change uses those
intrinsics to enable the feature in MLIR.

Reviewed By: krzysz00

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

12 months ago[libc++][NFC] Fix synopsis comments in cout tests
Louis Dionne [Thu, 20 Jul 2023 18:13:12 +0000 (14:13 -0400)]
[libc++][NFC] Fix synopsis comments in cout tests

12 months ago[libc] Move printf writer to new design
Michael Jones [Tue, 27 Jun 2023 20:12:15 +0000 (13:12 -0700)]
[libc] Move printf writer to new design

The new printf writer design focuses on optimizing the fast path. It
inlines any write to a buffer or string, and by handling buffering
itself can more effectively work with both internal and external file
implementations. The overflow hook should allow for expansion to
asprintf with minimal extra code.

Reviewed By: sivachandra

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

12 months ago[wasm-ld] Switch to xxh3_64bits
Fangrui Song [Thu, 20 Jul 2023 17:47:47 +0000 (10:47 -0700)]
[wasm-ld] Switch to xxh3_64bits

Similar to recent changes to ELF (e.g., D154813), Mach-O, and COFF to
improve hashing performance.

Reviewed By: dschuff

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

12 months agoChange a test case to be more generic; NFC
Aaron Ballman [Thu, 20 Jul 2023 17:27:39 +0000 (13:27 -0400)]
Change a test case to be more generic; NFC

This amends 4a100690461022625dc5d2a21e2e028a926149d9 to address the
issue found by:
https://lab.llvm.org/buildbot/#/builders/188/builds/32658

12 months ago[lldb] Skip unsupported CTF types
Jonas Devlieghere [Sat, 15 Jul 2023 00:06:12 +0000 (17:06 -0700)]
[lldb] Skip unsupported CTF types

This ensures we we don't crash when parsing a type that references an
unsupported type.

12 months ago[flang][hlfir] Avoid expr buffer reuse when end_associate may cycle.
Slava Zakharin [Thu, 20 Jul 2023 16:31:38 +0000 (09:31 -0700)]
[flang][hlfir] Avoid expr buffer reuse when end_associate may cycle.

If end_associate may execute more times than the expr value producer,
then it cannot take ownership of the expr buffer. Otherwise, it may
result in double-free errors.
Note that the LIT test exposes a different issue with fir.alloca
inside the do-loop produced for hlfir.elemental. This may cause
out-of-stack conditions in valid Fortran programs that are not expected
to run out of stack. I will create an issue for this.

Reviewed By: tblah

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

12 months ago[libc++][hardening] Categorize most assertions inside the container classes.
varconst [Thu, 20 Jul 2023 17:13:54 +0000 (10:13 -0700)]
[libc++][hardening] Categorize most assertions inside the container classes.

This introduces:
- `_LIBCPP_ASSERT_VALID_INPUT_RANGE`;
- `_LIBCPP_ASSERT_VALID_CONTAINER_ACCESS`;
- `_LIBCPP_ASSERT_VALID_ITERATOR_ACCESS`;
- `_LIBCPP_ASSERT_VALID_ALLOCATOR`;
- `_LIBCPP_ASSERT_INTERNAL`.

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

12 months ago[test][llvm-reduce] Remove implicit-check-not in reduce-linkage.ll
Arthur Eubanks [Thu, 20 Jul 2023 17:06:24 +0000 (10:06 -0700)]
[test][llvm-reduce] Remove implicit-check-not in reduce-linkage.ll

Or else if the test path contains "internal" the test will fail.

The test is already testing that "internal" gets removed in the CHECK lines.