Nikita Popov [Mon, 25 Oct 2021 20:08:56 +0000 (22:08 +0200)]
[BasicAA] Add test for benign range overflow (NFC)
Jakub Kuderski [Mon, 25 Oct 2021 20:04:42 +0000 (16:04 -0400)]
[DomTree][NFC] Clean up nits in DomTree code
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D112482
Fangrui Song [Mon, 25 Oct 2021 20:05:17 +0000 (13:05 -0700)]
[ELF][X86] Support R_X86_64_PLTOFF64
For a function call (using the default `-fplt`), GCC `-mcmodel=large` generates an assembly modifier which
leads to an R_X86_64_PLTOFF64 relocation. In real world,
http://git.ageinghacker.net/jitter (used by GNU poke) uses `-mcmodel=large`.
R_X86_64_PLTOFF64's formula is (if preemptible) `L - GOT + A` or (if non-preemptible) `S - GOT + A`
where `GOT` is (confusingly) the address of `.got.plt`
Reviewed By: peter.smith
Differential Revision: https://reviews.llvm.org/D112386
Fangrui Song [Mon, 25 Oct 2021 19:59:20 +0000 (12:59 -0700)]
[ELF] Support 128-bit bitmask in oneof(RelExpr)
Taken from Chih-Mao Chen's D100835.
RelExpr has 64 bits now and needs the extension to support new members
(`R_PLT_GOTPLT` for `R_X86_64_PLTOFF64` support).
Note: RelExpr needs to have at least a member >=64 to prevent
-Wtautological-constant-out-of-range-compare for `if (expr >= 64)`.
Reviewed By: arichardson, peter.smith
Differential Revision: https://reviews.llvm.org/D112385
Kirill Bobyrev [Mon, 25 Oct 2021 19:26:37 +0000 (21:26 +0200)]
[clangd] IncludeCleaner: Complicated rules for enum usage
Reviewed By: sammccall
Differential Revision: https://reviews.llvm.org/D112209
Fangrui Song [Mon, 25 Oct 2021 19:52:06 +0000 (12:52 -0700)]
[ELF] Update comments/diagnostics for some long options to use the canonical two-dash form
Rewrite some comments as appropriate.
MaheshRavishankar [Mon, 25 Oct 2021 16:00:05 +0000 (09:00 -0700)]
[mlir][Linalg] Allow comprehensive bufferization to use callbacks for alloc/dealloc.
Using callbacks for allocation/deallocation allows users to override
the default.
Also add an option to comprehensive bufferization pass to use `alloca`
instead of `alloc`s. Note that this option is just for testing. The
option to use `alloca` does not work well with the option to allow for
returning memrefs.
Sanjay Patel [Mon, 25 Oct 2021 14:43:04 +0000 (10:43 -0400)]
[x86] add tests for vector -1 constant materialization; NFC
Fangrui Song [Mon, 25 Oct 2021 18:55:31 +0000 (11:55 -0700)]
[ELF] Delete unneeded hack for discarding empty name local symbol
This actually improves GNU ld compatibility.
Correct assemblers don't create such symbols.
Also simplify the code.
Greg Clayton [Thu, 21 Oct 2021 23:01:00 +0000 (16:01 -0700)]
Add modules stats into the "statistics dump" command.
The new module stats adds the ability to measure the time it takes to parse and index the symbol tables for each module, and reports modules statistics in the output of "statistics dump" along with the path, UUID and triple of the module. The time it takes to parse and index the symbol tables are also aggregated into new top level key/value pairs at the target level.
Differential Revision: https://reviews.llvm.org/D112279
Stefan Gränitz [Mon, 25 Oct 2021 18:41:26 +0000 (20:41 +0200)]
[JITLink] Fix warning 'shift count exceeds width' in AArch64 backend
Boian Petkantchin [Mon, 25 Oct 2021 18:15:13 +0000 (18:15 +0000)]
[MLIR][Math] Add erf to math dialect
Add math.erf lowering to libm call.
Add math.erf polynomial approximation.
Reviewed By: silvas, ezhulenev
Differential Revision: https://reviews.llvm.org/D112200
Wei Wang [Thu, 2 Sep 2021 17:18:06 +0000 (10:18 -0700)]
[openmp] Emit deferred diag only when device compilation presents
There is no need to check for deferred diag when device compilation or target is
not given. This results in considerable build time improvement in some cases.
Differential Revision: https://reviews.llvm.org/D109175
AndreyChurbanov [Mon, 25 Oct 2021 18:17:26 +0000 (21:17 +0300)]
[OpenMP] libomp: disable definitions of 5.1 atomics for non-x86 arch.
Declarations of 5.1 atomic entries were added under
"#if KMP_ARCH_X86 || KMP_ARCH_X86_64" in kmp_atomic.h,
but definitions of the functions missed architecture guard in kmp_atomic.cpp.
As a result mangled symbols were available on non-x86 architecture.
The patch eliminates these unexpected symbols from the library.
Differential Revision: https://reviews.llvm.org/D112261
Michał Górny [Sat, 9 Oct 2021 19:22:51 +0000 (21:22 +0200)]
[lldb] [DynamicRegisterInfo] Remove AddRegister() and make Finalize() protected
Now that AddRegister() is no longer used, remove it. While at it,
we can also make Finalize() protected as all supported API methods
call it internally.
Differential Revision: https://reviews.llvm.org/D111498
Michał Górny [Sat, 9 Oct 2021 14:21:49 +0000 (16:21 +0200)]
[lldb] [gdb-remote] Remove HardcodeARMRegisters() hack
HardcodeARMRegisters() is a hack that was supposed to be used "until
we can get an updated debugserver down on the devices". Since it was
introduced back in 2012, there is a good chance that the debugserver
has been updated at least once since then. Removing this code makes
transition to the new DynamicRegisterInfo API easier.
Differential Revision: https://reviews.llvm.org/D111491
Dmitry Vyukov [Mon, 25 Oct 2021 13:53:22 +0000 (15:53 +0200)]
tsan: add DynamicMutexSet helper
MutexSet is too large to be allocated on stack.
But we need local MutexSet objects in few places
and use various hacks to allocate them.
Add DynamicMutexSet helper that simplifies allocation
of such objects.
Reviewed By: melver
Differential Revision: https://reviews.llvm.org/D112449
Dmitry Vyukov [Mon, 25 Oct 2021 17:31:29 +0000 (19:31 +0200)]
msan: disble CHECK test on powerpc64
It seems that CHECK terminates the process with 0 status on powerpc64:
https://reviews.llvm.org/D112440#3084251
Disable the test for now.
Reviewed By: melver
Differential Revision: https://reviews.llvm.org/D112455
Aart Bik [Wed, 20 Oct 2021 19:47:31 +0000 (12:47 -0700)]
[mlir][sparse] lower trivial tensor.cast on identical sparse tensors
Even though tensor.cast is not part of the sparse tensor dialect,
it may be used to cast static dimension sizes to dynamic dimension
sizes for sparse tensors without changing the actual sparse tensor
itself. Those cases should be lowered properly when replacing sparse
tensor types with their opaque pointers. Likewise, no op sparse
conversions are handled by this revision in a similar manner.
Reviewed By: bixia
Differential Revision: https://reviews.llvm.org/D112173
David Blaikie [Mon, 25 Oct 2021 17:17:44 +0000 (10:17 -0700)]
Add release notes for the LLDB impact from the array type name change
Changing the array type printing from `int [N]` to `int[N]` impacts lldb
pretty printer registration & may need to be updated to handle the
dropped space between type and dimensions.
David Blaikie [Sat, 23 Oct 2021 16:56:37 +0000 (09:56 -0700)]
Remove referenced to deleted parallel-libs project
Jeremy Morse [Mon, 25 Oct 2021 16:50:53 +0000 (17:50 +0100)]
[DebugInfo][InstrRef][NFC] Switch to using DenseMaps and similar
There are a few STL containers hanging around that can become DenseMaps,
SmallVectors and similar. This recovers a modest amount of compile time
performance.
While I'm here, adjust the bit layout of ValueIDNum: this was always
supposed to act like a value type, however it seems that clang doesn't
compile the comparison functions to act that way. Add a uint64_t to a
union that explicitly aliases the bitfields, so that we can compare the
whole value as a single integer.
Differential Revision: https://reviews.llvm.org/D112333
Mike Rice [Thu, 14 Oct 2021 21:28:51 +0000 (14:28 -0700)]
[OPENMP51]Initial parsing/sema for append_args clause for 'declare variant'
Adds initial parsing and sema for the 'append_args' clause.
Note that an AST clause is not created as it instead adds its values
to the OMPDeclareVariantAttr.
Differential Revision: https://reviews.llvm.org/D111854
Valentin Clement [Mon, 25 Oct 2021 16:35:21 +0000 (18:35 +0200)]
[fir][NFC] Format and make FIROps.td homogenous
This patch has couple of small changes to clean-up FIROps.td.
- Wrap lines that are longer than 80.
- All parser, verifier and printer that are single line are wrapped with double
quotes.
- Couple of small typos.
Reviewed By: AlexisPerry
Differential Revision: https://reviews.llvm.org/D112436
Valentin Clement [Mon, 25 Oct 2021 16:33:00 +0000 (18:33 +0200)]
[fir][NFC] Move MLIR includes to FIRDialect.td
The fir_Dialect definition was coming silently through FIRTypes.td.
Make the include of flang/Optimizer/Dialect/FIRDialect.td explicit in
FIROps.td and move MLIR includes to FIRDialect.td.
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: AlexisPerry
Differential Revision: https://reviews.llvm.org/D112418
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Wouter van Oortmerssen [Thu, 21 Oct 2021 20:44:54 +0000 (13:44 -0700)]
[WebAssembly] support Memory64 in target_features section
Differential Revision: https://reviews.llvm.org/D112266
Jeremy Morse [Mon, 25 Oct 2021 16:21:35 +0000 (17:21 +0100)]
[DebugInfo][InstrRef] Recover stack-slot tracking performance
This patch is like D111627 -- instead of calculating IDF for every location
on the stack, only do it for the smallest units of interference, and copy
the PHIs for those units to any aliases.
The test added runs placeMLocPHIs directly, and tests that:
* A def of the lower 8 bits of a stack slot causes all aliasing regs to
have PHIs placed,
* It doesn't cause the equivalent location to x86's $ah, which isn't
aliased, to have a PHI placed.
Differential Revision: https://reviews.llvm.org/D112324
Craig Topper [Mon, 25 Oct 2021 16:28:56 +0000 (09:28 -0700)]
[RISCV] Remove always_inline and nodebug attributes from RISCV vector intrinsic header.
I don't think these are needed with the way builtin_alias is
implemented.
Philip Reames [Mon, 25 Oct 2021 16:25:00 +0000 (09:25 -0700)]
[indvars] Fix pr52276 (missing one use check)
The recently added logic to canonicalize exit conditions to unsigned relies on facts which hold about the use (i.e. exit test). Applying this blindly to the icmp is not legal, as there may be another use which never reaches the exit. Restrict ourselves to case where we have a single use.
Vladimir Inđić [Mon, 25 Oct 2021 16:16:09 +0000 (18:16 +0200)]
[OpenMP][OMPT] thread_num determination during execution of nested serialized parallel regions
__ompt_get_task_info_internal function is adapted to support thread_num
determination during the execution of multiple nested serialized
parallel regions enclosed by a regular parallel region.
Consider the following program that contains parallel region R1 executed
by two threads. Let the worker thread T of region R1 executes serialized
parallel regions R2 that encloses another serialized parallel region R3.
Note that the thread T is the master thread of both R2 and R3 regions.
Assume that __ompt_get_task_info_internal function is called with the
argument "ancestor_level == 1" during the execution of region R3.
The function should determine the "thread_num" of the thread T inside
the team of region R2, whose implicit task is at level 1 inside the
hierarchy of active tasks. Since the thread T is the master thread of
region R2, one should expected that "thread_num" takes a value 0.
After the while loop finishes, the following stands: "lwt != NULL",
"prev_lwt == NULL", "prev_team" represents the team information about
the innermost serialized parallel region R3. This results in executing
the assignment "thread_num = prev_team->t.t_master_tid". Note that
"prev_team->t.t_master_tid" was initialized at the moment of
R2’s creation and represents the "thread_num" of the thread T inside
the region R1 which encloses R2. Since the thread T is the worker thread
of the region R1, "the thread_num" takes value 1, which is a contradiction.
This patch proposes to use "lwt" instead of "prev_lwt" when determining
the "thread_num". If "lwt" exists, the task at the requested level belongs
to the serialized parallel region. Since the serialized parallel region
is executed by one thread only, the "thread_num" takes value 0.
Similarly, assume that __ompt_get_task_info_internal function is called
with the argument "ancestor_level == 2" during the execution of region R3.
The function should determine the "thread_num" of the thread T inside the
team of region R1. Since the thread is the worker inside the region R1,
one should expected that "thread_num" takes value 1. After the loop finishes,
the following stands: "lwt == NULL", "prev_lwt != NULL", "prev_team" represents
the team information about the innermost serialized parallel region R3.
This leads to execution of the assignment "thread_num = 0", which causes
a contradiction.
Ignoring the "prev_lwt" leads to executing the assignment
"thread_num = prev_team->t.t_master_tid" instead. From the previous explanation,
it is obvious that "thread_num" takes value 1.
Note that the "prev_lwt" variable is marked as unnecessary and thus removed.
This patch introduces the test case which represents the OpenMP program
described earlier in the summary.
Differential Revision: https://reviews.llvm.org/D110699
Vladimir Inđić [Mon, 25 Oct 2021 11:58:57 +0000 (13:58 +0200)]
[OpenMP][OMPT][clang] task frame support fixed in __kmpc_fork_call
__kmp_fork_call sets the enter_frame of the active task (th_curren_task)
before new parallel region begins. After the region is finished, the
enter_frame is cleared.
The old implementation of __kmpc_fork_call didn’t clear the enter_frame of
active task.
Also, the way of initializing the enter_frame of the active task was wrong.
Consider the following two OpenMP programs.
The first program: Let R1 be the serialized parallel region that encloses
another serialized parallel region R2. Assume that thread that executes R2 is
going to create a new serialized parallel region R3 by executing
__kmpc_fork_call. This thread is responsible to set enter_frame of R2's
implicit task. Note that the information about R2's implicit task is present
inside master_th->th.th_current_task at this moment, while lwt represents the
information about R1's implicit task. The old implementation uses lwt and
resets enter_frame of R1's implicit task instead of R2's implicit task. The
new implementation uses master_th->th.th_current_task instead.
The second program: Consider the OpenMP program that contains parallel region
R1 which encloses an explicit task T. Assume that thread should create another
parallel region R2 during the execution of the T. The __kmpc_fork_call is
responsible to create R2 and set enter frame of T whose information is present
inside the master_th->th.th_current_task.
Old implementation tries to set the frame of
parent_team->t.t_implicit_task_taskdata[tid] which corresponds to the implicit
task of the R1, instead of T.
Differential Revision: https://reviews.llvm.org/D112419
Joachim Protze [Mon, 25 Oct 2021 15:01:49 +0000 (17:01 +0200)]
[OpenMP][Tests] Test omp_get_wtime for invariants
As discussed in D108488, testing for invariants of omp_get_wtime would be more
reliable than testing for duration of sleep, as return from sleep might be
delayed due to system load.
Alternatively/in addition, we could compare the time measured by omp_get_wtime
to time measured with C++11 chrono (for portability?).
Differential Revision: https://reviews.llvm.org/D112458
Joachim Protze [Mon, 25 Oct 2021 15:44:39 +0000 (17:44 +0200)]
[OpenMP][Tests][NFC] Actually check for test outcome
The CHECK: line in the test had no effect, because the test does not
pipe to FileCheck. Since the test only checks for a single value,
encode the result in the return value of the test.
Joachim Protze [Mon, 25 Oct 2021 14:10:14 +0000 (16:10 +0200)]
[OpenMP][Tests][NFC] Mark tests trying to link COI as unsupported
For some tests with target-related functionality icc 18/19 tries to link
libioffload_target.so.5, which fails for missing COI symbols.
Joachim Protze [Mon, 25 Oct 2021 14:02:31 +0000 (16:02 +0200)]
[OpenMP][Tests][NFC] Replace atomic increment by reduction
Also mark the test as unsupported by intel-21, because the test does
not terminate
Joachim Protze [Mon, 25 Oct 2021 13:27:38 +0000 (15:27 +0200)]
[OpenMP][Tools][NFC] Fix C99-style declaration of iteration variables
Where possible change to declare the variable before the loop.
Where not possible, specifically request -std=c99 (could be limited to
specific compilers like icc).
Joachim Protze [Mon, 25 Oct 2021 13:24:09 +0000 (15:24 +0200)]
[OpenMP][Tools][NFC] Pass intel license ENV to lit
Raphael Isemann [Mon, 25 Oct 2021 15:44:02 +0000 (17:44 +0200)]
[lldb] Modernize and expand TestCppBitfields
* clang-format test source.
* Removed the dead setup code.
* Using expect_expr etc. instead of raw expect.
* Slightly expanded with tests for vtable pointers (which mostly just crash atm.)
* Removed some other minor test guideline problems.
Kazu Hirata [Mon, 25 Oct 2021 16:14:45 +0000 (09:14 -0700)]
[clang] Use llvm::{count,count_if,find_if,all_of,none_of} (NFC)
Craig Topper [Mon, 25 Oct 2021 15:56:43 +0000 (08:56 -0700)]
[RISCV] Reduce the number of RISCV vector builtins by an order of magnitude.
All but 2 of the vector builtins are only used by clang_builtin_alias.
When using clang_builtin_alias, the type string of the builtin is never
checked. Only the types in the function definition used for the alias
are checked.
This patch takes advantage of this to share a single builtin for
many different types. We already used type overloads on the IR intrinsic
so the codegen for the builtins that are being merge were already
the same. This extends the type overloading to the builtins.
I had to make a few tweaks to make this work.
-Floating point vector-vector vmerge now uses the vmerge intrinsic
instead of the vfmerge intrinsic. New isel patterns and tests are
added to support this.
-The SemaChecking for the immediate of vset_v/vget_v has been removed.
Determining the valid range is harder now. I've added masking to
ManualCodegen to ensure valid IR for invalid input.
This reduces the number of builtins from ~25000 to ~1100.
Reviewed By: HsiangKai
Differential Revision: https://reviews.llvm.org/D112102
Nikita Popov [Mon, 25 Oct 2021 16:01:03 +0000 (18:01 +0200)]
[BasicAA] Add test for incorrect non-negative logic (NFC)
MaheshRavishankar [Mon, 25 Oct 2021 15:56:31 +0000 (08:56 -0700)]
Revert "[mlir][Linalg] Allow comprehensive bufferization to use callbacks for alloc/dealloc."
This reverts commit
c86f218fe4ca661a4348d20b66210324224870e8.
Revert because it causes build failure.
Craig Topper [Mon, 25 Oct 2021 15:49:58 +0000 (08:49 -0700)]
[RISCV] Add vcsr CSR name for V extension.
Reviewed By: frasercrmck, kito-cheng
Differential Revision: https://reviews.llvm.org/D112342
Danila Malyutin [Thu, 5 Aug 2021 16:53:58 +0000 (19:53 +0300)]
[CodeGen] Fix dependence breaking for tied operands
Differential Revision: https://reviews.llvm.org/D107582
MaheshRavishankar [Mon, 25 Oct 2021 05:30:10 +0000 (22:30 -0700)]
[mlir][Linalg] Allow comprehensive bufferization to use callbacks for alloc/dealloc.
Using callbacks for allocation/deallocation allows users to override
the default.
Also add an option to comprehensive bufferization pass to use `alloca`
instead of `alloc`s. Note that this option is just for testing. The
option to use `alloca` does not work well with the option to allow for
returning memrefs.
Differential Revision: https://reviews.llvm.org/D112166
Jeremy Morse [Mon, 25 Oct 2021 15:43:50 +0000 (16:43 +0100)]
[DebugInfo] Follow up to
ee3eee71e, x86 tests need an x86 triple
Pavel Labath [Mon, 25 Oct 2021 15:33:06 +0000 (17:33 +0200)]
[lldb] Remove a trailing \0 from the result of HostInfoMacOSX::GetOSBuildString
This has been in there since forever, but only started to matter once
40e4ac3e changed how we print the string.
Joe Loser [Mon, 25 Oct 2021 15:15:33 +0000 (11:15 -0400)]
[libc++][NFC] Remove unimplemented parts of chrono synopsis
Several parts in the `chrono` synopsis for C++20 are not yet
implemented. The current recommendation is that things are added to the
synopsis when implemented -- not beforehand. As such, remove the
not-yet-implemented parts to avoid confusion.
Reviewed By: ldionne, Quuxplusone, #libc
Differential Revision: https://reviews.llvm.org/D111922
Konstantin Varlamov [Mon, 25 Oct 2021 15:15:38 +0000 (11:15 -0400)]
[libc++] LWG3001: add `remove_extent_t` to `weak_ptr::element_type`.
Also fix a few places in the `shared_ptr` implementation where
`element_type` was passed to the `__is_compatible` helper. This could
result in `remove_extent` being applied twice to the pointer's template
type (first by the definition of `element_type` and then by the helper),
potentially leading to somewhat less readable error messages for some
incorrect code.
Differential Revision: https://reviews.llvm.org/D112092
Yaxun (Sam) Liu [Thu, 21 Oct 2021 16:59:49 +0000 (12:59 -0400)]
[HIP][OpenMP] Fix assertion in deferred diag
Fix assertion in UsedDeclVisitor where clang is trying to look up a destructor
for a forward declared class.
Fixes: https://bugs.llvm.org/show_bug.cgi?id=52250
Reviewed by: Artem Belevich, John McCall
Differential Revision: https://reviews.llvm.org/D112235
Louis Dionne [Fri, 22 Oct 2021 19:08:46 +0000 (15:08 -0400)]
[libc++] Include revision numbers in the paper status lists
Several of our C++20 and C++2b papers were missing the actual revision
number that was voted in to the Standard. The revision number is quite
important because in a few cases, a paper has a revision *after* the
one that is voted into the Standard, which isn't voted into the Standard.
Hence, if we simply followed the wg21.link blindly and implemented that,
we'd end up implementing the latest revision of the paper, which might
not have been voted.
As a fly-by fix, I found out that P1664 had been withdrawn from the
straw polls and had never been voted into the Standard. This commit
removes that entry from our list.
Differential Revision: https://reviews.llvm.org/D112339
Michał Górny [Mon, 25 Oct 2021 12:32:56 +0000 (14:32 +0200)]
[lldb] [Host/ConnectionFileDescriptor] Do not use non-blocking mode
Disable non-blocking mode that's enabled only for file:// and serial://
protocols. All read operations should be going through the select(2)
in ConnectionFileDescriptor::BytesAvaliable, which effectively erases
(non-)blocking mode differences in reading. We do want to perform
writes in the blocking mode.
Differential Revision: https://reviews.llvm.org/D112442
Jeremy Morse [Mon, 25 Oct 2021 14:09:42 +0000 (15:09 +0100)]
[DebugInfo][InstrRef] Track values fused into stack spills
During register allocation, some instructions can have stack spills fused
into them. It means that when vregs are allocated on the stack we can
convert:
SETCCr %0
DBG_VALUE %0
to
SETCCm %stack.0
DBG_VALUE %stack.0
Unfortunately instruction referencing finds this harder: a store to the
stack doesn't have a specific operand number, therefore we don't substitute
the old operand for a new operand, and the location is dropped. This patch
implements a solution: just recognise the memory operand attached to an
instruction with a Special Number (TM), and record a substitution between
the old value and the new one.
This patch adds substitution code to InlineSpiller to record such fused
spills, and tracking in InstrRefBasedLDV to recognise such values, and
produce the value numbers for them. Everything to do with the movement of
stack-defined values is already handled in InstrRefBasedLDV.
Differential Revision: https://reviews.llvm.org/D111317
Danila Malyutin [Fri, 22 Oct 2021 12:28:06 +0000 (15:28 +0300)]
[AArch64] Handle ST1iN instructions in isAArch64FrameOffsetLegal
Before the code would crash with "unhandled opcode in
isAArch64FrameOffsetLegal" when there was a spill from extractelement.
Fixes pr52249
Differential Revision: https://reviews.llvm.org/D112311
Pavel Labath [Mon, 25 Oct 2021 13:58:29 +0000 (15:58 +0200)]
[lldb] Modernize Platform::GetOSBuildString
Vy Nguyen [Mon, 25 Oct 2021 02:46:46 +0000 (22:46 -0400)]
[lld-macho][nfc] Rename output binary so it doesn't overwrite existing one
`%t/basics` already exists - it would be nice to be able to examine it afterward
Differential Revision: https://reviews.llvm.org/D112392
Nikita Popov [Thu, 14 Oct 2021 20:53:45 +0000 (22:53 +0200)]
[BasicAA] Use ranges for more than one index
D109746 made BasicAA use range information to determine the
minimum/maximum GEP offset. However, it was limited to the case of
a single variable index. This patch extends support to multiple
indices by adding all the ranges together.
Differential Revision: https://reviews.llvm.org/D112378
Alexey Bataev [Thu, 21 Oct 2021 14:39:28 +0000 (07:39 -0700)]
[SLP]Change the order of the reduction/binops args pair vectorization attempts.
Need to change the order of the reduction/binops args pair vectorization
attempts. Need to try to find the reduction at first and postpone
vectorization of binops args. This may help to find more reduction
patterns and vectorize them.
Part of D111574.
Differential Revision: https://reviews.llvm.org/D112224
Chris Bieneman [Mon, 25 Oct 2021 13:14:46 +0000 (18:44 +0530)]
Document `LLVM_USE_SPLIT_DWARF` option
This patch adds a documentation note about the LLVM_USE_SPLIT_DWARF
CMake option which is useful to reduce linker memory usage.
Jeremy Morse [Mon, 25 Oct 2021 13:09:14 +0000 (14:09 +0100)]
[DebugInfo][NFC] Avoid a use-after-free
This patch swaps two lines -- the CurSucc reference can be invalidated
by the call to DFS.push_back, therefore that should happen last. The
usual hat-tip to asan for catching this.
This patch also swaps an ealier call to ToAdd.insert and DFS.push_back,
where a stable iterator (from successors()) is being used. This isn't
strictly necessary, but is good for consistency and avoiding readers
asking themselves why the two code portions have a different order.
Kadir Cetinkaya [Mon, 25 Oct 2021 13:09:39 +0000 (15:09 +0200)]
[clang][unittests] Fix shared lib builds
Sanjay Patel [Mon, 25 Oct 2021 12:57:10 +0000 (08:57 -0400)]
[DAGCombiner] make matching bit-hack form of usubsat more flexible
(i8 X ^ 128) & (i8 X s>> 7) --> usubsat X, 128
As suggested in D112085, we can substitute 'xor' with 'add'
in this pattern, and it is logically equivalent:
https://alive2.llvm.org/ce/z/eJtWWC
We canonicalize to 'xor' in IR, but SDAG does not do that
(and it probably should not - https://llvm.org/PR52267 ), so
it is possible to see either pattern in codegen. Note that
'sub' is a another potential pattern, but that is
canonicalized to 'add' in DAGCombiner, so we don't need to
worry about that variation.
Differential Revision: https://reviews.llvm.org/D112377
Tim Northover [Mon, 25 Oct 2021 12:27:00 +0000 (13:27 +0100)]
CodeGenPrep: remove all copies of GEP from list if there are duplicates.
Unfortunately ToT has changed enough from the revision where this actually
caused problems that the test no longer triggers an assertion failure.
Dmitry Vyukov [Mon, 25 Oct 2021 12:17:17 +0000 (14:17 +0200)]
sanitizer_common: trap on CHECK failure
Trapping on CHECK failure makes it more convinient to use with gdb
(no need to set a breakpoint each time). Without a debugger attached
trap should terminate the program as well.
Reviewed By: melver
Differential Revision: https://reviews.llvm.org/D112440
Dmitry Vyukov [Mon, 25 Oct 2021 12:36:23 +0000 (14:36 +0200)]
tsan: fix free_race3.c test
PPC64 bot failed with the following error.
The buildbot output is not particularly useful,
but looking at other similar tests, it seems
that there is something broken in free stacks on PPC64.
Use the same hack as other tests use to expect
an additional stray frame.
/home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/llvm/compiler-rt/test/tsan/free_race3.c:28:11: error: CHECK: expected string not found in input
// CHECK: Previous write of size 4 at {{.*}} by thread T1{{.*}}:
^
<stdin>:13:9: note: scanning from here
#1 main /home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/llvm/compiler-rt/test/tsan/free_race3.c:17:3 (free_race3.c.tmp+0x1012fab8)
^
<stdin>:17:2: note: possible intended match here
ThreadSanitizer: reported 1 warnings
^
Input file: <stdin>
Check file: /home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/llvm/compiler-rt/test/tsan/free_race3.c
-dump-input=help explains the following input dump.
Input was:
<<<<<<
.
.
.
8: Previous write of size 4 at 0x7ffff4d01ab0 by thread T1:
9: #0 Thread /home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/llvm/compiler-rt/test/tsan/free_race3.c:8:10 (free_race3.c.tmp+0x1012f9dc)
10:
11: Thread T1 (tid=3222898, finished) created by main thread at:
12: #0 pthread_create /home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/llvm/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp:1001:3 (free_race3.c.tmp+0x100b9040)
13: #1 main /home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/llvm/compiler-rt/test/tsan/free_race3.c:17:3 (free_race3.c.tmp+0x1012fab8)
check:28'0 X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
14:
check:28'0 ~
15: SUMMARY: ThreadSanitizer: data race /home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/llvm/compiler-rt/test/tsan/free_race3.c:19:3 in main
check:28'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16: ==================
check:28'0 ~~~~~~~~~~~~~~~~~~~
17: ThreadSanitizer: reported 1 warnings
check:28'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:28'1 ? possible intended match
>>>>>>
Reviewed By: melver
Differential Revision: https://reviews.llvm.org/D112444
Thomas Symalla [Mon, 25 Oct 2021 08:16:42 +0000 (10:16 +0200)]
[AMDGPU] Regenerate some tests with the current version of update_mir_test_checks.py
Nicolas Vasilache [Mon, 25 Oct 2021 11:22:22 +0000 (11:22 +0000)]
[mlir][Vector] NFC - Add option to hook vector.transpose lowering to strategies.
This revision also moves some code around to improve overall structure.
Differential Revision: https://reviews.llvm.org/D112437
Denys Petrov [Wed, 20 Oct 2021 12:28:34 +0000 (15:28 +0300)]
[analyzer] Retrieve incomplete array extent from its redeclaration.
Summary: Fix a case when the extent can not be retrieved correctly from incomplete array declaration. Use redeclaration to get the array extent.
Differential Revision: https://reviews.llvm.org/D111542
Denys Petrov [Mon, 18 Oct 2021 16:13:05 +0000 (19:13 +0300)]
[analyzer][NFCI] Move a block from `getBindingForElement` to separate functions
Summary:
1. Improve readability by moving deeply nested block of code from RegionStoreManager::getBindingForElement to new separate functions:
- getConstantValFromConstArrayInitializer;
- getSValFromInitListExpr.
2. Handle the case when index is a symbolic value. Write specific test cases.
3. Add test cases when there is no initialization expression presented.
This patch implies to make next patches clearer and easier for review process.
Differential Revision: https://reviews.llvm.org/D106681
Matthias Springer [Mon, 25 Oct 2021 06:53:05 +0000 (15:53 +0900)]
[mlir][linalg][bufferize] Fix crash when bufferizing CallOpInterface
Do not erase those ops during the traversal. Also improve error handling.
Differential Revision: https://reviews.llvm.org/D112405
Dmitry Vyukov [Sun, 24 Oct 2021 12:19:16 +0000 (14:19 +0200)]
tsan: add another use-after-free race test
Add a test where a race with free is called during the free itself
(we only have tests where a race with free is caught during the other memory acces).
Reviewed By: melver
Differential Revision: https://reviews.llvm.org/D112433
Dmitry Vyukov [Sun, 24 Oct 2021 07:22:58 +0000 (09:22 +0200)]
tsan: don't use symbol binding 10
Building Go programs with the current runtime fails with:
loadelf: race_linux_amd64: malformed elf file:
_ZZN6__tsan15RestoreAddrImpl5ApplyINS_11MappingGo48EEEmmE6ranges: invalid symbol binding 10
Go linker does not understand ELF in all its generality.
Don't use static const data in inline methods.
Reviewed By: melver
Differential Revision: https://reviews.llvm.org/D112434
Simon Moll [Mon, 25 Oct 2021 11:55:22 +0000 (13:55 +0200)]
[VE][NFC] correct bitmasking in popcnt expansion test
Nicolas Vasilache [Mon, 25 Oct 2021 08:39:36 +0000 (08:39 +0000)]
[mlr][Linalg] NFC - Add option to hook vector.multi_reduction lowering to strategies.
Differential Revision: https://reviews.llvm.org/D112414
Max Kazantsev [Mon, 25 Oct 2021 11:25:59 +0000 (18:25 +0700)]
[Test] Add test for PR52290
Demonstrates hang in iterativelySimplifyCFG.
Kadir Cetinkaya [Wed, 6 Oct 2021 19:59:04 +0000 (21:59 +0200)]
[clang] Visit enum base specifiers in libIndex
Fixes https://github.com/clangd/clangd/issues/878.
Differential Revision: https://reviews.llvm.org/D111260
Kadir Cetinkaya [Wed, 6 Oct 2021 19:48:14 +0000 (21:48 +0200)]
[clang] Traverse enum base specifier in RAV
Kadir Cetinkaya [Wed, 6 Oct 2021 18:25:26 +0000 (20:25 +0200)]
[clang] Fix range for forward-declared enums
This used to span just the `[[enum foo]] : bar;` in the absence of a
body. This patch expands the range to cover the base specifier, so that the
various consumers can detect the full range of the decl.
Differential Revision: https://reviews.llvm.org/D111259
Raphael Isemann [Mon, 25 Oct 2021 10:51:31 +0000 (12:51 +0200)]
[lldb] Modernize TestBitfields
This just does the usual modernizations such as using new test functions where
possible, clang-formatting the source, avoiding manual process setup,
assert improvements (` assertTrue(a == b) -> assertEqual(a, b)`).
This doesn't add any new test cases but removes some dependence on unrelated
features where possible (e.g., structs declared in functions, using the standard
library to printf stuff or initialize objects).
Bradley Smith [Thu, 14 Oct 2021 11:04:33 +0000 (11:04 +0000)]
[AArch64][Driver][SVE] Allow -msve-vector-bits=<n>+ syntax to mean no maximum vscale
This patch splits the existing SveVectorBits LangOpt into VScaleMin and
VScaleMax LangOpts such that we can represent such an option. The cc1
option has also been split into -mvscale-{min,max}=<n> options so that the
cc1 arguments better reflect the vscale_range IR attribute.
Differential Revision: https://reviews.llvm.org/D111790
Raphael Isemann [Mon, 25 Oct 2021 10:51:19 +0000 (12:51 +0200)]
[lldb] Also print index of child when ValueCheck fails
Makes the test failure reason more obvious in cases where we have unnamed fields
or large records.
Alex Zinenko [Thu, 14 Oct 2021 15:19:06 +0000 (17:19 +0200)]
[mlir][python] Infer result types in generated constructors whenever possible
In several cases, operation result types can be unambiguously inferred from
operands and attributes at operation construction time. Stop requiring the user
to provide these types as arguments in the ODS-generated constructors in Python
bindings. In particular, handle the SameOperandAndResultTypes and
FirstAttrDerivedResultType traits as well as InferTypeOpInterface using the
recently added interface support. This is a significant usability improvement
for IR construction, similar to what C++ ODS provides.
Depends On D111656
Reviewed By: gysit
Differential Revision: https://reviews.llvm.org/D111811
Alex Zinenko [Thu, 14 Oct 2021 15:18:28 +0000 (17:18 +0200)]
[mlir] support interfaces in Python bindings
Introduce the initial support for operation interfaces in C API and Python
bindings. Interfaces are a key component of MLIR's extensibility and should be
available in bindings to make use of full potential of MLIR.
This initial implementation exposes InferTypeOpInterface all the way to the
Python bindings since it can be later used to simplify the operation
construction methods by inferring their return types instead of requiring the
user to do so. The general infrastructure for binding interfaces is defined and
InferTypeOpInterface can be used as an example for binding other interfaces.
Reviewed By: gysit
Differential Revision: https://reviews.llvm.org/D111656
Kerry McLaughlin [Mon, 25 Oct 2021 08:59:24 +0000 (09:59 +0100)]
[SVE][CodeGen] Enable reciprocal estimates for scalable fdiv/fsqrt
This patch enables the use of reciprocal estimates for SVE
when both the -Ofast and -mrecip flags are used.
Reviewed By: david-arm, paulwalker-arm
Differential Revision: https://reviews.llvm.org/D111657
Nikita Popov [Mon, 25 Oct 2021 10:10:31 +0000 (12:10 +0200)]
[InstCombine] Make TTI comment more forceful (NFC)
To save people not familiar with InstCombine from creating patches
that are immediately rejected by policy.
Max Kazantsev [Mon, 25 Oct 2021 09:43:11 +0000 (16:43 +0700)]
[SimplifyCFG] Sanity assert in iterativelySimplifyCFG
We observe a hang within iterativelySimplifyCFG due to infinite
loop execution. Currently, there is no limit to this loop, so
in case of bug it just works forever. This patch adds an assert
that will break it after 1000 iterations if it didn't converge.
David Green [Mon, 25 Oct 2021 09:52:12 +0000 (10:52 +0100)]
[ARM] Add a complex dotprod test case.
Raphael Isemann [Mon, 25 Oct 2021 09:35:15 +0000 (11:35 +0200)]
[lldb][NFC] Use llvm::Optional to refer to Optional
clang::Optional is just an alias used within Clang.
LLVM GN Syncbot [Mon, 25 Oct 2021 09:16:00 +0000 (09:16 +0000)]
[gn build] Port
e1fdec875ff1
Manas [Mon, 25 Oct 2021 09:15:40 +0000 (11:15 +0200)]
[analyzer] Allow cmake options to be passed to satest container
This patch selects all cmake options and passes them to global cmake
command while building LLVM inside satest docker container.
Prior to this, the cmake command was hard-coded and this would consume
a huge amount of memory while building. There was no support to pass
extra cmake options for the build, except for changing the command
manually. This patch allows testers to pass all "-D*" cmake options to
the build.
Reviewed By: vsavchenko
Differential Revision: https://reviews.llvm.org/D105447
Patch by: @manas (Manas Gupta)
Balazs Benics [Mon, 25 Oct 2021 09:15:40 +0000 (11:15 +0200)]
[analyzer] Add std::string checker
This patch adds a checker checking `std::string` operations.
At first, it only checks the `std::string` single `const char *`
constructor for nullness.
If It might be `null`, it will constrain it to non-null and place a note
tag there.
Reviewed By: martong
Differential Revision: https://reviews.llvm.org/D111247
Pavel Labath [Mon, 25 Oct 2021 09:12:39 +0000 (11:12 +0200)]
Fix windows build for
6fa1b4ff4
Michał Górny [Fri, 22 Oct 2021 13:34:54 +0000 (15:34 +0200)]
[lldb] [Utility/UriParser] Return results as 'struct URI'
Return results of URI parsing as 'struct URI' instead of assigning them
via output parameters.
Differential Revision: https://reviews.llvm.org/D112314
Nikita Popov [Sat, 23 Oct 2021 16:12:54 +0000 (18:12 +0200)]
[InstSimplify] Refactor invariant.group load folding
Currently strip.invariant/launder.invariant are handled by
constructing constant expressions with the intrinsics skipped.
This takes an alternative approach of accumulating the offset
using stripAndAccumulateConstantOffsets(), with a flag to look
through invariant.group intrinsics.
Differential Revision: https://reviews.llvm.org/D112382
Florian Hahn [Mon, 25 Oct 2021 08:40:11 +0000 (09:40 +0100)]
[VPlan] Do not create dummy entry block (NFC).
At the moment a dummy entry block is created at the beginning of VPlan
construction. This dummy block is later removed again.
This means it is not easy to identify the VPlan header block in a
general fashion, because during recipe creation it is the single
successor of the entry block, while later it is the entry block.
To make getting the header easier, just skip creating the dummy block.
Reviewed By: Ayal
Differential Revision: https://reviews.llvm.org/D111299
Michał Górny [Sat, 23 Oct 2021 15:49:58 +0000 (17:49 +0200)]
[lldb] Support serial port parity checking
Differential Revision: https://reviews.llvm.org/D112365
Jingu Kang [Thu, 30 Sep 2021 14:39:10 +0000 (15:39 +0100)]
[AArch64] Remove redundant ORRWrs which is generated by zero-extend
%3:gpr32 = ORRWrs $wzr, %2, 0
%4:gpr64 = SUBREG_TO_REG 0, %3, %subreg.sub_32
If AArch64's 32-bit form of instruction defines the source operand of ORRWrs,
we can remove the ORRWrs because the upper 32 bits of the source operand are
set to zero.
Differential Revision: https://reviews.llvm.org/D110841
Pavel Labath [Thu, 21 Oct 2021 11:32:42 +0000 (13:32 +0200)]
Remove ConstString from DynamicLoader, JITLoader and Instruction plugin names
Pavel Labath [Fri, 22 Oct 2021 12:19:27 +0000 (14:19 +0200)]
[lldb/DWARF] Don't create lldb_private::Functions for gc'ed DW_TAG_subprograms
Front-load the first_valid_code_address check, so that we avoid creating
the function object (instead of simply refusing to use it in queries).
Differential Revision: https://reviews.llvm.org/D112310
Nikita Popov [Mon, 25 Oct 2021 08:27:08 +0000 (10:27 +0200)]
[SCEVExpander] Minor cleanup in value reuse (NFC)
Use dyn_cast_or_null and convert one of the checks into an
assertion. SCEV is a per-function analysis.