platform/upstream/llvm.git
15 months ago[mlir][llvm] Import pointer data layout specification.
Tobias Gysi [Fri, 31 Mar 2023 11:45:21 +0000 (11:45 +0000)]
[mlir][llvm] Import pointer data layout specification.

The revision moves the data layout parsing into a separate file
and extends it to support pointer data layout specifications.
Additionally, it also produces more precise warnings and error
messages.

Reviewed By: Dinistro, definelicht

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

15 months ago[InstCombine] Remove min/max special case when folding into select
Nikita Popov [Fri, 31 Mar 2023 11:46:16 +0000 (13:46 +0200)]
[InstCombine] Remove min/max special case when folding into select

Now that we canonicalize to min/max intrinsics, we no longer need
to guard against this here.

In fact, it seems like the issue from PR46271 was the final push
for introducing the intrinsics in the first place...

15 months ago[Matrix] Add special case dot product lowering
Vir Narula [Fri, 31 Mar 2023 11:40:04 +0000 (12:40 +0100)]
[Matrix] Add special case dot product lowering

Add special case to matrix lowering for dot products. Normal matrix lowering if optimized for either row-major or column-major, which results in many `shufflevector` instructions being generated for one vector. We work around this in our special case. We can also use vector-reduce adds instead of sequential adds to sum the result of the element-wise multiplication, which takes advantage of SIMD instructions.

Reviewed By: fhahn, thegameg

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

15 months ago[Assignment Tracking] Enable by default
OCHyams [Fri, 31 Mar 2023 11:22:02 +0000 (12:22 +0100)]
[Assignment Tracking] Enable by default

See https://discourse.llvm.org/t/rfc-enable-assignment-tracking/69399

This sets the `-Xclang -fexperimental-assignment-tracking` flag to the value
`enabled` which means it will be enabled so long as none of the following are
true: it's an LTO build, LLDB debugger tuning has been specified, or it's an O0
build (no work is done in any case if -g is not specified or -gmlt is used).

Reviewed By: jmorse

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

15 months ago[Assignment Tracking][SROA] Handle DIArgList in migrateDebugInfo
OCHyams [Fri, 31 Mar 2023 11:06:35 +0000 (12:06 +0100)]
[Assignment Tracking][SROA] Handle DIArgList in migrateDebugInfo

If the to-be-split dbg.assign has a `DIArgList` and a new `Value` has been
requested then use a kill-location for the new dbg.assign. We can't simply
replace the value component (a `DIArgList`) with the new `Value` as that would
leave the `DIExpression` in an invalid state (`DW_OP_LLVM_arg` operands with no
arglist).

Reviewed By: jmorse

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

15 months ago[InstCombine] Regenerate test checks (NFC)
Nikita Popov [Fri, 31 Mar 2023 11:29:43 +0000 (13:29 +0200)]
[InstCombine] Regenerate test checks (NFC)

15 months ago[Matrix] Update most dot tests using vXi64 to vXi32.
Florian Hahn [Fri, 31 Mar 2023 11:32:40 +0000 (12:32 +0100)]
[Matrix] Update most dot tests using vXi64 to vXi32.

Update dot-product-int.ll tests to use mostly i32 instead of i64;
there's no mul.2d instruction, so vector versions of v2i64 cannot be
lowered efficiently.

15 months ago[clang][Interp] Fix record initialization via CallExpr subclasses
Timm Bäder [Sat, 14 Jan 2023 18:24:49 +0000 (19:24 +0100)]
[clang][Interp] Fix record initialization via CallExpr subclasses

We can't just use VisitCallExpr() here, as that doesn't handle CallExpr
subclasses such as CXXMemberCallExpr.

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

15 months ago[Orc] Drop arch check in the DebugObjectManagerPlugin for ELF
Stefan Gränitz [Fri, 31 Mar 2023 10:48:16 +0000 (12:48 +0200)]
[Orc] Drop arch check in the DebugObjectManagerPlugin for ELF

Tested this with the new AArch32 backend on armv7l and it works without issues in GDB. The size of the load-address field is only 32-bit here, but we implicitly account for it by writing a ELFT::uint which is:
https://github.com/llvm/llvm-project/blob/release/16.x/llvm/include/llvm/Object/ELFTypes.h#L57

So, instead of adding a newly supported machine type, let's just drop this restriction althogether.

15 months ago[MLIR][OpenMP][Flang] Set OpenMP target attributes in MLIR module
Dominik Adamski [Thu, 30 Mar 2023 13:42:53 +0000 (08:42 -0500)]
[MLIR][OpenMP][Flang] Set OpenMP target attributes in MLIR module

Scope of changes:
  1) Add attribute to OpenMP MLIR dialect which stores target cpu and
     target features
  2) Store target information in MLIR module

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

Reviewed By: kiranchandramohan

Co-authored-by: Kiran Chandramohan <kiran.chandramohan@arm.com>
15 months ago[mlir] Use GenericAdaptor to simplify 1:N type conversion API.
Ingo Müller [Thu, 30 Mar 2023 12:40:46 +0000 (12:40 +0000)]
[mlir] Use GenericAdaptor to simplify 1:N type conversion API.

For 1:N type conversion, there is a 1:N relationship between the
original operands and the converted operands. The same is true for the
results. The previous design passed an instance of a "mapping" class
into each pattern that helped with handling this 1:N correspondance.
However, this was still rather manual and, in particular, it required
the use of magic constants for the indices of the different operands.

This commits uses the generated GenericAdaptor class that is generated
for each op class in order to simplify this relationship further. The
GenericAdaptor allows to wrap around a list of arbitrary types for each
operand (via templating); for 1:N type conversion, this allows the
operand accessors of the adaptor class to return a ValueRange that
corresponds to the N values in the converted types. Patterns can thus
use the named accessors instead of magic constants, which eliminates a
common class of errors.

This commit further simplifies the API that patterns need to implement
by making the operand and result type mappings part of the adaptor.
Since many patterns only need one of the two (or even neither), this
reduces the number of unnecessary arguments in many cases.

Reviewed By: springerm

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

15 months agoRevert "[AMDGPU] Select v_sat_pk_u8_i16"
pvanhout [Fri, 31 Mar 2023 10:26:27 +0000 (12:26 +0200)]
Revert "[AMDGPU] Select v_sat_pk_u8_i16"

This reverts commit 64b45db34a0cd979dae9ca3016e9da517e57b987.

Reason: the patterns are wrong which can result in a miscompilation.
However, fixing the pattern is not trivial due to how i8 values
are handled, and due to the additional type-checking performed by
D147127: trunc/smax/smin are all defined as int ops in the DAG
despite them working on vectors too.

As this is not a much-needed pattern, I prefer reverting for now
until I can find time to properly rewrite the pattern.

15 months ago[mlir][Transform] NFC - Fix spurious reflows
Nicolas Vasilache [Fri, 31 Mar 2023 10:22:03 +0000 (03:22 -0700)]
[mlir][Transform] NFC - Fix spurious reflows

15 months ago[Local] Handle size mismatch between pointer/int in copyRangeMetadata()
Nikita Popov [Fri, 31 Mar 2023 10:18:02 +0000 (12:18 +0200)]
[Local] Handle size mismatch between pointer/int in copyRangeMetadata()

SROA may convert a wide integer load into a narrow pointer load,
make sure we don't crash. It would not be legal to transfer the
metadata in this case.

15 months ago[gn build] Port 868654e5495c
LLVM GN Syncbot [Fri, 31 Mar 2023 10:15:05 +0000 (10:15 +0000)]
[gn build] Port 868654e5495c

15 months ago[DWARFLinkerParallel] Add StringPool class.
Alexey Lapshin [Wed, 29 Mar 2023 10:58:21 +0000 (12:58 +0200)]
[DWARFLinkerParallel] Add StringPool class.

This patch is extracted from D96035. It adds StringPool class.
StringPool allows to store strings in parallel. It also allows
to have string data associated with the concrete string.

Reviewed By: JDevlieghere

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

15 months ago[AMDGPU] Fix whitespace after D147216
Jay Foad [Fri, 31 Mar 2023 10:10:25 +0000 (11:10 +0100)]
[AMDGPU] Fix whitespace after D147216

15 months agoRevert "[IVDescriptors] Add pointer InductionDescriptors with non-constant strides"
David Green [Fri, 31 Mar 2023 10:08:50 +0000 (11:08 +0100)]
Revert "[IVDescriptors] Add pointer InductionDescriptors with non-constant strides"

Multiple errors have being reported on
https://reviews.llvm.org/rG498aa534f472d28db893aa9a8627d0b46e17f312

Reverting until the correctness issues can be resolved.

We are also seeing a lot of performance differences from the patch.  Some are
looking good, but some are looking pretty bad.

15 months ago[Orc] Add RequireDebugSections option in the DebugObjectManagerPlugin
Stefan Gränitz [Fri, 31 Mar 2023 09:05:58 +0000 (11:05 +0200)]
[Orc] Add RequireDebugSections option in the DebugObjectManagerPlugin

Sometimes it's useful to be able and debug code even without actual debug info, e.g. for setting breakpoints on function names.
This patch adds a new API option to make it possible in Orc.

The existing API and behavior remains unchanged: non-debug objects are not passed to exectuors.

15 months ago[Orc] Reflow comment and improve name after fix (NFC)
Stefan Gränitz [Fri, 31 Mar 2023 09:59:55 +0000 (11:59 +0200)]
[Orc] Reflow comment and improve name after fix (NFC)

15 months ago[Coverity] Initialize pointer memeber.
Luo, Yuanke [Fri, 31 Mar 2023 09:49:42 +0000 (17:49 +0800)]
[Coverity] Initialize pointer memeber.

15 months agoARMFrameLowering.cpp - fix MSVC "result of 32-bit shift implicitly converted to 64...
Simon Pilgrim [Fri, 31 Mar 2023 09:34:10 +0000 (10:34 +0100)]
ARMFrameLowering.cpp - fix MSVC "result of 32-bit shift implicitly converted to 64 bits" warning. NFC.

15 months ago[Orc] Avoid unused variable warning in builds without asserts
Benjamin Kramer [Fri, 31 Mar 2023 09:32:53 +0000 (11:32 +0200)]
[Orc] Avoid unused variable warning in builds without asserts

DebugObjectManagerPlugin.cpp:372:8: error: unused variable 'ItInserted' [-Werror,-Wunused-variable]
  auto ItInserted = Sections.try_emplace(Name, std::move(Section));
       ^

15 months ago[mlir] Add REQUIRES: asserts to test that uses -debug-only
Benjamin Kramer [Fri, 31 Mar 2023 09:02:42 +0000 (11:02 +0200)]
[mlir] Add REQUIRES: asserts to test that uses -debug-only

That flag only exists when assertions are enabled.

15 months ago[Orc] Refactor debug section requirements into a more flexible flags field (NFC)
Stefan Gränitz [Fri, 31 Mar 2023 08:43:29 +0000 (10:43 +0200)]
[Orc] Refactor debug section requirements into a more flexible flags field (NFC)

When the initial DebugObjectManagerPlugin landed, it was not clear whether we will have more patching requirements for debug section. Also, there were no other use-cases for debug object flags.
Adding options to the plugin gives us a use-case and we can re-use the field for it. This commit only refactors the infrastructure in preparation for two more patches to come.

15 months ago[Orc] Filter sections for debug load-address patching upfront
Stefan Gränitz [Fri, 31 Mar 2023 08:21:35 +0000 (10:21 +0200)]
[Orc] Filter sections for debug load-address patching upfront

Originally, the DebugObjectManagerPlugin recorded all sections and filtered some of them for load-address patching.
Then we spotted problems with duplicate section names and started additional filtering upfront (see b26f45e5a49ae363164e7dbbf57eadd9e78d612c).
This seems the better approach. Let's go for it and stop filtering in two locations.

15 months ago[Orc] Skip sections with duplicate names in DebugObjectManagerPlugin
Stefan Gränitz [Fri, 31 Mar 2023 07:56:23 +0000 (09:56 +0200)]
[Orc] Skip sections with duplicate names in DebugObjectManagerPlugin

Compiler-generated section names can clash. Examples are group sections or profile counter sections.
We don't need to abort debug registration for the entire LinkGraph in such a case.
Instead, let's skip the relevant sections and add a note to the debug log.

15 months ago[TableGen] Enable "Type set is empty for each HW mode" error in non-debug builds
Jay Foad [Wed, 29 Mar 2023 09:36:03 +0000 (10:36 +0100)]
[TableGen] Enable "Type set is empty for each HW mode" error in non-debug builds

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

15 months ago[mlir][sparse-compiler] Fix typo in a test
Andrzej Warzynski [Fri, 31 Mar 2023 07:47:02 +0000 (07:47 +0000)]
[mlir][sparse-compiler] Fix typo in a test

This patch fixes a type that was introduced in
https://reviews.llvm.org/D146917 and that triggered buildbot failure:
  * https://lab.llvm.org/buildbot#builders/220/builds/18225

This is rather straightforward (and fixes a bogus test failure), hence
sending without a review.

15 months ago[InstCombine] Add tests for min(a,b) +/* max(a,b) pattern.
Serguei Katkov [Fri, 31 Mar 2023 07:28:07 +0000 (14:28 +0700)]
[InstCombine] Add tests for min(a,b) +/* max(a,b) pattern.

15 months ago[mlir][Transform] NFC - Make debug logging more actionnable
Nicolas Vasilache [Fri, 31 Mar 2023 07:29:20 +0000 (00:29 -0700)]
[mlir][Transform] NFC - Make debug logging more actionnable

15 months ago[mlir][Linalg] Fix Generalize transform
Nicolas Vasilache [Wed, 29 Mar 2023 16:06:53 +0000 (09:06 -0700)]
[mlir][Linalg] Fix Generalize transform

Generalize used to fail on ops that have a null region builder.
This is incorrect, the test should be whether the op has a region or not.
In the future we may want to support 0-region ops with a region builder.

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

15 months ago[mlir-cpu-runner] Add support for `-mattr` and `-march` flags
Andrzej Warzynski [Sat, 25 Mar 2023 20:01:34 +0000 (20:01 +0000)]
[mlir-cpu-runner] Add support for `-mattr` and `-march` flags

This patch adds support for `-mattr` and `-march` in mlir-cpu-runner.
With this change, one should be able to consistently use mlir-cpu-runner
for MLIR's integration tests (instead of e.g. resorting to lli when some
additional flags are needed). This is demonstrated in
concatenate_dim_1.mlir.

In order to support the new flags, this patch makes sure that
MLIR's ExecutionEngine/JITRunner (that mlir-cpu-runner is built on top of):
  * takes into account the new command line flags when creating
    TargetMachine,
  * avoids recreating TargetMachine if one is already available,
  * creates LLVM's DataLayout based on the previously configured
    TargetMachine.
This is necessary in order to make sure that the command line
configuration is propagated correctly to the backend code generator.

A few additional updates are made in order to facilitate this change,
including support for debug dumps from JITRunner.

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

15 months ago[flang] Remove unused variable 'nullBoxTy' in ConvertExpr.cpp (NFC)
Jie Fu [Fri, 31 Mar 2023 07:29:23 +0000 (15:29 +0800)]
[flang] Remove unused variable 'nullBoxTy' in ConvertExpr.cpp (NFC)

/data/llvm-project/flang/lib/Lower/ConvertExpr.cpp:728:10: error: unused variable 'nullBoxTy' [-Werror,-Wunused-variable]
    auto nullBoxTy = builder.getRefType(fir::BoxType::get(noneTy));
         ^
1 error generated.

15 months ago[ARM] Handle generating SEH unwind info for t2STR_PRE/t2LDR_POST
Martin Storsjö [Thu, 30 Mar 2023 10:31:58 +0000 (13:31 +0300)]
[ARM] Handle generating SEH unwind info for t2STR_PRE/t2LDR_POST

This fixes compiling some uncommon cases.

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

15 months ago[flang] Fix context less NULL() lowering
Jean Perier [Fri, 31 Mar 2023 07:13:52 +0000 (09:13 +0200)]
[flang] Fix context less NULL() lowering

The current context less lowering of NULL is producing invalid code
(can lead to reading outside of allocated memory): it is casting
a simple pointer to a descriptor address.
Later, reads are made to this descriptor. It used to be "OK" when
fir.load of fir.box were no-ops, but this was incorrect, and the
fir.load codegen is known doing a copy, and read the whole descriptor
data, not only the base address.

The previous patch that allowed fir.box<None> allocation, this
code fix this by allocating an actual fir.box<None>.

Note: this is still an overkill way to lower foo(null()). HLFIR
lowering always contextualize NULL() lowering leading to much simpler
code:
```
%absent = fir.absent fir.box<T>
fir.call @foo(%absent)
```

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

15 months ago[flang] allow allocation of scalar TYPE(*) descriptors
Jean Perier [Fri, 31 Mar 2023 07:12:43 +0000 (09:12 +0200)]
[flang] allow allocation of scalar TYPE(*) descriptors

Currently, it is OK to have alloca/store/and reboxed to
fir.box<!fir.array<?xnone>> and fir.class<none>, but not simple
fir.box<none>.
This restriction is a legacy from a time where it was thought TYPE(*)
descriptor size would not be statically known, but the way polymorphism
was implemented actually allows knowing its size: a scalar descriptor
with an addendum (in case it is a derived type).
Note that this assumes fir.box<none> are always scalars. There are currently
a few cast from ranked descriptor to !fir.box<None> around runtime calls.
These are simple casts before runtime call, so there are no load/stores
to the resulting fir.box<None> and it is OK.
When assumed rank are supported, some legacy usage of fir.box<none> as the "any"
descriptor in the runtime interface will be replaced to avoid any issues there.

This change will be required to fix an undefined behavior with NULL() that
requires allocation of a fir.box<None>.

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

15 months ago[flang] move ASSOCIATED intrinsic optional TARGET handling
Jean Perier [Fri, 31 Mar 2023 07:07:29 +0000 (09:07 +0200)]
[flang] move ASSOCIATED intrinsic optional TARGET handling

ASSOCIATED intrinsic TARGET handling is weird for OPTIONAL, because as
opposed to other intrinsic arguments, OPTIONAL allocatable and pointers
may be absent when passed to it, and a diassociated pointer TARGET is not
the same as when TARGET is not provided. Hence, it needs custom
handling in lowering.

The handling was done late (in genIntrinsicCall, without the semantic
context), and assumed it would be possible to retrieve the optionality
aspects, but this is brittle, and hard to share with HLFIR.
Move it in CustomIntrinsicCall that is intended to deal with these
corner case.

Also avoid using fir.box<None> as the related fir.if result, and used
the correct fir.box/fir.class type for the target: using a fir.box<None>
here is risky since fir.box<None> are now meant for scalar TYPE(*), and
the TARGET may be ranked.

Move the introduction of the fir.box<None> around the runtime (when
assumed rank are supported, these will become !fir.box<!fir.array<..xNone>>).

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

15 months ago[LoongArch] Optimize additions with immediates
Ben Shi [Fri, 31 Mar 2023 01:34:37 +0000 (09:34 +0800)]
[LoongArch] Optimize additions with immediates

Reviewed By: SixWeining, xen0n

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

15 months ago[LoongArch][NFC] Add tests of additions with immediates (for D147222)
Ben Shi [Thu, 30 Mar 2023 07:56:10 +0000 (15:56 +0800)]
[LoongArch][NFC] Add tests of additions with immediates (for D147222)

Reviewed By: SixWeining, xen0n, XiaodongLoong

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

15 months ago[clang][Interp][NFC] Add failing test case for InterpFrame::describe()
Timm Bäder [Fri, 13 Jan 2023 21:22:36 +0000 (22:22 +0100)]
[clang][Interp][NFC] Add failing test case for InterpFrame::describe()

15 months ago[clang][Interp][NFC] Add missing static_assert message
Timm Bäder [Fri, 31 Mar 2023 06:21:54 +0000 (08:21 +0200)]
[clang][Interp][NFC] Add missing static_assert message

This broke builders, e.g.
https://lab.llvm.org/buildbot#builders/139/builds/38298

15 months ago[mlir][llvm] Keep unhandled constant test.
Tobias Gysi [Fri, 31 Mar 2023 06:08:23 +0000 (06:08 +0000)]
[mlir][llvm] Keep unhandled constant test.

Add the more precise error message introduced in
https://reviews.llvm.org/D142337 to the standard
error produced for unhandled constants. This way
we keep testing both error cases.

Reviewed By: Dinistro

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

15 months ago[clang][Interp] Fix parameter map when re-visiting function
Timm Bäder [Fri, 13 Jan 2023 13:07:59 +0000 (14:07 +0100)]
[clang][Interp] Fix parameter map when re-visiting function

'Params' is a member of the ByteCodeEmitter. We only added the
parameters the first time  we saw the function, so subsequent visits
didn't work if they had (and used) parameters.

Just do the work everytime we see a function.

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

15 months ago[Local] Preserve !align if K dominates J and K has a !noundef
luxufan [Fri, 31 Mar 2023 05:19:16 +0000 (13:19 +0800)]
[Local] Preserve !align if K dominates J and K has a !noundef

Similar to D142687

Reviewed By: nikic

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

15 months ago[NFC]add & to avoid copy
Wang, Xin10 [Fri, 31 Mar 2023 05:40:39 +0000 (01:40 -0400)]
[NFC]add & to avoid copy

The elements in FragmentMap are big objects, use reference can get
better performance, as someone do in line 1912.

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

15 months ago[clang][Interp] Properly identify not-yet-defined functions
Timm Bäder [Thu, 12 Jan 2023 11:25:10 +0000 (12:25 +0100)]
[clang][Interp] Properly identify not-yet-defined functions

Since we now handle functions without a body as well, we can't just use
getHasBody() anymore. Funtions that haven't been defined yet are those
that don't have a body *and* aren't valid.

Also, just pass the information about whether the Function has a body or
not along from the FunctionDecl.

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

15 months ago[builtins] Support architectures with 16-bit int in __ashlti3, __ashrti3 and __lshrti3
Karl-Johan Karlsson [Fri, 31 Mar 2023 04:41:11 +0000 (06:41 +0200)]
[builtins] Support architectures with 16-bit int in __ashlti3, __ashrti3 and __lshrti3

The amount to shift should be specified by the int type not a 32-bit integer
type.

This patch change the functions for 128-bit shifts in compiler-rt the same way
as was done for 64-bit shifts in D78662.

The README.txt is updated with the shift builtins signatures from this patch and D78662.

Reviewed By: efriedma

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

15 months ago[IR] Allow destruction of symbol table entries regardless of DiscardValueNames
Yevgeny Rouban [Fri, 31 Mar 2023 03:54:44 +0000 (10:54 +0700)]
[IR] Allow destruction of symbol table entries regardless of DiscardValueNames

Value::setNameImpl() is used both to set and reset name of the value.
In destructor of Function all arguments get reset their names
(see Function::clearArguments()). If the arguments had their names set (e.g.
when the function was created with LLVMContex::DiscardValueNames == true)
then their ValueName entries referred by the function's symbol table must be
destructed. They are not destructed if LLVMContex::DiscardValueNames is set to
false because of the fast path in Value::setNameImpl(). See the new test cases
that demonstrate the problem. Without the fix they both crash in the function's
destructor.

In Value::setNameImpl() this patch narrows down the fast path return for
DiscardValueNames == true to allow destruction of ValueName entries if any.

Reviewed By: efriedma

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

15 months ago[docs][clang] Add extra information inside -fsanitize=unsigned-shift-base for Undefin...
aabhinavg [Fri, 31 Mar 2023 04:02:52 +0000 (09:32 +0530)]
[docs][clang] Add extra information inside -fsanitize=unsigned-shift-base for UndefinedBehaviorSanitizer

Close: #60712

Reviewed By: MaskRay

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

15 months ago[WASM] Prevent casting `undef` to `CosntantSDNode`
Peter Rong [Thu, 30 Mar 2023 05:13:25 +0000 (22:13 -0700)]
[WASM] Prevent casting `undef` to `CosntantSDNode`

WebAssembly tries to cast an `undef` to `CosntantSDNode` during `LowerAccessVectorElement`.
These operations will trigger an assertion error in cast.
To avoid this issue, we prevent casting, and abort the lowering operation.
A unit test is also included.

This patch fixes [pr61828](https://github.com/llvm/llvm-project/issues/61828)

Reviewed By: tlively

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

15 months ago[docs] Update LLVM_TARGETS_TO_BUILD list
Fangrui Song [Fri, 31 Mar 2023 02:23:14 +0000 (19:23 -0700)]
[docs] Update LLVM_TARGETS_TO_BUILD list

15 months ago[WASM] Fix legalizer for LowerBUILD_VECTOR.
Peter Rong [Thu, 30 Mar 2023 08:44:24 +0000 (01:44 -0700)]
[WASM] Fix legalizer for LowerBUILD_VECTOR.

Constants in BUILD_VECTOR may be down cast into a smaller value that fits LaneBits, i.e., the bit width of elements in the vector.
This cast didn't consider 2^N where it would be cast into -2^N, which still doesn't fit into LaneBits after casting.
This will cause an assertion in later legalization.

2^N should be cast into 0, and this patch reflects such behavior.
This patch also includes a test to reflect the fix.
This patch fixes [issue 61780](https://github.com/llvm/llvm-project/issues/61780)

Related patch: https://reviews.llvm.org/D108669

Reviewed By: tlively

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

15 months ago[mlir][sparse] Correcting some terminology / naming-scheme errors.
wren romano [Fri, 31 Mar 2023 01:21:39 +0000 (18:21 -0700)]
[mlir][sparse] Correcting some terminology / naming-scheme errors.

The name "coords" should be used for the complete tuple of Dimension-/Level-many "crd" values associated with a single element.  Whereas the name "coordinates" should only be used for collections of "crd" values which span several elements (e.g., the tensor's coordinates buffer for a single level).

Reviewed By: aartbik

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

15 months ago[libc++] Add __decay_t and use it instead of decay<>::type
Nikolas Klauser [Mon, 27 Mar 2023 16:22:23 +0000 (18:22 +0200)]
[libc++] Add __decay_t and use it instead of decay<>::type

This avoids instantiating lots of types.

Reviewed By: ldionne, #libc

Spies: libcxx-commits

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

15 months ago[RISCV] Remove -mattr=+f from rvk-user-csr-name.s.
Craig Topper [Fri, 31 Mar 2023 00:20:09 +0000 (17:20 -0700)]
[RISCV] Remove -mattr=+f from rvk-user-csr-name.s.

Zvk is all integer, it shouldn't need +f.

15 months agoMove definitions of ArgKind from Intrinsics.h to Intrinsics.td
NAKAMURA Takumi [Wed, 8 Mar 2023 15:50:45 +0000 (00:50 +0900)]
Move definitions of ArgKind from Intrinsics.h to Intrinsics.td

Values of ArgKind are used (as naked constants) also in IntrinsicEmitter.
They can be dissolved to move their logic to Intrinsics.td.

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

15 months agoLet IntrinsicEnums.inc conditional by GET_INTRINSIC_ENUM_VALUES
NAKAMURA Takumi [Wed, 8 Mar 2023 15:50:45 +0000 (00:50 +0900)]
Let IntrinsicEnums.inc conditional by GET_INTRINSIC_ENUM_VALUES

Part of https://reviews.llvm.org/D145873

15 months agoRevert ""Reland "[hwasan] Provide aliases for c allocation functions for Fuchsia""
Leonard Chan [Fri, 31 Mar 2023 00:08:02 +0000 (00:08 +0000)]
Revert ""Reland "[hwasan] Provide aliases for c allocation functions for Fuchsia""

This reverts commit 1190a1dbd54d8af074e9d4986c7f9cad5c0037f3.

This probably broke
https://lab.llvm.org/buildbot/#/builders/77/builds/26043/steps/21/logs/stdio
again.

15 months agoRetain constraints in the canonical form of an auto type.
Richard Smith [Thu, 30 Mar 2023 20:08:22 +0000 (13:08 -0700)]
Retain constraints in the canonical form of an auto type.

This is necessary in order for type equality checking, for example
across redeclarations, to require constraints to match. This is also a
prerequisite for including the constraints in manglings.

In passing, fix a bug where TemplateArgument::Profile would produce the
same profile for two structurally different template names, which caused
this change to re-expose the crash previously addressed by D133072,
which it turns out had not quite addressed all problematic cases.

15 months agoIgnore constraints when determining a canonical template parameter.
Richard Smith [Thu, 30 Mar 2023 20:04:02 +0000 (13:04 -0700)]
Ignore constraints when determining a canonical template parameter.

This follows C++ [temp.over.link]/6, which says that constraints are not
part of what determines whether two template parameters are equivalent.
This allows templates that have different constraints on nested template
template parameters to be ordered by their constraints.

15 months agoConvert boolean flag in TemplateParameterListsAreEqual into an
Richard Smith [Thu, 30 Mar 2023 19:20:19 +0000 (12:20 -0700)]
Convert boolean flag in TemplateParameterListsAreEqual into an
additional enum value and document its meaning.

No functionality change intended.

15 months agoClean up template parameter list profiling. No functionality change.
Richard Smith [Thu, 30 Mar 2023 18:42:14 +0000 (11:42 -0700)]
Clean up template parameter list profiling. No functionality change.

15 months agoFactor out helper to determine whether a function is a "member-like
Richard Smith [Thu, 30 Mar 2023 23:07:55 +0000 (16:07 -0700)]
Factor out helper to determine whether a function is a "member-like
constrained friend".

When a friend declaration has a requires-clause, and either it's a
non-template function or it's a function template whose requires-clause
depends on an enclosing template parameter, it is member-like for the
purpose of redeclaration checking. Specifically, the lexically enclosing
class becomes part of its signature, so it can only be redeclared by
another declaration within the same class. In this change, we call such
functions "member-like constrained friends".

No functional change intended.

15 months ago[RISCV] Add Zicsr and Zifencei to CPUs in RISCVProcessors.td.
Craig Topper [Thu, 30 Mar 2023 22:55:37 +0000 (15:55 -0700)]
[RISCV] Add Zicsr and Zifencei to CPUs in RISCVProcessors.td.

I only added Zicsr to CPUs that didn't already have an implication
through the F extension.

As far as I could tell from searching Rocket and Syntacore repositories,
all the CPUs support these instructions.

Reviewed By: asb

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

15 months ago[RISCV] Correct the EvenSrc/OddSrc computation in isInterleaveShuffle.
Craig Topper [Thu, 30 Mar 2023 22:47:03 +0000 (15:47 -0700)]
[RISCV] Correct the EvenSrc/OddSrc computation in isInterleaveShuffle.

StartIndexes[0] Tells exactly which source element is in element 0,
the even source. Nothing needs to be swapped.

Since we're dealing with power of 2 vector lengths, StartIndexes[0]
is almost always even so the condition here was never true. The
exception is when we're interleaving two 1 element vectors. In that
case StartIndexes[0] could be 1.

We recently hit a failure from this on a pulldown. I don't have
the reduced reproducer yet and my naive attempts at making an
interleave of 1 element vectors produces a slideup instead so don't
go through this path.

Reviewed By: luke

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

15 months ago[RISCV] Test case for D147268. NFC
Craig Topper [Thu, 30 Mar 2023 22:46:57 +0000 (15:46 -0700)]
[RISCV] Test case for D147268. NFC

This test currently miscompiles.

15 months ago[RISCV] Bump I, F, D, and A extension versions to 20191214 spec version
Craig Topper [Thu, 30 Mar 2023 22:28:44 +0000 (15:28 -0700)]
[RISCV] Bump I, F, D, and A extension versions to 20191214 spec version

New versions I2.1, F2.2, D2.2 A2.1

Make F and Zfinx imply Zicsr.
Make G imply Zifencei.

This should have no impact to generated code. We have no plans to require Zicsr/Zifencei extension to be explicitly enabled to use Zicsr/Zifencei instructions in assembly.

See https://reviews.llvm.org/D147183 for documentation regarding what version specification we implement.

Reviewed By: asb

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

15 months ago[clang] Fix 2 bugs with parenthesized aggregate initialization
Alan Zhao [Mon, 20 Mar 2023 21:53:53 +0000 (14:53 -0700)]
[clang] Fix 2 bugs with parenthesized aggregate initialization

* Fix an issue where temporaries initialized via parenthesized aggregate
  initialization don't get destroyed.
* Fix an issue where aggregate initialization omits calls to class
  members' move constructors after a TreeTransform. This occurs because
  the CXXConstructExpr wrapping the call to the move constructor gets
  unboxed during a TreeTransform of the wrapping FunctionalCastExpr (as with a
  InitListExpr), but unlike InitListExpr, we dont reperform the
  InitializationSequence for the list's expressions to regenerate the
  CXXConstructExpr. This patch fixes this bug by treating
  CXXParenListInitExpr identically to InitListExpr in this regard.

Fixes #61145

Reviewed By: rsmith

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

15 months ago[Flang][OpenMP] Add support for logical or reduction in worksharing-loop
dossai.o@yahoo.com [Thu, 30 Mar 2023 13:30:07 +0000 (09:30 -0400)]
[Flang][OpenMP] Add support for logical or reduction in worksharing-loop

Adds support for .or. reductions with logical types.

Reviewed By: kiranchandramohan

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

15 months ago[mlir][sparse] Fix a problem in handling data type conversion.
bixia1 [Thu, 30 Mar 2023 20:58:45 +0000 (13:58 -0700)]
[mlir][sparse] Fix a problem in handling data type conversion.

Previously, the genCast function generates arith.trunci for converting f32 to
i32. Fix the function to use mlir::convertScalarToDtype to correctly handle
conversion cases beyond index casting.

Add a test case for codegen the sparse_tensor.convert op.

Reviewed By: aartbik, Peiming, wrengr

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

15 months ago[lldb] Fix macos build after e64cc756819d (2/2)
Jonas Devlieghere [Thu, 30 Mar 2023 21:48:39 +0000 (14:48 -0700)]
[lldb] Fix macos build after e64cc756819d (2/2)

My previous commit was still missing the ctor and the NativeDelegate
parent class.

15 months ago[lld][WebAssembly] Process stub libraries before performing LTO
Sam Clegg [Wed, 29 Mar 2023 04:54:51 +0000 (21:54 -0700)]
[lld][WebAssembly] Process stub libraries before performing LTO

There are cases where stub library processing can trigger new exports
which might require them to be included at LTO time.

Specifically `processStubLibraries` marks symbols as `forceExports`
which even effect the LTO process.

And since the LTO process can generate new undefined symbols
(specifically libcall function) we need to also process the stub
libraries after LTO.

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

15 months agoPR60985: Fix merging of lambda closure types across modules.
Richard Smith [Thu, 30 Mar 2023 21:21:31 +0000 (14:21 -0700)]
PR60985: Fix merging of lambda closure types across modules.

Previously, distinct lambdas would get merged, and multiple definitions
of the same lambda would not get merged, because we attempted to
identify lambdas by their ordinal position within their lexical
DeclContext. This failed for lambdas within namespace-scope variables
and within variable templates, where the lexical position in the context
containing the variable didn't uniquely identify the lambda.

In this patch, we instead identify lambda closure types by index within
their context declaration, which does uniquely identify them in a way
that's consistent across modules.

This change causes a deserialization cycle between the type of a
variable with deduced type and a lambda appearing as the initializer of
the variable -- reading the variable's type requires reading and merging
the lambda, and reading the lambda requires reading and merging the
variable. This is addressed by deferring loading the deduced type of a
variable until after we finish recursive deserialization.

This also exposes a pre-existing subtle issue where loading a
variable declaration would trigger immediate loading of its initializer,
which could recursively refer back to properties of the variable. This
particularly causes problems if the initializer contains a
lambda-expression, but can be problematic in general. That is addressed
by switching to lazily loading the initializers of variables rather than
always loading them with the variable declaration. As well as fixing a
deserialization cycle, that should improve laziness of deserialization
in general.

LambdaDefinitionData had 63 spare bits in it, presumably caused by an
off-by-one-error in some previous change. This change claims 32 of those bits
as a counter for the lambda within its context. We could probably move the
numbering to separate storage, like we do for the device-side mangling number,
to optimize the likely-common case where all three numbers (host-side mangling
number, device-side mangling number, and index within the context declaration)
are zero, but that's not done in this change.

Fixes #60985.

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

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

15 months ago[mlir][vector][NFC] Clean up vector gather lowering comments
Jakub Kuderski [Thu, 30 Mar 2023 21:13:14 +0000 (17:13 -0400)]
[mlir][vector][NFC] Clean up vector gather lowering comments

These got relocated recently.

Reviewed By: antiagainst

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

15 months ago[lldb] Only run TestUniversal64 on macOS 11 and later
Jonas Devlieghere [Thu, 30 Mar 2023 21:11:58 +0000 (14:11 -0700)]
[lldb] Only run TestUniversal64 on macOS 11 and later

GreenDragon is running on a host OS and toolchain that doesn't support
building for Apple Silicon.

15 months agoTableGen: Let getAllDerivedDefinitions() numeric order.
NAKAMURA Takumi [Fri, 10 Mar 2023 23:24:39 +0000 (08:24 +0900)]
TableGen: Let getAllDerivedDefinitions() numeric order.

Since `RK::Recs` is sorted by character order, anonymous defs will be
enumerated like this;

  - anonymous_0
  - anonymous_1
  - anonymous_10
  - anonymous_100
  - anonymous_1000
  - ...
  - anonymous_99
  - anonymous_990
  - ...
  - anonymous_999

Some records around each gap might be wrapped around along increase or
decrease of records in middle. Then output order of anonymous defs
might be changed.

Numeric sort is expected to prevent such wrap-arounds.
This can be implemented with `StringRef::compare_numeric()`.

  - ...
  - anonymous_99
  - anonymous_100
  - ...
  - anonymous_999
  - anonymous_1000
  - ...

See also discussions in D145874.

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

15 months ago[lldb] Use one Progress event per root module build
Dave Lee [Thu, 23 Mar 2023 01:38:07 +0000 (18:38 -0700)]
[lldb] Use one Progress event per root module build

Following the work done by @jdevlieghere in D143690, this changes how Clang module build
events are emitted.

Instead of one Progress event per module being built, a single Progress event is used to
encompass all modules, and each module build is sent as an `Increment` update.

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

15 months ago[lldb] Fix macos build after e64cc756819d
Jonas Devlieghere [Thu, 30 Mar 2023 20:54:18 +0000 (13:54 -0700)]
[lldb] Fix macos build after e64cc756819d

15 months ago[Clang] Fix how ReadMacroParameterList handles comments in macro parameter-list when...
Shafik Yaghmour [Thu, 30 Mar 2023 20:35:10 +0000 (13:35 -0700)]
[Clang] Fix how ReadMacroParameterList handles comments in macro parameter-list when in -CC mode

Currently when in -CC mode when processing a function like macro
ReadMacroParameterList(...) does not handle the case where there is a comment
embedded in the parameter-list.

Instead of using LexUnexpandedToken(...) I switched to using
LexUnexpandedNonComment(...) which eats comments while lexing.

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

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

15 months ago[lldb][NFC] Move various constructor definitions from .h to .cpp
River Riddle [Thu, 30 Mar 2023 04:21:22 +0000 (21:21 -0700)]
[lldb][NFC] Move various constructor definitions from .h to .cpp

I ran into issues with linking downstream language plugin to liblldb in
debug builds, hitting link time errors of form:

```
undefined reference to `vtable for  lldb_private::<Insert LLDB class here>'
```

Anchoring the vtable to the .cpp files resolved those issues.

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

15 months ago[RISCV] Add codegen for the experimental zicond extension
Alex Bradbury [Thu, 30 Mar 2023 20:04:37 +0000 (21:04 +0100)]
[RISCV] Add codegen for the experimental zicond extension

This directly matches the codegen for xventanacondops with vt.maskcn =>
czero.nez and vt.maskc => czero.eqz. An additional difference is that
zicond is available on RV32 in addition to RV64 (xventanacondops is RV64
only).

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

15 months ago"Reland "[hwasan] Provide aliases for c allocation functions for Fuchsia"
Leonard Chan [Thu, 30 Mar 2023 19:55:05 +0000 (19:55 +0000)]
"Reland "[hwasan] Provide aliases for c allocation functions for Fuchsia"

This reverts commit c5c6781428a70d1fffd00a256a237cbf5a3ccfd3.

This likely broke the android sanitizer builders prior because it
accidentally enabled interceptors for android, which they don't use, so
c-allocation functions like malloc would go through hwasan.

This reland adds the HWASAN_WITH_INTERCEPTORS check.

15 months ago[RISCV] Slightly weaken expanded seq_cst atomic op to match reference mapping in...
Alex Bradbury [Thu, 30 Mar 2023 19:47:28 +0000 (20:47 +0100)]
[RISCV] Slightly weaken expanded seq_cst atomic op to match reference mapping in in the spec

Table A.6 in the RISC-V ISA Manual indicates that sequentially
consistent atomic ops that have a matching instruction should be mapped
to `amo<op>.{w|d}.aqrl`. But sequentially consistent operations that are
mapped to lr/sc should produce `loop: lr.{w|d}.aqrl; <op>; sc.{w|d}.rl;
bnez loop`. Previously, LLVM produced an `sc.{w|d}.aqrl` which was
stronger than necessary. This patch adjusts the relevant logic so that a
`sc.{w|d}.rl` is produced.

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

15 months ago[lldb] Replace sprintf with snprintf (NFC)
Dave Lee [Sat, 24 Sep 2022 22:58:03 +0000 (15:58 -0700)]
[lldb] Replace sprintf with snprintf (NFC)

On macOS, `sprintf` is deprecated, using `snprintf` is recommended instead.

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

15 months ago[libc++] Systematically define a macro to check whether a feature is unavailable
Louis Dionne [Thu, 30 Mar 2023 12:51:13 +0000 (08:51 -0400)]
[libc++] Systematically define a macro to check whether a feature is unavailable

Previously, we inconsistently defined whether a feature was unavailable
on a given deployment target. We would have availability attributes for
all features, but only some features had the equivalent of a _HAS_NO_FOO
macro in the form of the DISABLE_FTM___foo macros. Instead, systematically
define a _HAS_NO_FOO macro, which makes it easier to understand how to
add availability markup for a new platform.

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

15 months ago[LV] Regenerate check lines for test to reduce diff in follow-up patch.
Florian Hahn [Thu, 30 Mar 2023 19:17:12 +0000 (20:17 +0100)]
[LV] Regenerate check lines for test to reduce diff in follow-up patch.

15 months ago[OpenMP] asynchronous memory copy support
Jisheng Zhao [Tue, 28 Mar 2023 14:32:11 +0000 (10:32 -0400)]
[OpenMP] asynchronous memory copy support

We introduced the implementation of supporting asynchronous routines with depend objects specified in Version 5.1 of the OpenMP Application Programming Interface. In brief, these routines omp_target_memcpy_async and omp_target_memcpy_rect_async perform asynchronous (nonblocking) memory copies between any
combination of host and device pointers. The basic idea is to create the implicit tasks to carry the memory copy calls and handle dependencies specified by depend objects. The implicit tasks are executed via hidden helper thread in OpenMP runtime.

Reviewed By: jdoerfert, tianshilei1992
Committed By: jplehr

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

15 months ago[mlir][sparse] Cleaning up some usage of SparseTensorType
wren romano [Thu, 30 Mar 2023 01:36:24 +0000 (18:36 -0700)]
[mlir][sparse] Cleaning up some usage of SparseTensorType

This is a followup to D147192.

Reviewed By: aartbik, Peiming

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

15 months ago[IVDescriptors] Add pointer InductionDescriptors with non-constant strides
Philip Reames [Thu, 30 Mar 2023 16:01:40 +0000 (09:01 -0700)]
[IVDescriptors] Add pointer InductionDescriptors with non-constant strides

This matches the handling for integer IVs.  I left the non-opaque cases alone, mostly because they're largely irrelevant today.

This doesn't actually make much difference in vectorization right now as we immediately fail on aliasing checks (which also bail on non-constant strides).  Slightly suprisingly, it's the case which *do* need runtime checks which work after this patch as they don't use the same dependency analysis path.

This will also enable non-constant stride pointer recurrences for other consumers.  I've auditted said code, and don't see any obvious issues.

15 months ago[MachineOutliner] Fix label outlining regression introduced in D125072
duk [Thu, 30 Mar 2023 18:43:12 +0000 (14:43 -0400)]
[MachineOutliner] Fix label outlining regression introduced in D125072

Due to a change in the APIs used to determine what instructions can be outlined, the check for label outling was never hit. Instead, all labels were considered invisible, which is the opposite of the intended behavior and causes obscure crashes down the line. We now replicate the original behavior more closely, with explicit checks for known-good and known-bad instruction types.

Reviewed by: paquette

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

15 months ago[clang][ExtractAPI] Remove extra pointer indirection from declaration fragments for...
NagaChaitanya Vellanki [Thu, 30 Mar 2023 17:51:06 +0000 (10:51 -0700)]
[clang][ExtractAPI] Remove extra pointer indirection from declaration fragments for Obj-C lightweight generics on id

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

Reviewed By: dang

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

15 months ago[lld-macho] Don't emit spurious dupe method warnings for +load methods
Jez Ng [Thu, 30 Mar 2023 18:16:16 +0000 (14:16 -0400)]
[lld-macho] Don't emit spurious dupe method warnings for +load methods

+load methods are static initializers and treated specially by the
runtime: all +load methods for a class & its categories are called when
loading that class, unlike regular methods where only one definition
will get called per message. Thus, there is no need to check for
duplicates.

Reviewed By: #lld-macho, oontvoo

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

15 months ago[lld-macho][objc] Don't crash when rodata isn't statically linked
Jez Ng [Thu, 30 Mar 2023 18:16:12 +0000 (14:16 -0400)]
[lld-macho][objc] Don't crash when rodata isn't statically linked

We were previously assuming that to hold, but it appears that `swiftc`
may generate classes that link against `__objc_empty_cache` for their
rodata pointer.

This should allow us to re-land {D142916} (as a stack).

Reviewed By: #lld-macho, oontvoo

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

15 months ago[lld-macho][re-land] Warn on method name collisions from category definitions
Jez Ng [Thu, 16 Feb 2023 21:18:46 +0000 (16:18 -0500)]
[lld-macho][re-land] Warn on method name collisions from category definitions

This implements ld64's checks for duplicate method names in categories &
classes.

In addition, this sets us up for implementing Obj-C category merging.
This diff handles the most of the parsing work; what's left is rewriting
those category / class structures.

Numbers for chromium_framework:

             base           diff           difference (95% CI)
  sys_time   2.182 ± 0.027  2.200 ± 0.047  [  -0.2% ..   +1.8%]
  user_time  6.451 ± 0.034  6.479 ± 0.062  [  -0.0% ..   +0.9%]
  wall_time  6.841 ± 0.048  6.885 ± 0.105  [  -0.1% ..   +1.4%]
  samples    33             22

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

Issues seen with the previous land will be fixed in the next commit.

Reviewed By: #lld-macho, thevinster, oontvoo

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

15 months ago[TOSA] Loosen folding restrictions for tosa.add,tosa.sub, tosa.mul
SJW [Thu, 30 Mar 2023 18:08:47 +0000 (18:08 +0000)]
[TOSA] Loosen folding restrictions for tosa.add,tosa.sub, tosa.mul

Allow folding of different tensor types when the constant tensor is broadcast.
Removed redundant and incorrect AddZero and MulOne canonical optimizations.

Reviewed By: rsuderman, eric-k256

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

15 months agofix docs warning in llvm-profdata.rst
wlei [Thu, 30 Mar 2023 18:21:30 +0000 (11:21 -0700)]
fix docs warning in llvm-profdata.rst

15 months ago[lldb] Replace deprecated CFPropertyListWriteToStream (NFC)
Dave Lee [Sat, 24 Sep 2022 23:06:01 +0000 (16:06 -0700)]
[lldb] Replace deprecated CFPropertyListWriteToStream (NFC)

Replace `CFPropertyListWriteToStream` with its recommended replacement, `CFPropertyListWrite`.

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

15 months ago[TwoAddressInstruction] Improve tests for register killed by instruction
Jay Foad [Wed, 29 Mar 2023 16:13:52 +0000 (17:13 +0100)]
[TwoAddressInstruction] Improve tests for register killed by instruction

Define and use a MachineOperand overload of isPlainlyKilled. This
improves codegen in a couple of tests because it catches the case where
MO does not kill Reg but another operand of the same instruction does.

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

15 months agoFix codegen for coroutine with function-try-block
Matthias Braun [Thu, 23 Mar 2023 20:38:16 +0000 (13:38 -0700)]
Fix codegen for coroutine with function-try-block

This fixes an assertion error when writing a coroutine with a
function-try-block. In this case the function body is not a
`CompoundStmt` so the code constructing an artificial CXXTryStmt must
also construct a `CompoundStmt` for it.

While on it adjust the `CXXStmt::Create` function to only accept
`CompoundStmt*`.

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