Commit Graph

430964 Commits

Author SHA1 Message Date
Daniel Bertalan fd30414206 [lld-macho] Demangle location name in undefined symbol diagnostics
If the `-demangle` flag is passed to lld, symbol names will now be
demangled in the "referenced by:" message in addition to the referenced
symbol's name, which was already demangled before this change.

Differential Revision: https://reviews.llvm.org/D130490
2022-07-25 18:42:16 +02:00
Craig Topper 1db6d6dcd8 [RISCV] Teach RISCVCodeGenPrepare to optimize (zext (abs(i32 X, i1 1))).
(abs(i32 X, i1 1) always produces a positive result. The 'i1 1'
means INT_MIN input produces poison. If the result is sign extended,
InstCombine will convert it to zext. This does not produce ideal
code for RISCV.

This patch reverses the zext back to sext which can be folded
into a subw or negw. Ideally we'd do this in SelectionDAG, but
we lose the INT_MIN poison flag when llvm.abs becomes ISD::ABS.

Reviewed By: reames

Differential Revision: https://reviews.llvm.org/D130412
2022-07-25 09:36:41 -07:00
Saiyedul Islam 4cf30c5157
Revert "Revert "Revert "[Libomptarget] Add checks for AMDGPU TargetID using new image info"""
This reverts commit 281eb9223c.
2022-07-25 11:35:37 -05:00
Nikolas Klauser 20a11cb550 [libc++] Fix algorithms which use reverse_iterator
This adds a C++20-version of `reverse_iterator` which doesn't SFINAE away the operators for use inside the classic STL algorithms. Pre-C++20 `_AlgRevIter` is just an alias for `reverse_iterator`.

Reviewed By: var-const, #libc

Spies: huixie90, libcxx-commits

Differential Revision: https://reviews.llvm.org/D128864
2022-07-25 18:35:20 +02:00
Peixin Qiao f532c07211 [flang] Support intrinsic `selected_int_kind` for variables
As Fortran 2018 16.9.169, the argument of selected_int_kind is integer
scalar, and result is default integer scalar. The constant expression in
this intrinsic has been supported by folding the constant expression.
This supports lowering and runtime for variables in this intrinsic.

Reviewed By: Jean Perier

Differential Revision: https://reviews.llvm.org/D129959
2022-07-26 00:33:27 +08:00
Andrzej Warzynski 640c0ad0d5 [flang][nfc] Add missing `REQUIRES: asserts` in a test
This change is required for release builds - see
https://reviews.llvm.org/D130185 for more context.

I'm sending this without a review as this is rather straightforward and
identical to the changes from https://reviews.llvm.org/D130185 (the test
updated in this patch wasn't yet in-tree when D130185 landed).
2022-07-25 16:30:21 +00:00
Jonas Devlieghere 52465dc178
[lldb] Make compiler-rt an optional LLDB test dependency
Make compiler-rt an LLDB test dependency if the corresponding target
exists. Similarly we already have `asan` and `tsan` as optional test
dependencies, but we need the `compiler-rt` target when enabling
compiler-rt trough LLVM_ENABLE_RUNTIMES.
2022-07-25 09:28:56 -07:00
Craig Topper 00060a7b97 [X86] Custom type legalize v2i32 smulo/umulo to use a single pmuldq/pmuludq.
With SSE4.1 and above we were using 3 multiply instructions. This
was due to type legalization widening to v4i32 and the low half
being done with pmulld while the high half used two pmuldq/pmuludq.

Instead of that, we can use a single pmuludq/pmuldq to calculate
the full product at once, extract the high and low bits and compare
to check for overflow.

I've restricted SMULO to sse4.1 to get pmuldq. We can probably
do a fixup to pmuludq on earlier targets, but that's for another day.

I was going through my git stash and found an early version of this patch
from a year or two ago so I went ahead and finished it.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D130432
2022-07-25 09:12:35 -07:00
John Ericson 3ebb2c0427 [llvm][cmake] Shore up `llvm_check_linker_flags`.
Ensure `CMAKE_EXE_LINKER_FLAGS` effects the underlying `try_compile` by setting
this policy to use the new, non-deprecated behavior, without effecting the
caller.

Normally this shouldn't be necessary, as CMake uses
`cmake_minimum_required(VERSION 3.13.4)` consistently, but I suppose
this could rear its head in a downstream project?

Reviewed By: sebastian-ne

Differential Revision: https://reviews.llvm.org/D118546
2022-07-25 16:02:25 +00:00
Benoit Jacob f4ac950957 Generalize the vector transfer flattening patterns (dyn shapes).
Differential Revision: https://reviews.llvm.org/D130284
2022-07-25 15:59:08 +00:00
Bradley Smith 953a98ef8d [AArch64][SVE] Fold target specific ext/trunc nodes into loads/stores
Due to the way fixed length SVE lowering works, we sometimes introduce
ext/trunc nodes very late, these nodes then immediately get converted
into target specific nodes (UUNPKLO/UZP1) before they get a chance to be
folded into a load/store.

This patch introduces target specific dag combines for these nodes so that
we can still create extending loads/truncating stores out of them.

Differential Revision: https://reviews.llvm.org/D128065
2022-07-25 15:24:05 +00:00
David Spickett 91098fec96 [lldb][AArch64] Use macro for unused var without asserts enabled
82d4f39f34 marked an unused
var of mine (thanks Dmitri Gribenko!). Which reminded me lldb has
a macro just for that purpose.
2022-07-25 15:14:49 +00:00
Dmitri Gribenko 82d4f39f34 [lldb][AArch64] Fix an unused variable warning in release builds. NFC 2022-07-25 16:58:03 +02:00
David Spickett 883b0d5b7f [lldb][AArch64] Add UnpackTagsFromCoreFileSegment to MemoryTagManager
This is the first part of support for reading MTE tags from Linux
core files. The format is documented here:
https://www.kernel.org/doc/html/latest/arm64/memory-tagging-extension.html#core-dump-support

This patch adds a method to unpack from the format the core
file uses, which is different to the one chosen for GDB packets.

MemoryTagManagerAArch64MTE is not tied one OS so another OS
might choose a different format in future. However, infrastructure
to handle that would go untested until then so I've chosen not to
attempt to handle that.

Reviewed By: omjavaid

Differential Revision: https://reviews.llvm.org/D129487
2022-07-25 15:51:36 +01:00
Sunho Kim 0f00e58841 [JITLink][COFF][x86_64] Reimplement ADDR32NB/REL32.
Reimplements ADDR32NB/REL32 relocations properly, out-of-reach targets will be dealt in the separate patch that will generate the stub for dllimport symbols.

Reviewed By: sgraenitz

Differential Revision: https://reviews.llvm.org/D129936
2022-07-25 23:41:53 +09:00
Sunho Kim c7ea209068 [ORC][COFF] Properly set weak flag to COMDAT symbols.
Properly set weak flag to COMDAT symbols so that no duplicate definition error will be generated. There is an inaccuracy in setting plain weak for largest selection type, which will be dealt with soon when largest type is properly implemented.

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D129764
2022-07-25 23:24:25 +09:00
Sunho Kim aef75aec38 [JITLink][COFF] Implement IMAGE_SYM_CLASS_LABEL.
AcceptedPublic
Implements IMAGE_SYM_CLASS_LABEL. It's simply a section + offset. This is not used a lot by llvm mc but very commonly used by MSVC compiler.

Reviewed By: sgraenitz

Differential Revision: https://reviews.llvm.org/D129754
2022-07-25 23:22:59 +09:00
Tue Ly 83193a5e72 [libc] Raise FE_INVALID for sinf with +- inf inputs. 2022-07-25 10:20:32 -04:00
Matthias Springer a299539ade [mlir][linalg] Expand test case for tile-and-fuse with transform dialect
Reverse the order of the payload ops. fuse_into_containing_op should still work.

Differential Revision: https://reviews.llvm.org/D130355
2022-07-25 16:14:35 +02:00
Sunho Kim 07aa8fc8db [JITLink][COFF] Handle out-of-order COMDAT second symbol.
Handle out-of-order COMDAT second symbols. In llvm codegen, the second symbol of COMDAT sequence always follows the first symbol in the global symbol list. But, when the object file came from MSVC compiler, these can come in out of order.

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D129721
2022-07-25 23:02:31 +09:00
Sunho Kim b4878493dc [JITLink][COFF] Don't dead strip COMDAT associative symbol.
This prevents the dead strip of associative comdat section when parent section is alive.

Reviewed By: sgraenitz

Differential Revision: https://reviews.llvm.org/D129720
2022-07-25 22:59:19 +09:00
Erich Keane 629903c8a4 Reapply "[NFC] Add some additional features to MultiLevelTemplateArgumentList""
This reverts commit 6a1ccf61cd.

A typo in an assert escaped my local testing thanks to being a release
build :/
2022-07-25 06:57:23 -07:00
Simon Tatham e35fec2c02 [llvm-objdump,ARM] Fix .byte directives dumping the wrong byte.
The clause in `dumpARMELFData` that dumps a single byte as a `.byte`
directive was printing the operand of that directive as `Bytes[0]`,
not `Bytes[Index]`. In particular, this led to the `dumpBytes` output
to its left not matching it!

Reviewed By: DavidSpickett

Differential Revision: https://reviews.llvm.org/D130360
2022-07-25 14:55:33 +01:00
Alex Zinenko 9c1d133c3a [mlir] move _mlir_alloc and friends to CRunnerUtils
These functions don't depend on the C++ runtime and therefore belong to
CRunnerUtils. Clean up the macros on the way as `_MSC_VER` indicates the
compiler, not the platform, which is indicated by `_WIN32` and will be
present when, e.g., compiling with minGW.

Reviewed By: rdzhabarov

Differential Revision: https://reviews.llvm.org/D130025
2022-07-25 15:52:53 +02:00
Michele Scuttari a8601f11fb [MLIR] Generic 'malloc', 'aligned_alloc' and 'free' functions
When converted to the LLVM dialect, the memref.alloc and memref.free operations were generating calls to hardcoded 'malloc' and 'free' functions. This didn't leave any freedom to users to provide their custom implementation. Those operations now convert into calls to '_mlir_alloc' and '_mlir_free' functions, which have also been implemented into the runtime support library as wrappers to 'malloc' and 'free'. The same has been done for the 'aligned_alloc' function.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D128791
2022-07-25 15:52:51 +02:00
Saiyedul Islam 281eb9223c
Revert "Revert "[Libomptarget] Add checks for AMDGPU TargetID using new image info""
This reverts commit 8cbf4a386b.
2022-07-25 08:32:26 -05:00
Iain Sandoe 25558a1bfd [C++20][Modules] Update ADL to handle basic.lookup.argdep p4 [P1815R2 part 1]
This includes the revised provisions of [basic.lookup.argdep] p4

1. ADL is amended to handle p 4.3 where functions in trasitively imported modules may
become visible when they are exported in the same namespace as a visible type.

2. If a function is in a different modular TU, and has internal-linkage, we invalidate
its entry in an overload set.

[basic.lookup.argdep] p5 ex 2 now passes.

Differential Revision: https://reviews.llvm.org/D129174
2022-07-25 14:28:59 +01:00
Ilya Biryukov 59179d72b2 [Sema] Merge C++20 concept definitions from different modules in same TU
Currently the C++20 concepts are only merged in `ASTReader`, i.e. when
coming from different TU. This can causes ambiguious reference errors when
trying to access the same concept that should otherwise be merged.

Please see the added test for an example.

Note that we currently use `ASTContext::isSameEntity` to check for ODR
violations. However, it will not check that concept requirements match.
The same issue holds for mering concepts from different TUs, I added a
FIXME and filed a GH issue to track this:
https://github.com/llvm/llvm-project/issues/56310

Reviewed By: ChuanqiXu

Differential Revision: https://reviews.llvm.org/D128921
2022-07-25 14:43:38 +02:00
Weining Lu aff68f5ad6 [LoongArch] Parse LoongArch base ABI in ObjectYAML and llvm-readobj
LoongArch e_flags definition:
https://loongson.github.io/LoongArch-Documentation/LoongArch-ELF-ABI-EN.html#_e_flags_identifies_abi_type_and_version

Differential Revision: https://reviews.llvm.org/D130238
2022-07-25 20:40:57 +08:00
David Spickett ae8a6602fb [lldb][ARM/AArch64] Use sys/uio.h instead of socket.h in native register context
We only want iovec and uio.h is just that without a lot
of other stuff. Saves me wondering why this code might
want to open sockets.

https://pubs.opengroup.org/onlinepubs/007904975/basedefs/sys/uio.h.html
2022-07-25 12:35:57 +00:00
Cullen Rhodes c04ff587dc [AArch64] Combine setcc (iN (bitcast (vNi1 X))) with vecreduce_or
Reviewed By: paulwalker-arm

Differential Revision: https://reviews.llvm.org/D130163
2022-07-25 12:14:33 +00:00
Cullen Rhodes 5fa185bc73 [AArch64][NFC] Add test case for setcc (iN bitcast (vNi1 X)), (iN 0), (eq|ne)
To be combined to 'setcc (iN (zext (i1 (vecreduce_or (vNi1 X))))), 0, (eq|ne)'
in follow on patch.

Reviewed By: peterwaller-arm

Differential Revision: https://reviews.llvm.org/D130162
2022-07-25 12:14:33 +00:00
Abhina Sreeskantharajan 6e99771a31 [SystemZ][z/OS] Open YAML text files as text
This patch sets the YAML file as text instead of binary.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D130354
2022-07-25 08:07:20 -04:00
Peixin Qiao 57e3fa3815 [flang] Support lowering intrinsic `selected_real_kind` for variables
As Fortran 2018 16.9.170, the argument of `selected_real_kind` is integer
scalar, and result is default integer scalar. The constant expression in
this intrinsic has been supported by folding the constant expression.
This supports lowering this intrinsic for variables using runtime.

Reviewed By: Jean Perier

Differential Revision: https://reviews.llvm.org/D130183
2022-07-25 19:36:14 +08:00
Benjamin Kramer 5fde785186 [ValueTracking] Fix unused variable warning in release builds. NFC 2022-07-25 13:28:32 +02:00
Muhammad Usman Shahid 76476efd68 Rewording "static_assert" diagnostics
This patch rewords the static assert diagnostic output. Failing a
_Static_assert in C should not report that static_assert failed. This
changes the wording to be more like GCC and uses "static assertion"
when possible instead of hard coding the name. This also changes some
instances of 'static_assert' to instead be based on the token in the
source code.

Differential Revision: https://reviews.llvm.org/D129048
2022-07-25 07:22:54 -04:00
Aaron Ballman 214a760a21 Switch from XFAIL to UNSUPPORTED; NFC
This test is currently marked as XFAIL for Windows, but running the
test with a debug build of clang-repl.exe crashes with a modal system
dialog. This switches the test to UNSUPPORTED instead. This makes the
test behavior less onerous for those of us doing Debug builds, at the
expense of a minor bit of coverage if the test were ever to start
passing unexpectedly on Windows (which seems like an unlikely event).
2022-07-25 07:21:19 -04:00
Iain Sandoe b826567136 [C++20][Modules] Add a testcase for [basic.link] p10 [NFC].
This adds a testcase based on example 2 from the basic.link section of the
standard.
2022-07-25 12:20:02 +01:00
Sam McCall b2b993a6ae [pseudo] Eliminate multiple-specified-types ambiguities using guards
Motivating case: `foo bar;` is not a declaration of nothing with `foo` and `bar`
both types.

This is a common and critical ambiguity, clangd/AST.cpp has 20% fewer
ambiguous nodes (1674->1332) after this change.

Differential Revision: https://reviews.llvm.org/D130337
2022-07-25 12:57:07 +02:00
Matthias Springer 1defec8730 [mlir][tensor][bufferize][NFC] Remove duplicate code
InsertSliceOp and ParallelInsertSliceOp are very similar and can share some of the bufferization analysis code.

Differential Revision: https://reviews.llvm.org/D130465
2022-07-25 12:34:16 +02:00
Saiyedul Islam 8cbf4a386b
Revert "[Libomptarget] Add checks for AMDGPU TargetID using new image info"
This reverts commit 471f2abc62.
2022-07-25 05:32:59 -05:00
Matthias Springer 664ffa46bb [mlir][tensor][bufferize] Fix deallocation of GenerateOp/FromElementsOp
Both ops allocate a buffer. There were cases in which the buffer was not deallocated.

Differential Revision: https://reviews.llvm.org/D130469
2022-07-25 12:25:06 +02:00
Alex Zinenko 333ee218ce [mlir] Transform dialect: separate dependent and generated dialects
In the Transform dialect extensions, provide the separate mechanism to
declare dependent dialects (the dialects the transform IR depends on)
and the generated dialects (the dialects the payload IR may be
transformed into). This allows the Transform dialect clients that are
only constructing the transform IR to avoid loading the dialects
relevant for the payload IR along with the Transform dialect itself,
thus decreasing the build/link time.

Reviewed By: springerm

Differential Revision: https://reviews.llvm.org/D130289
2022-07-25 09:59:53 +00:00
Chuanqi Xu d35134485a [C++20] [Modules] Make the linkage consistent for class template and its
specialization

Previously in D120397, we've handled the linkage for function template
and its specialization. But we forgot to handle it for class templates
and their specialization. So we make it in the patch with the similar
approach.
2022-07-25 17:57:02 +08:00
David Stuttard b14d7bf750 AMDGPU: Turn off force init 16 input SGPRS for pal
Pal uses a different mechanism for user sgprs.

Differential Revision: https://reviews.llvm.org/D129566
2022-07-25 10:52:46 +01:00
Saiyedul Islam 471f2abc62
[Libomptarget] Add checks for AMDGPU TargetID using new image info
This patch extends the is_valid_binary routine to also check if the
binary's target ID matches the one parsed from the system's runtime
environment.
This should allow us to only use the binary whose compute capability
matches, allowing us to support basic multi-architecture binaries for
AMDGPU.
It also handles compatibility testing of target IDs of the image and
the enviornment.

Depends on D127432

Differential Revision: https://reviews.llvm.org/D127769
2022-07-25 04:44:36 -05:00
Matthias Springer 5f5f71e737 [mlir][tensor][bufferize] Load dependent dialects
Load dialects that will be generated by the extension. (Except for BufferizationDialect and MemrefDialect which are loaded already.)

Differential Revision: https://reviews.llvm.org/D130463
2022-07-25 11:36:10 +02:00
jacquesguan d8800ead62 [RISCV] Scalarize binop followed by extractelement.
This patch adds shouldScalarizeBinop to RISCV target in order to convert an extract element of a vector binary operation into an extract element followed by a scalar binary operation.

Differential Revision: https://reviews.llvm.org/D129545
2022-07-25 17:23:31 +08:00
Nikita Popov aaeb951b27 [DebugInfo] Avoid ptrtoint expression in generic test
After D130366 the ptrtoint expression this used results in an
error on 32-bit targets (the IR was already invalid previously,
but only produced the error with -filetype=obj).

Tweak the IR so it is correct for both 32-bit and 64-bit targets,
and can thus continue working as a generic test.
2022-07-25 11:20:36 +02:00
Rajas Vanjape d146b51162 [mlir][sparse][nfc] Fix memory leak in sparse sampled matmul integration test
https://reviews.llvm.org/D130023 added a memory leak in sparse_sampled_matmul.mlir
This diff fixes the memory leak.

Testing: Ran integration tests after building with -DLLVM_USE_SANITIZER=Address flag.

Reviewed By: springerm

Differential Revision: https://reviews.llvm.org/D130428
2022-07-25 08:55:12 +00:00