platform/upstream/llvm.git
2 years ago[ELF] Update comments/diagnostics for -defsym and -image-base to use the canonical...
Fangrui Song [Mon, 25 Oct 2021 21:01:36 +0000 (14:01 -0700)]
[ELF] Update comments/diagnostics for -defsym and -image-base to use the canonical two-dash form

2 years agoBasic: Stop using expectedToOptional() in FileManagerTest, NFC
Duncan P. N. Exon Smith [Mon, 25 Oct 2021 20:37:45 +0000 (13:37 -0700)]
Basic: Stop using expectedToOptional() in FileManagerTest, NFC

Remove a couple of uses of expectedToOptional() in FileManagerTest,
using Expected<T>::moveInto() to extract the value instead instead.

2 years ago[SCEV] Move SCEVLostPoisonFlags() check into SCEVExpander
Nikita Popov [Sun, 24 Oct 2021 21:42:23 +0000 (23:42 +0200)]
[SCEV] Move SCEVLostPoisonFlags() check into SCEVExpander

Always insert values into ExprValueMap, and instead skip using them
in SCEVExpander if poison-generating flags have been lost. This
ensures that all values that are in ValueExprMap are also in
ExprValueMap, so we can use the latter to invalidate the former.

This change is probably not entirely NFC for the case where
originally the SCEV had no nowrap flags but they were inferred
later, in which case that would now allow reusing the existing
value for expansion.

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

2 years ago[AlwaysInliner] Invalidate analyses when we delete functions
Arthur Eubanks [Mon, 25 Oct 2021 17:52:30 +0000 (10:52 -0700)]
[AlwaysInliner] Invalidate analyses when we delete functions

Fixes PR52292.

Reviewed By: asbirlea

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

2 years ago[gn build] Add missing CodeGenTests dependency
Arthur Eubanks [Mon, 25 Oct 2021 20:33:28 +0000 (13:33 -0700)]
[gn build] Add missing CodeGenTests dependency

Fixes link errors.

2 years ago[libc][NFC] Remove extra space in libc/CMakeLists.txt
Joe Loser [Mon, 25 Oct 2021 20:29:14 +0000 (16:29 -0400)]
[libc][NFC] Remove extra space in libc/CMakeLists.txt

2 years ago[libc][NFC] Remove extra slash in path in libc/CMakeLists.txt
Joe Loser [Mon, 25 Oct 2021 20:26:20 +0000 (16:26 -0400)]
[libc][NFC] Remove extra slash in path in libc/CMakeLists.txt

Remove extra `/` in path to match the include filepath from the previous
line.

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

2 years ago[docs][NewPM] Add example C++ code on how to actually use the new PM
Arthur Eubanks [Mon, 25 Oct 2021 18:46:17 +0000 (11:46 -0700)]
[docs][NewPM] Add example C++ code on how to actually use the new PM

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

2 years ago[LLVM] Inclusive terms: remove/replace references to sanity in RewriteStatepointsForG...
Zarko Todorovski [Mon, 25 Oct 2021 20:05:39 +0000 (16:05 -0400)]
[LLVM] Inclusive terms: remove/replace references to sanity in RewriteStatepointsForGC.cpp and test

Part of work to have the LLVM backend to use more inclusive terms.

Reviewed By: reames

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

2 years ago[BasicAA] Add test for benign range overflow (NFC)
Nikita Popov [Mon, 25 Oct 2021 20:08:56 +0000 (22:08 +0200)]
[BasicAA] Add test for benign range overflow (NFC)

2 years ago[DomTree][NFC] Clean up nits in DomTree code
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

2 years ago[ELF][X86] Support R_X86_64_PLTOFF64
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

2 years ago[ELF] Support 128-bit bitmask in oneof(RelExpr)
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

2 years ago[clangd] IncludeCleaner: Complicated rules for enum usage
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

2 years ago[ELF] Update comments/diagnostics for some long options to use the canonical two...
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.

2 years ago[mlir][Linalg] Allow comprehensive bufferization to use callbacks for alloc/dealloc.
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.

2 years ago[x86] add tests for vector -1 constant materialization; NFC
Sanjay Patel [Mon, 25 Oct 2021 14:43:04 +0000 (10:43 -0400)]
[x86] add tests for vector -1 constant materialization; NFC

2 years ago[ELF] Delete unneeded hack for discarding empty name local symbol
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.

2 years agoAdd modules stats into the "statistics dump" command.
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

2 years ago[JITLink] Fix warning 'shift count exceeds width' in AArch64 backend
Stefan Gränitz [Mon, 25 Oct 2021 18:41:26 +0000 (20:41 +0200)]
[JITLink] Fix warning 'shift count exceeds width' in AArch64 backend

2 years ago[MLIR][Math] Add erf to math dialect
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

2 years ago[openmp] Emit deferred diag only when device compilation presents
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

2 years ago[OpenMP] libomp: disable definitions of 5.1 atomics for non-x86 arch.
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

2 years ago[lldb] [DynamicRegisterInfo] Remove AddRegister() and make Finalize() protected
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

2 years ago[lldb] [gdb-remote] Remove HardcodeARMRegisters() hack
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

2 years agotsan: add DynamicMutexSet helper
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

2 years agomsan: disble CHECK test on powerpc64
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

2 years ago[mlir][sparse] lower trivial tensor.cast on identical sparse tensors
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

2 years agoAdd release notes for the LLDB impact from the array type name change
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.

2 years agoRemove referenced to deleted parallel-libs project
David Blaikie [Sat, 23 Oct 2021 16:56:37 +0000 (09:56 -0700)]
Remove referenced to deleted parallel-libs project

2 years ago[DebugInfo][InstrRef][NFC] Switch to using DenseMaps and similar
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

2 years ago[OPENMP51]Initial parsing/sema for append_args clause for 'declare variant'
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

2 years ago[fir][NFC] Format and make FIROps.td homogenous
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

2 years ago[fir][NFC] Move MLIR includes to FIRDialect.td
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>
2 years ago[WebAssembly] support Memory64 in target_features section
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

2 years ago[DebugInfo][InstrRef] Recover stack-slot tracking performance
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

2 years ago[RISCV] Remove always_inline and nodebug attributes from RISCV vector intrinsic header.
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.

2 years ago[indvars] Fix pr52276 (missing one use check)
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.

2 years ago[OpenMP][OMPT] thread_num determination during execution of nested serialized paralle...
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

2 years ago[OpenMP][OMPT][clang] task frame support fixed in __kmpc_fork_call
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

2 years ago[OpenMP][Tests] Test omp_get_wtime for invariants
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

2 years ago[OpenMP][Tests][NFC] Actually check for test outcome
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.

2 years ago[OpenMP][Tests][NFC] Mark tests trying to link COI as unsupported
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.

2 years ago[OpenMP][Tests][NFC] Replace atomic increment by reduction
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

2 years ago[OpenMP][Tools][NFC] Fix C99-style declaration of iteration variables
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).

2 years ago[OpenMP][Tools][NFC] Pass intel license ENV to lit
Joachim Protze [Mon, 25 Oct 2021 13:24:09 +0000 (15:24 +0200)]
[OpenMP][Tools][NFC] Pass intel license ENV to lit

2 years ago[lldb] Modernize and expand TestCppBitfields
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.

2 years ago[clang] Use llvm::{count,count_if,find_if,all_of,none_of} (NFC)
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)

2 years ago[RISCV] Reduce the number of RISCV vector builtins by an order of magnitude.
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

2 years ago[BasicAA] Add test for incorrect non-negative logic (NFC)
Nikita Popov [Mon, 25 Oct 2021 16:01:03 +0000 (18:01 +0200)]
[BasicAA] Add test for incorrect non-negative logic (NFC)

2 years agoRevert "[mlir][Linalg] Allow comprehensive bufferization to use callbacks for alloc...
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.

2 years ago[RISCV] Add vcsr CSR name for V extension.
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

2 years ago[CodeGen] Fix dependence breaking for tied operands
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

2 years ago[mlir][Linalg] Allow comprehensive bufferization to use callbacks for alloc/dealloc.
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

2 years ago[DebugInfo] Follow up to ee3eee71e, x86 tests need an x86 triple
Jeremy Morse [Mon, 25 Oct 2021 15:43:50 +0000 (16:43 +0100)]
[DebugInfo] Follow up to ee3eee71e, x86 tests need an x86 triple

2 years ago[lldb] Remove a trailing \0 from the result of HostInfoMacOSX::GetOSBuildString
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.

2 years ago[libc++][NFC] Remove unimplemented parts of chrono synopsis
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

2 years ago[libc++] LWG3001: add `remove_extent_t` to `weak_ptr::element_type`.
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

2 years ago[HIP][OpenMP] Fix assertion in deferred diag
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

2 years ago[libc++] Include revision numbers in the paper status lists
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

2 years ago[lldb] [Host/ConnectionFileDescriptor] Do not use non-blocking mode
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

2 years ago[DebugInfo][InstrRef] Track values fused into stack spills
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

2 years ago[AArch64] Handle ST1iN instructions in isAArch64FrameOffsetLegal
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

2 years ago[lldb] Modernize Platform::GetOSBuildString
Pavel Labath [Mon, 25 Oct 2021 13:58:29 +0000 (15:58 +0200)]
[lldb] Modernize Platform::GetOSBuildString

2 years ago[lld-macho][nfc] Rename output binary so it doesn't overwrite existing one
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

2 years ago[BasicAA] Use ranges for more than one index
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

2 years ago[SLP]Change the order of the reduction/binops args pair vectorization attempts.
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

2 years agoDocument `LLVM_USE_SPLIT_DWARF` option
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.

2 years ago[DebugInfo][NFC] Avoid a use-after-free
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.

2 years ago[clang][unittests] Fix shared lib builds
Kadir Cetinkaya [Mon, 25 Oct 2021 13:09:39 +0000 (15:09 +0200)]
[clang][unittests] Fix shared lib builds

2 years ago[DAGCombiner] make matching bit-hack form of usubsat more flexible
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

2 years agoCodeGenPrep: remove all copies of GEP from list if there are duplicates.
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.

2 years agosanitizer_common: trap on CHECK 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

2 years agotsan: fix free_race3.c test
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

2 years ago[AMDGPU] Regenerate some tests with the current version of update_mir_test_checks.py
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

2 years ago[mlir][Vector] NFC - Add option to hook vector.transpose lowering to strategies.
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

2 years ago[analyzer] Retrieve incomplete array extent from its redeclaration.
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

2 years ago[analyzer][NFCI] Move a block from `getBindingForElement` to separate functions
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

2 years ago[mlir][linalg][bufferize] Fix crash when bufferizing CallOpInterface
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

2 years agotsan: add another use-after-free race test
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

2 years agotsan: don't use symbol binding 10
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

2 years ago[VE][NFC] correct bitmasking in popcnt expansion test
Simon Moll [Mon, 25 Oct 2021 11:55:22 +0000 (13:55 +0200)]
[VE][NFC] correct bitmasking in popcnt expansion test

2 years ago[mlr][Linalg] NFC - Add option to hook vector.multi_reduction lowering to strategies.
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

2 years ago[Test] Add test for PR52290
Max Kazantsev [Mon, 25 Oct 2021 11:25:59 +0000 (18:25 +0700)]
[Test] Add test for PR52290

Demonstrates hang in iterativelySimplifyCFG.

2 years ago[clang] Visit enum base specifiers in libIndex
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

2 years ago[clang] Traverse enum base specifier in RAV
Kadir Cetinkaya [Wed, 6 Oct 2021 19:48:14 +0000 (21:48 +0200)]
[clang] Traverse enum base specifier in RAV

2 years ago[clang] Fix range for forward-declared enums
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

2 years ago[lldb] Modernize TestBitfields
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).

2 years ago[AArch64][Driver][SVE] Allow -msve-vector-bits=<n>+ syntax to mean no maximum vscale
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

2 years ago[lldb] Also print index of child when ValueCheck fails
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.

2 years ago[mlir][python] Infer result types in generated constructors whenever possible
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

2 years ago[mlir] support interfaces in Python bindings
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

2 years ago[SVE][CodeGen] Enable reciprocal estimates for scalable fdiv/fsqrt
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

2 years ago[InstCombine] Make TTI comment more forceful (NFC)
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.

2 years ago[SimplifyCFG] Sanity assert in iterativelySimplifyCFG
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.

2 years ago[ARM] Add a complex dotprod test case.
David Green [Mon, 25 Oct 2021 09:52:12 +0000 (10:52 +0100)]
[ARM] Add a complex dotprod test case.

2 years ago[lldb][NFC] Use llvm::Optional to refer to Optional
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.

2 years ago[gn build] Port e1fdec875ff1
LLVM GN Syncbot [Mon, 25 Oct 2021 09:16:00 +0000 (09:16 +0000)]
[gn build] Port e1fdec875ff1

2 years ago[analyzer] Allow cmake options to be passed to satest container
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)

2 years ago[analyzer] Add std::string checker
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