Commit Graph

456355 Commits

Author SHA1 Message Date
Jay Foad
6b6303ac00 [AMDGPU] Fix whitespace after D147216 2023-03-31 11:10:25 +01:00
David Green
965a090f02 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.
2023-03-31 11:08:50 +01:00
Stefan Gränitz
360a05305c [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.
2023-03-31 12:03:41 +02:00
Stefan Gränitz
0a927bdc83 [Orc] Reflow comment and improve name after fix (NFC) 2023-03-31 12:03:40 +02:00
Luo, Yuanke
89c4acd0c1 [Coverity] Initialize pointer memeber. 2023-03-31 17:50:58 +08:00
Simon Pilgrim
b206145323 ARMFrameLowering.cpp - fix MSVC "result of 32-bit shift implicitly converted to 64 bits" warning. NFC. 2023-03-31 10:34:19 +01:00
Benjamin Kramer
bd20a344bb [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));
       ^
2023-03-31 11:32:53 +02:00
Benjamin Kramer
c5c9b01e74 [mlir] Add REQUIRES: asserts to test that uses -debug-only
That flag only exists when assertions are enabled.
2023-03-31 11:02:42 +02:00
Stefan Gränitz
811832a938 [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.
2023-03-31 10:43:58 +02:00
Stefan Gränitz
88d8f127ce [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 b26f45e5a4).
This seems the better approach. Let's go for it and stop filtering in two locations.
2023-03-31 10:34:05 +02:00
Stefan Gränitz
47302af71d [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.
2023-03-31 10:17:19 +02:00
Jay Foad
a80b830e48 [TableGen] Enable "Type set is empty for each HW mode" error in non-debug builds
Differential Revision: https://reviews.llvm.org/D147127
2023-03-31 09:03:22 +01:00
Andrzej Warzynski
c98372725b [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.
2023-03-31 07:49:18 +00:00
Serguei Katkov
36158ce622 [InstCombine] Add tests for min(a,b) +/* max(a,b) pattern. 2023-03-31 14:41:30 +07:00
Nicolas Vasilache
56fd39749c [mlir][Transform] NFC - Make debug logging more actionnable 2023-03-31 00:38:06 -07:00
Nicolas Vasilache
46cfdfb5f7 [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
2023-03-31 00:38:06 -07:00
Andrzej Warzynski
fb0b035e35 [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
2023-03-31 07:34:24 +00:00
Jie Fu
302a6ebc89 [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.
2023-03-31 15:30:46 +08:00
Martin Storsjö
c5383536cb [ARM] Handle generating SEH unwind info for t2STR_PRE/t2LDR_POST
This fixes compiling some uncommon cases.

Differential Revision: https://reviews.llvm.org/D147212
2023-03-31 10:22:28 +03:00
Jean Perier
cb3f1e2d12 [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
2023-03-31 09:13:59 +02:00
Jean Perier
92bdc6ad01 [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
2023-03-31 09:13:06 +02:00
Jean Perier
99d9a700d3 [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
2023-03-31 09:10:32 +02:00
Ben Shi
ec37a35a8c [LoongArch] Optimize additions with immediates
Reviewed By: SixWeining, xen0n

Differential Revision: https://reviews.llvm.org/D147222
2023-03-31 14:47:19 +08:00
Ben Shi
777318df1c [LoongArch][NFC] Add tests of additions with immediates (for D147222)
Reviewed By: SixWeining, xen0n, XiaodongLoong

Differential Revision: https://reviews.llvm.org/D147221
2023-03-31 14:47:19 +08:00
Timm Bäder
068e0e001d [clang][Interp][NFC] Add failing test case for InterpFrame::describe() 2023-03-31 08:32:42 +02:00
Timm Bäder
e9b150c2d9 [clang][Interp][NFC] Add missing static_assert message
This broke builders, e.g.
https://lab.llvm.org/buildbot#builders/139/builds/38298
2023-03-31 08:22:34 +02:00
Tobias Gysi
8ac014ae05 [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
2023-03-31 06:08:34 +00:00
Timm Bäder
fce093ccb1 [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
2023-03-31 08:06:06 +02:00
luxufan
00b733e200 [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
2023-03-31 13:44:56 +08:00
Wang, Xin10
66268c8ec4 [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
2023-03-31 01:41:48 -04:00
Timm Bäder
30f96a8fb4 [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
2023-03-31 07:27:04 +02:00
Karl-Johan Karlsson
3834b0467d [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
2023-03-31 07:02:55 +02:00
Yevgeny Rouban
c53d807321 [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
2023-03-31 11:44:05 +07:00
aabhinavg
9eccc145aa [docs][clang] Add extra information inside -fsanitize=unsigned-shift-base for UndefinedBehaviorSanitizer
Close: #60712

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D146947
2023-03-31 09:35:15 +05:30
Peter Rong
3b2476910b [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
2023-03-30 20:14:11 -07:00
Fangrui Song
0de988c98c [docs] Update LLVM_TARGETS_TO_BUILD list 2023-03-30 19:23:14 -07:00
Peter Rong
51a93828d7 [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
2023-03-30 19:20:04 -07:00
wren romano
962484aeca [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
2023-03-30 18:26:34 -07:00
Nikolas Klauser
173476ea04 [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
2023-03-31 02:22:48 +02:00
Craig Topper
00701d32b7 [RISCV] Remove -mattr=+f from rvk-user-csr-name.s.
Zvk is all integer, it shouldn't need +f.
2023-03-30 17:20:09 -07:00
NAKAMURA Takumi
8922a1c15b 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
2023-03-31 09:15:08 +09:00
NAKAMURA Takumi
a365fc4e56 Let IntrinsicEnums.inc conditional by GET_INTRINSIC_ENUM_VALUES
Part of https://reviews.llvm.org/D145873
2023-03-31 09:15:08 +09:00
Leonard Chan
7b6c0ce9c6 Revert ""Reland "[hwasan] Provide aliases for c allocation functions for Fuchsia""
This reverts commit 1190a1dbd5.

This probably broke
https://lab.llvm.org/buildbot/#/builders/77/builds/26043/steps/21/logs/stdio
again.
2023-03-31 00:08:02 +00:00
Richard Smith
3524a9f84a 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.
2023-03-30 17:00:16 -07:00
Richard Smith
bc62fb9e17 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.
2023-03-30 17:00:16 -07:00
Richard Smith
fe73233b3a Convert boolean flag in TemplateParameterListsAreEqual into an
additional enum value and document its meaning.

No functionality change intended.
2023-03-30 17:00:16 -07:00
Richard Smith
e3cba2f464 Clean up template parameter list profiling. No functionality change. 2023-03-30 17:00:16 -07:00
Richard Smith
a07abe27b4 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.
2023-03-30 17:00:16 -07:00
Craig Topper
96a7e05756 [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
2023-03-30 15:55:38 -07:00
Craig Topper
f2315545b2 [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
2023-03-30 15:52:24 -07:00