Commit Graph

394300 Commits

Author SHA1 Message Date
Simon Pilgrim 59db3a5df9 [InstCombine] Add multiuse test for D106352 2021-07-21 13:48:15 +01:00
David Spickett bb4f7b9166 [compiler-rt][hwasan] Update register-dump-read.c test
Since d564cfb53c moved
__hwasan_tag_mismatch4 this test has been reporting
a frame 0 of __hwasan_tag_mismatch_v2.

This failure can be seen on our bots:
https://lab.llvm.org/buildbot/#/builders/185/builds/170

Before the change:
 #0 0xaaaaba100e40 in main <...>/register-dump-read.c:21:10
After the change:
 #0 0xaaaab8494bec in __hwasan_tag_mismatch_v2 <...>/hwasan/hwasan_tag_mismatch_aarch64.S:147
 #1 0xaaaab84b4df8 in main <..>/register-dump-read.c:14:10

Update the test to check for a main frame as either frame
0 or frame 1.
2021-07-21 12:43:07 +00:00
Roman Lebedev 48e9602c40
[NFC][VectorCombine] Load widening: add a few more negative tests 2021-07-21 15:21:37 +03:00
Simon Pilgrim 7c53a7d390 IFSStub.cpp - consistently use default case to silence 'not all control paths return' MSVC warnings. NFCI. 2021-07-21 11:59:34 +01:00
David Green 72dc5cab4f [LV] Make use of PatternMatchers in getReductionPatternCost. NFC
Pulled out of D106166, this modifies getReductionPatternCost to use
PatternMatchers, hopefully simplifying the code a little.
2021-07-21 11:34:30 +01:00
Jay Foad 3ed29f960c [AMDGPU] NFC refactoring in isel for buffer access intrinsics
Rename getBufferOffsetForMMO to updateBufferMMO and pass in the MMO to
be updated, in preparation for the bug fix in D106284.

Call updateBufferMMO consistently for all buffer intrinsics, even the
ones that use setBufferOffsets to decompose a combined offset
expression.

Add a getIdxEn helper function.

Differential Revision: https://reviews.llvm.org/D106354
2021-07-21 11:12:49 +01:00
Gabor Marton 732a8a9dfb [Analyzer][solver][NFC] Add explanatory comments to trivial eq classes
Differential Revision: https://reviews.llvm.org/D106370
2021-07-21 11:59:56 +02:00
Simon Tatham 21401a7262 [clang] Introduce SourceLocation::[U]IntTy typedefs.
This is part of a patch series working towards the ability to make
SourceLocation into a 64-bit type to handle larger translation units.

NFC: this patch introduces typedefs for the integer type used by
SourceLocation and makes all the boring changes to use the typedefs
everywhere, but for the moment, they are unconditionally defined to
uint32_t.

Patch originally by Mikhail Maltsev.

Reviewed By: tmatheson

Differential Revision: https://reviews.llvm.org/D105492
2021-07-21 10:45:46 +01:00
Sam McCall 91670f5f20 [clangd] Remove big PreambleData constructor. NFC 2021-07-21 11:31:52 +02:00
Rosie Sumpter 44c9adb414 [LoopFlatten][LoopInfo] Use Loop to identify latch compare instruction
Make getLatchCmpInst non-static and use it in LoopFlatten as a more
robust way of identifying the compare.

Differential Revision: https://reviews.llvm.org/D106256
2021-07-21 10:14:18 +01:00
Sven van Haastregt 724f0e2abb [OpenCL] Add cl_khr_extended_bit_ops
Add the builtins defined by Section 40 "Extended Bit Operations" in
the OpenCL Extension Specification.

Differential Revision: https://reviews.llvm.org/D106267
2021-07-21 10:01:19 +01:00
Kerry McLaughlin e22a599672 [LV] Use lookThroughAnd with logical reductions
If a reduction Phi has a single user which `AND`s the Phi with a type mask,
`lookThroughAnd` will return the user of the Phi and the narrower type represented
by the mask. Currently this is only used for arithmetic reductions, whereas loops
containing logical reductions will create a reduction intrinsic using the widened
type, for example:

  for.body:
    %phi = phi i32 [ %and, %for.body ], [ 255, %entry ]
    %mask = and i32 %phi, 255
    %gep = getelementptr inbounds i8, i8* %ptr, i32 %iv
    %load = load i8, i8* %gep
    %ext = zext i8 %load to i32
    %and = and i32 %mask, %ext
    ...

^ this will generate an and reduction intrinsic such as the following:
    call i32 @llvm.vector.reduce.and.v8i32(<8 x i32>...)

The same example for an add instruction would create an intrinsic of type i8:
    call i8 @llvm.vector.reduce.add.v8i8(<8 x i8>...)

This patch changes AddReductionVar to call lookThroughAnd for other integer
reductions, allowing loops similar to the example above with reductions such
as and, or & xor to vectorize.

Reviewed By: david-arm, dmgreen

Differential Revision: https://reviews.llvm.org/D105632
2021-07-21 09:56:00 +01:00
Jan Kratochvil 278df28557 [nfc] [lldb] Rename GetRnglist() to GetRnglistTable()
My D99653 implemented a getter GetRnglist() for m_rnglist_table.

That was confusing as the getter returns DWARFDebugRnglistTable which
contains DWARFDebugRnglist as its elements.
2021-07-21 10:45:37 +02:00
Cullen Rhodes 008c755d76 [AArch64][SME] Support .arch and .arch_extension assembler directives
Reviewed By: david-arm

Differential Revision: https://reviews.llvm.org/D105566
2021-07-21 08:40:27 +00:00
Tim Northover 19d2e42be2 ARM: don't return by popping PC if we have to adjust the stack afterwards.
In mandatory tail calling conventions we might have to deallocate stack
space used by our arguments before return. This happens after popping
CSRs, so the pop cannot be turned into the return itself in this case.

The else branch here was already a nop, so removing it as a tidy-up.
2021-07-21 09:35:14 +01:00
Tim Northover 291e0daa6e AArch64: support 8 & 16-bit atomic operations in GlobalISel
We have SelectionDAG patterns for 8 & 16-bit atomic operations, but they
assume the value types will have been legalized to 32-bits. So this adds
the ability to widen them to both AArch64 & generic GISel
infrastructure.
2021-07-21 09:35:14 +01:00
Cullen Rhodes 2d80bbd939 [AArch64][SME] Add mova instructions
This patch adds the mova instruction to insert/extract an SVE vector
register to/from a ZA tile vector.

The preferred MOV aliases are also implemented.

Depends on D105572.

The reference can be found here:
https://developer.arm.com/documentation/ddi0602/2021-06

Reviewed By: david-arm, CarolineConcatto

Differential Revision: https://reviews.llvm.org/D105574
2021-07-21 08:20:01 +00:00
Cullen Rhodes 6c32cfe85c [AArch64][SME] Add ldr and str instructions
The reference can be found here:
https://developer.arm.com/documentation/ddi0602/2021-06

Reviewed By: kmclaughlin

Differential Revision: https://reviews.llvm.org/D105573
2021-07-21 08:17:13 +00:00
Siva Chandra Reddy a31f6d2ccf [libc][Obvious] Fix few typos in FPUtil/TestHelpers.cpp 2021-07-21 08:07:35 +00:00
Dmitry Vyukov 74b8fca9e4 sanitizer_common: revert StaticSpinMutex ctor
Patch "sanitizer_common: modernize SpinMutex" added default
ctor to StaticSpinMutex. But it broke some gcc bots with:

scudo_tsd_exclusive.cpp:25:22: error: non-local variable
‘__scudo::TSD’ declared ‘__thread’ needs dynamic initialization

https://lab.llvm.org/buildbot/#/builders/105/builds/12649

Unfortunatly none of empty ctor {}, no ctor, default constexpr ctor
work for different reasons. So remove StaticSpinMutex ctor
entirely and move deleted copy ctor back to SpinMutex.

Differential Revision: https://reviews.llvm.org/D106424
2021-07-21 09:22:09 +02:00
Timm Bäder d16f154240 [llvm][tools] Hide more unrelated LLVM tool options
Differential Revision: https://reviews.llvm.org/D106366
2021-07-21 09:14:04 +02:00
Balázs Kéri 90cb5297ad [clang][analyzer] Improve report of file read at EOF condition (alpha.unix.Stream checker).
The checker warns if a stream is read that is already in end-of-file
(EOF) state.
The commit adds indication of the last location where the EOF flag is set
on the stream.

Reviewed By: Szelethus

Differential Revision: https://reviews.llvm.org/D104925
2021-07-21 08:54:11 +02:00
Dmitry Vyukov 927efd0b5d sanitizer_common: modernize SpinMutex
Some minor improvements:
1. Make StaticSpinMutex non-copyable.
2. Add LIKELY to Lock.
3. Move LockSlow into the .cpp file (now that we have it).
4. The only non-trivial change: use proc_yield(1) instread of proc_yield(10)
   with the proportional increase in the number of spin iterations.
   Latency of the PAUSE instruction has raised from ~1 cycle to ~100 cycles
   in the recent Intel CPUs. So proc_yield(10) is too aggressive backoff.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D106350
2021-07-21 08:14:12 +02:00
Mark de Wever 9226e6f7d2 [libc++][nfc] Adds a missing generated file.
The file was created by libcxx/utils/generate_private_header_tests.py.
2021-07-21 08:06:03 +02:00
Mark de Wever b49961987f [lbc++][nfc] Use _LIBCPP_HIDE_FROM_ABI.
This replaces _LIBCPP_INLINE_VISIBILITY with _LIBCPP_HIDE_FROM_ABI. It's
not intended to do for other parts of libc++. This change makes it easy
to search and replace all occurrences of the patches in review.
2021-07-21 08:02:15 +02:00
Lang Hames 48aa82cacb [ORC][ORC-RT] Revert MachO TLV patches while I investigate more bot failures.
This reverts commit d4abdefc99 ("[ORC-RT] Rename
macho_tlv.x86-64.s to macho_tlv.x86-64.S (uppercase suffix)", and
a7733e9556 ("Re-apply "[ORC][ORC-RT] Add initial
native-TLV support to MachOPlatform."), while I investigate failures on
ccache builders (e.g. https://lab.llvm.org/buildbot/#/builders/109/builds/18981)
2021-07-21 15:52:33 +10:00
Siva Chandra Reddy ff384700f2 [libc][NFC] Adjust enabled_exceptions_test wrt FE_INEXACT.
Since exceptions like FE_DIVBYZERO can raise FE_INEXACT, we need to
ensure that we don't raise FE_DIVBYZERO (or others which can also raise
FE_INEXACT) when FE_INEXACT is enabled.
2021-07-21 05:49:19 +00:00
Lang Hames d4abdefc99 [ORC-RT] Rename macho_tlv.x86-64.s to macho_tlv.x86-64.S (uppercase suffix)
Uppercase .S suffixes for assembly seem to be the convention in compiler-rt.

I'm hoping this will fix the build failures on ccache builders (e.g.
https://lab.llvm.org/buildbot/#/builders/109/builds/18980)
2021-07-21 15:24:24 +10:00
Lang Hames a7733e9556 Re-apply "[ORC][ORC-RT] Add initial native-TLV support to MachOPlatform."
Reapplies fe1fa43f16, which was reverted in
6d8c63946c, with fixes:

1. Remove .subsections_via_symbols directive from macho_tlv.x86-64.s (it's
not needed here anyway).

2. Return error from pthread_key_create to the MachOPlatform to silence unused
variable warning.
2021-07-21 15:11:22 +10:00
Siva Chandra Reddy ec14ab9624 [libc] Add a new test matcher for tests raising floating point exceptions.
This new matcher does not use death tests to check if SIGFPE is raised.
Instead, that a SIGFPE was raised is checked using a SIGFPE signal handler.

Reviewed By: mcgrathr

Differential Revision: https://reviews.llvm.org/D106086
2021-07-21 04:59:39 +00:00
Chia-hung Duan d7314b3c09 [mlir-tblgen] Support binding multi-results of NativeCodeCall
We are able to bind NativeCodeCall result as binding operation. To make
table-gen have better understanding in the form of helper function,
we need to specify the number of return values in the NativeCodeCall
template. A VoidNativeCodeCall is added for void case.

Reviewed By: jpienaar

Differential Revision: https://reviews.llvm.org/D102160
2021-07-21 11:23:22 +08:00
Tianqing Wang bec4a8157d [X86] Update MachineLoopInfo in CMOV conversion.
If a CMOV is in a loop and is converted to branches, CMOV conversion wouldn't
add newly created basic blocks to loop info. Since the candidates is collected
based on loops, instructions in these basic blocks will be ignored.

Reviewed By: pengfei

Differential Revision: https://reviews.llvm.org/D104623
2021-07-21 10:53:46 +08:00
peter klausler 13e08de91d [flang] Two tweaks to mollify buildbots
One test's expected output needs adjustment, and one new compiler
warning needs to be silenced.
2021-07-20 19:42:05 -07:00
Ben Shi d3738a09fb [RISCV][test] Add tests for mul optimization in the zba extension with SH*ADD
These tests will show the following optimization by future patches.

(mul x, 11) -> (SH1ADD (SH2ADD x, x), x)
(mul x, 19) -> (SH1ADD (SH3ADD x, x), x)
(mul x, 13) -> (SH2ADD (SH1ADD x, x), x)
(mul x, 21) -> (SH2ADD (SH2ADD x, x), x)
(mul x, 37) -> (SH2ADD (SH3ADD x, x), x)
(mul x, 25) -> (SH3ADD (SH1ADD x, x), x)
(mul x, 41) -> (SH3ADD (SH2ADD x, x), x)
(mul x, 73) -> (SH3ADD (SH3ADD x, x), x)

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D106031
2021-07-21 10:16:56 +08:00
Vitaly Buka a4904ebb88 [NFC][hwasan] Remove "pragma GCC poison"
With ifdefs they make code less readable.
2021-07-20 19:10:05 -07:00
Vitaly Buka cd4d244757 [NFC][hwasan] Simplify expression 2021-07-20 19:10:05 -07:00
Hsiangkai Wang 89ce644902 [Clang][RISCV] Add half-precision FP for vle16/vse16.
I missed to add half-precision FP types for vle16/vse16 in the previous
patches. Added them in this patch.

Differential Revision: https://reviews.llvm.org/D106340
2021-07-21 09:55:21 +08:00
Alexander Yermolovich 51db236324 [DWP] Fix for Refactoring llvm-dwp in to a library
Fix build for https://reviews.llvm.org/D106198 when -DBUILD_SHARED_LIBS=ON. Test Plan:

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D106414
2021-07-20 18:17:24 -07:00
Jacques Pienaar ec9767ef64 [mlir] Use OpTraitList to define InferTensorType. NFC 2021-07-20 18:15:15 -07:00
Stella Laurenzo 2607209b3f Remove libMLIRPublicAPI DSO.
libMLIRPublicAPI.so came into existence early when the Python and C-API were being co-developed because the Python extensions need a single DSO which exports the C-API to link against. It really should never have been exported as a mondo library in the first place, which has caused no end of problems in different linking modes, etc (i.e. the CAPI tests depended on it).

This patch does a mechanical move that:

* Makes the C-API tests link directly to their respective libraries.
* Creates a libMLIRPythonCAPI as part of the Python bindings which assemble to exact DSO that they need.

This has the effect that the C-API is no longer monolithic and can be subset and used piecemeal in a modular fashion, which is necessary for downstreams to only pay for what they use. There are additional, more fundamental changes planned for how the Python API is assembled which should make it more out of tree friendly, but this minimal first step is necessary to break the fragile dependency between the C-API and Python API.

Downstream actions required:

* If using the C-API and linking against MLIRPublicAPI, you must instead link against its constituent components. As a reference, the Python API dependencies are in lib/Bindings/Python/CMakeLists.txt and approximate the full set of dependencies available.
* If you have a Python API project that was previously linking against MLIRPublicAPI (i.e. to add its own C-API DSO), you will want to `s/MLIRPublicAPI/MLIRPythonCAPI/` and all should be as it was. There are larger changes coming in this area but this part is incremental.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D106369
2021-07-20 17:58:28 -07:00
Vitaly Buka 300dc054e6 [lsan] Remove undefined ENV variables 2021-07-20 17:47:01 -07:00
Vitaly Buka ee6c5b448d [lsan] Remove %pull_from_device from tests
Replaced with %adb_shell cat.
2021-07-20 17:46:05 -07:00
Vitaly Buka 7f7fb2ef5d [compiler-rt] Fix %device_rundir test substitution
"/" needs to be removed to avoid making absolute path.
2021-07-20 17:39:22 -07:00
Jon Roelofs be8738324c [MachineVerifier] Diagnose invalid INSERT_SUBREGs
Differential revision: https://reviews.llvm.org/D105953
2021-07-20 17:32:29 -07:00
Geoffrey Martin-Noble 65cead410b [Bazel] Remove copypasta from linalggen.bzl 2021-07-20 17:27:40 -07:00
peter klausler 0fab536900 [flang] Remove now-unused private data member, silence warning
A field in DescriptorAddendum became unused during a recent
change but was not removed from the definition; it now elicits
a legitimate warning that's affecting some buildbots.  Remove it.
2021-07-20 17:24:39 -07:00
LLVM GN Syncbot d81a3cbe8b [gn build] Port 403e67d34d 2021-07-21 00:19:59 +00:00
Alexander Yermolovich 403e67d34d [DWP] Refactoring llvm-dwp in to a library.
This is a step1, mechanical refactor, of moving the bulk of llvm-dwp functionality in to a library. This should allow other tools, like BOLT, to re-use some of the llvm-dwp functionality.

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D106198
2021-07-20 17:19:26 -07:00
Jon Roelofs a14b4e34a4 [GlobalISel] Tail call memcpy/memmove/memset even in the presence of copies
Differentail revision: https://reviews.llvm.org/D105382
2021-07-20 17:04:33 -07:00
Jon Roelofs afaf92826e [GlobalISel] Mark memcpy/memmove/memset as thisreturn
https://clang.godbolt.org/z/9az64j8W6

rdar://77466123

Differential revision: https://reviews.llvm.org/D105370
2021-07-20 17:04:33 -07:00