platform/upstream/llvm.git
4 years ago[analyzer] Change the default output type to PD_TEXT_MINIMAL in the frontend, error...
Kirstóf Umann [Tue, 19 May 2020 23:36:06 +0000 (01:36 +0200)]
[analyzer] Change the default output type to PD_TEXT_MINIMAL in the frontend, error if an output loc is missing for PathDiagConsumers that need it

The title and the included test file sums everything up -- the only thing I'm
mildly afraid of is whether anyone actually depends on the weird behavior of
HTMLDiagnostics pretending to be TextDiagnostics if an output directory is not
supplied. If it is, I guess we would need to resort to tiptoeing around the
compatibility flag.

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

4 years agoAdd terminateCommands to lldb-vscode protocol
António Afonso [Tue, 19 May 2020 23:01:43 +0000 (16:01 -0700)]
Add terminateCommands to lldb-vscode protocol

Summary: Adding this in line with "stopCommands" and "exitCommands" so that we can run commands at the end of the debugging session.

Reviewers: clayborg, wallace, labath

Reviewed By: clayborg, labath

Subscribers: lldb-commits

Tags: #lldb

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

4 years ago[lldb/test] Move "DataFormatters/Mock.h" to "Plugins/Language/ObjC/Utilities.h"
Vedant Kumar [Tue, 19 May 2020 23:06:38 +0000 (16:06 -0700)]
[lldb/test] Move "DataFormatters/Mock.h" to "Plugins/Language/ObjC/Utilities.h"

This addresses some post-commit review feedback from
https://reviews.llvm.org/D80150 by renaming "Mock.h" to something less
misleading, and keeping logic related to the ObjC plugin separate from
the generic DataFormatters library.

4 years ago[asan_symbolize] Fix bug handling C++ symbols when using Atos.
Dan Liew [Thu, 7 May 2020 19:38:14 +0000 (12:38 -0700)]
[asan_symbolize] Fix bug handling C++ symbols when using Atos.

Summary:
The previous code tries to strip out parentheses and anything in between
them. I'm guessing the idea here was to try to drop any listed arguments
for the function being symbolized. Unfortunately this approach is broken
in several ways.

* Templated functions may contain parentheses. The existing approach
messes up these names.
* In C++ argument types are part of a function's signature for the
purposes of overloading so removing them could be confusing.

Fix this simply by not trying to adjust the function name that comes
from `atos`.

A test case is included.

Without the change the test case produced output like:

```
WRITE of size 4 at 0x6060000001a0 thread T0
    #0 0x10b96614d in IntWrapper<void >::operator=> const&) asan-symbolize-templated-cxx.cpp:10
    #1 0x10b960b0e in void writeToA<IntWrapper<void > >>) asan-symbolize-templated-cxx.cpp:30
    #2 0x10b96bf27 in decltype>)>> >)) std::__1::__invoke<void >), IntWrapper<void > >>), IntWrapper<void >&&) type_traits:4425
    #3 0x10b96bdc1 in void std::__1::__invoke_void_return_wrapper<void>::__call<void >), IntWrapper<void > >>), IntWrapper<void >&&) __functional_base:348
    #4 0x10b96bd71 in std::__1::__function::__alloc_func<void >), std::__1::allocator<void >)>, void >)>::operator>&&) functional:1533
    #5 0x10b9684e2 in std::__1::__function::__func<void >), std::__1::allocator<void >)>, void >)>::operator>&&) functional:1707
    #6 0x10b96cd7b in std::__1::__function::__value_func<void >)>::operator>&&) const functional:1860
    #7 0x10b96cc17 in std::__1::function<void >)>::operator>) const functional:2419
    #8 0x10b960ca6 in Foo<void >), IntWrapper<void > >::doCall>) asan-symbolize-templated-cxx.cpp:44
    #9 0x10b96088b in main asan-symbolize-templated-cxx.cpp:54
    #10 0x7fff6ffdfcc8 in start (in libdyld.dylib) + 0
```

Note how the symbol names for the frames are messed up (e.g. #8, #1).

With the patch the output looks like:

```
WRITE of size 4 at 0x6060000001a0 thread T0
    #0 0x10005214d in IntWrapper<void (int)>::operator=(IntWrapper<void (int)> const&) asan-symbolize-templated-cxx.cpp:10
    #1 0x10004cb0e in void writeToA<IntWrapper<void (int)> >(IntWrapper<void (int)>) asan-symbolize-templated-cxx.cpp:30
    #2 0x100057f27 in decltype(std::__1::forward<void (*&)(IntWrapper<void (int)>)>(fp)(std::__1::forward<IntWrapper<void (int)> >(fp0))) std::__1::__invoke<void (*&)(IntWrapper<void (int)>), IntWrapper<void (int)> >(void (*&)(IntWrapper<void (int)>), IntWrapper<void (int)>&&) type_traits:4425
    #3 0x100057dc1 in void std::__1::__invoke_void_return_wrapper<void>::__call<void (*&)(IntWrapper<void (int)>), IntWrapper<void (int)> >(void (*&)(IntWrapper<void (int)>), IntWrapper<void (int)>&&) __functional_base:348
    #4 0x100057d71 in std::__1::__function::__alloc_func<void (*)(IntWrapper<void (int)>), std::__1::allocator<void (*)(IntWrapper<void (int)>)>, void (IntWrapper<void (int)>)>::operator()(IntWrapper<void (int)>&&) functional:1533
    #5 0x1000544e2 in std::__1::__function::__func<void (*)(IntWrapper<void (int)>), std::__1::allocator<void (*)(IntWrapper<void (int)>)>, void (IntWrapper<void (int)>)>::operator()(IntWrapper<void (int)>&&) functional:1707
    #6 0x100058d7b in std::__1::__function::__value_func<void (IntWrapper<void (int)>)>::operator()(IntWrapper<void (int)>&&) const functional:1860
    #7 0x100058c17 in std::__1::function<void (IntWrapper<void (int)>)>::operator()(IntWrapper<void (int)>) const functional:2419
    #8 0x10004cca6 in Foo<void (IntWrapper<void (int)>), IntWrapper<void (int)> >::doCall(IntWrapper<void (int)>) asan-symbolize-templated-cxx.cpp:44
    #9 0x10004c88b in main asan-symbolize-templated-cxx.cpp:54
    #10 0x7fff6ffdfcc8 in start (in libdyld.dylib) + 0
```

rdar://problem/58887175

Reviewers: kubamracek, yln

Subscribers: #sanitizers, llvm-commits

Tags: #sanitizers

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

4 years ago[analyzer][NFC] Merge checkNewAllocator's paramaters into CXXAllocatorCall
Kirstóf Umann [Sun, 1 Mar 2020 20:26:49 +0000 (21:26 +0100)]
[analyzer][NFC] Merge checkNewAllocator's paramaters into CXXAllocatorCall

Party based on this thread:
http://lists.llvm.org/pipermail/cfe-dev/2020-February/064754.html.

This patch merges two of CXXAllocatorCall's parameters, so that we are able to
supply a CallEvent object to check::NewAllocatorCall (see the description of
D75430 to see why this would be great).

One of the things mentioned by @NoQ was the following:

  I think at this point we might actually do a good job sorting out this
  check::NewAllocator issue because we have a "separate" "Environment" to hold
  the other SVal, which is "objects under construction"! - so we should probably
  simply teach CXXAllocatorCall to extract the value from the
  objects-under-construction trait of the program state and we're good.

I had MallocChecker in my crosshair for now, so I admittedly threw together
something as a proof of concept. Now that I know that this effort is worth
pursuing though, I'll happily look for a solution better then demonstrated in
this patch.

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

4 years agoAMDGPU: Annotate functions that have stack objects
Matt Arsenault [Tue, 19 May 2020 18:32:31 +0000 (14:32 -0400)]
AMDGPU: Annotate functions that have stack objects

Relying on any MachineFunction state in the MachineFunctionInfo
constructor is hazardous, because the construction time is unclear and
determined by the first use. The function may be only partially
constructed, which is part of why we have many of these hacky string
attributes to track what we need for ABI lowering.

For SelectionDAG, all stack objects are created up-front before
calling convention lowering so stack objects are visible at
construction time. For GlobalISel, none of the IR function has been
visited yet and the allocas haven't been added to the MachineFrameInfo
yet. This should fix failing to set flat_scratch_init in GlobalISel
when needed.

This pass really needs to be turned into some kind of analysis, but I
haven't found a nice way use one here.

4 years agoanalyzer][CallAndMessage][NFC] Change old callbacks to rely on CallEvent
Kirstóf Umann [Tue, 14 Apr 2020 16:02:31 +0000 (18:02 +0200)]
analyzer][CallAndMessage][NFC] Change old callbacks to rely on CallEvent

The following series of patches has something similar in mind with D77474, with
the same goal to finally end incorrect checker names for good. Despite
CallAndMessage not suffering from this particular issue, it is a dependency for
many other checkers, which is problematic, because we don't really want
dependencies to also emit diagnostics (reasoning for this is also more detailed
in D77474).

CallAndMessage also has another problem, namely that it is responsible for a lot
of reports. You'll soon learn that this isn't really easy to solve for
compatibility reasons, but that is the topic of followup patches.

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

4 years ago[SVE] MOVPRFX zero merging test renaming
Cameron McInally [Tue, 19 May 2020 22:28:35 +0000 (17:28 -0500)]
[SVE] MOVPRFX zero merging test renaming

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

4 years agoGlobalISel: Copy correct flags to select
Matt Arsenault [Tue, 19 May 2020 13:27:25 +0000 (09:27 -0400)]
GlobalISel: Copy correct flags to select

This was looking for a compare condition, and copying the compare
flags. I don't think this was ever correct outside of certain min/max
patterns which aren't checked, but this probably predates select
instructions having fast math flags.

4 years ago[analyzer][ObjCGenerics] Don't emit diagnostics under the name core.DynamicTypePropag...
Kirstóf Umann [Tue, 14 Apr 2020 16:02:31 +0000 (18:02 +0200)]
[analyzer][ObjCGenerics] Don't emit diagnostics under the name core.DynamicTypePropagation

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

4 years agoAMDGPU: Fix DAG divergence for implicit function arguments
Matt Arsenault [Wed, 13 May 2020 17:24:32 +0000 (13:24 -0400)]
AMDGPU: Fix DAG divergence for implicit function arguments

This should be directly implied from the register class, and there's
no need to special case live ins here. This was getting the wrong
answer for the queue ptr argument in callable functions, since it's
not an explicit IR argument and is always uniform.

Fixes not using scalar loads for the aperture in addrspacecast
lowering, and any other places that use implicit SGPR arguments.

4 years agoAMDGPU: Use member initializers in MFI
Matt Arsenault [Tue, 19 May 2020 17:44:14 +0000 (13:44 -0400)]
AMDGPU: Use member initializers in MFI

4 years ago[Hexagon] pX.new cannot be used with p3:0 as producer
Brian Cain [Fri, 15 May 2020 15:56:42 +0000 (10:56 -0500)]
[Hexagon] pX.new cannot be used with p3:0 as producer

Writes to p3:0 do not produce new values, we should bar any .new
consumer trying to use it as a producer.

4 years ago[analyzer][NSOrCFError] Don't emit diagnostics under the name osx.NSOrCFErrorDerefChecker
Kirstóf Umann [Tue, 14 Apr 2020 15:44:44 +0000 (17:44 +0200)]
[analyzer][NSOrCFError] Don't emit diagnostics under the name osx.NSOrCFErrorDerefChecker

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

4 years agoGlobalISel: Remove unused include
Matt Arsenault [Tue, 19 May 2020 16:28:56 +0000 (12:28 -0400)]
GlobalISel: Remove unused include

4 years agoCodeGen: Use Register
Matt Arsenault [Tue, 19 May 2020 17:01:19 +0000 (13:01 -0400)]
CodeGen: Use Register

4 years ago[MLIR][cmake][NFC] Check for incorrect usage of LLVM components in LINK_LIBS
Stephen Neuendorffer [Mon, 18 May 2020 06:09:41 +0000 (23:09 -0700)]
[MLIR][cmake][NFC] Check for incorrect usage of LLVM components in LINK_LIBS

Using LLVM components in LINK_LIBS means that the mechanisms for
replacing component dependencies with libLLVM.so break.  Try to catch
this incorrect usage up front, instead of waiting until later when we
get difficult to understand runtime errors from incorrectly linked
libraries.

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

4 years ago[MLIR] LLVMMLIRTableGen -> MLIRTableGen
Stephen Neuendorffer [Mon, 18 May 2020 04:43:32 +0000 (21:43 -0700)]
[MLIR] LLVMMLIRTableGen -> MLIRTableGen

Like all MLIR libraries, this should start with 'MLIR'

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

4 years ago[mlir][SPIRV] Fix blocks nested too deeply error.
MaheshRavishankar [Tue, 19 May 2020 21:29:47 +0000 (14:29 -0700)]
[mlir][SPIRV] Fix blocks nested too deeply error.

Issue arises due to a giant if/else if/else/... construct. Changing
them to just ifs.

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

4 years ago[mlir][shape] Add `shape.from_extents`.
Sean Silva [Wed, 13 May 2020 01:38:55 +0000 (18:38 -0700)]
[mlir][shape] Add `shape.from_extents`.

Summary:
This is a basic op needed for creating shapes from SSA values
representing the extents.

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

4 years agoRevert "[clang-misexpect] Fixed typo which causes that --pgo-warn-misexpect option...
Dávid Bolvanský [Tue, 19 May 2020 21:20:54 +0000 (23:20 +0200)]
Revert "[clang-misexpect] Fixed typo which causes that --pgo-warn-misexpect option is not passed in the compiler invocation"

This reverts commit 6d2b75e0887ee87e247756c4d51733616bb2f356.

4 years ago[gn build] Try harder to unbreak Windows build after f8e833a501.
Nico Weber [Tue, 19 May 2020 21:12:30 +0000 (17:12 -0400)]
[gn build] Try harder to unbreak Windows build after f8e833a501.

4 years ago[clang-misexpect] Fixed typo which causes that --pgo-warn-misexpect option is not...
Dávid Bolvanský [Tue, 19 May 2020 21:12:08 +0000 (23:12 +0200)]
[clang-misexpect] Fixed typo which causes that --pgo-warn-misexpect option is not passed in the compiler invocation

4 years ago[AArch64] Disable MachineOutliner on Windows.
Eli Friedman [Tue, 19 May 2020 20:46:35 +0000 (13:46 -0700)]
[AArch64] Disable MachineOutliner on Windows.

The handling of unwind info is broken, so disable it for now.

4 years agoFix X86_64 complex-returns for regcall.
Erich Keane [Tue, 19 May 2020 19:54:35 +0000 (12:54 -0700)]
Fix X86_64 complex-returns for regcall.

D35259 introduced a case where complex types of non-long-double would
result in FI.getReturnInfo() to not be initialized properly.  This
resulted in a crash under some very specific circumstances when
dereferencing the LLVMContext.

This patch makes sure that these types have the intended getReturnInfo
initialization.

4 years agoGive helpers internal linkage. NFC.
Benjamin Kramer [Tue, 19 May 2020 20:16:15 +0000 (22:16 +0200)]
Give helpers internal linkage. NFC.

4 years ago[gn build] Try to unbreak Windows build after f8e833a501.
Nico Weber [Tue, 19 May 2020 20:13:57 +0000 (16:13 -0400)]
[gn build] Try to unbreak Windows build after f8e833a501.

4 years ago[lldb/Reproducers] Update GDB remote client tests for passive replay
Jonas Devlieghere [Tue, 19 May 2020 20:07:05 +0000 (13:07 -0700)]
[lldb/Reproducers] Update GDB remote client tests for passive replay

Tests that check the state of the server don't work when replayed
because the replay server replies to requests.

4 years ago[analyzer] Move apiModeling.StdCLibraryFunctionArgs to alpha.
Artem Dergachev [Tue, 19 May 2020 19:43:10 +0000 (22:43 +0300)]
[analyzer] Move apiModeling.StdCLibraryFunctionArgs to alpha.

It was enabled by default accidentally; still missing some important
features. Also it needs a better package because it doesn't boil down to
API modeling.

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

4 years ago[gn build] Add a flag zlib_path to provide the path to zlib on Windows.
Sébastien Marchand [Tue, 19 May 2020 19:58:52 +0000 (15:58 -0400)]
[gn build] Add a flag zlib_path to provide the path to zlib on Windows.

Also, automatically set llvm_enable_zlib to true when zlib_path is set.

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

4 years ago[PowerPC][NFC] Cleanup load/store spilling code
Lei Huang [Mon, 11 May 2020 18:49:50 +0000 (13:49 -0500)]
[PowerPC][NFC] Cleanup load/store spilling code

Summary: Cleanup and commonize code used for spilling to the stack.

Reviewers: stefanp, nemanjai, #powerpc, kamaub

Reviewed By: nemanjai, #powerpc, kamaub

Subscribers: kamaub, hiraditya, wuzish, shchenz, llvm-commits, kbarton

Tags: #llvm, #powerpc

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

4 years ago[PGOProfile] make test less brittle; NFC
Sanjay Patel [Tue, 19 May 2020 19:54:29 +0000 (15:54 -0400)]
[PGOProfile] make test less brittle; NFC

This test may fail just from cosmetic diffs because the values change names.
This is a minimal diff to work-around that, but more may be needed.

4 years ago[WebAssembly] Fix bug in custom shuffle combine
Thomas Lively [Tue, 19 May 2020 19:54:15 +0000 (12:54 -0700)]
[WebAssembly] Fix bug in custom shuffle combine

Summary:
The code previously assumed the source of the bitcast in the combined
pattern was a vector type, but this is not always true. This patch
adds a check to avoid an assertion failure in that case.

Reviewers: aheejin

Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits

Tags: #llvm

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

4 years ago[WebAssembly] Implement i64x2.mul and remove i8x16.mul
Thomas Lively [Tue, 19 May 2020 19:50:44 +0000 (12:50 -0700)]
[WebAssembly] Implement i64x2.mul and remove i8x16.mul

Summary:
This reflects changes in the spec proposal made since basic arithmetic
was first implemented.

Reviewers: aheejin

Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

4 years ago[lld-macho][re-land] Support X86_64_RELOC_UNSIGNED
Jez Ng [Tue, 19 May 2020 15:53:53 +0000 (08:53 -0700)]
[lld-macho][re-land] Support X86_64_RELOC_UNSIGNED

This reverts commit db8559eee4a07c44babcc4618eef3d185cf79cc6.

4 years ago[lld-macho][re-land] Support .subsections_via_symbols
Jez Ng [Tue, 19 May 2020 15:46:07 +0000 (08:46 -0700)]
[lld-macho][re-land] Support .subsections_via_symbols

Summary:
This diff restores and builds upon @pcc and @ruiu's initial work on
subsections.

The .subsections_via_symbols directive indicates we can split each
section along symbol boundaries, unless those symbols have been marked
with `.alt_entry`.

We exercise this functionality in our tests by using order files that
rearrange those symbols.

Depends on D79668.

Reviewers: ruiu, pcc, MaskRay, smeenai, alexshap, gkm, Ktwu, christylee

Reviewed By: smeenai

Subscribers: thakis, llvm-commits, pcc, ruiu

Tags: #llvm

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

4 years ago[llvm][docs] Add step by step git to GettingStarted
Zola Bridges [Sun, 17 May 2020 17:11:26 +0000 (10:11 -0700)]
[llvm][docs] Add step by step git to GettingStarted

Summary:
Due to deleting the git llvm script, folks were asking for better documentation
about how to use git in order to commit to the Github repo. I added some step
by step git commands to make the usage clearer.

link: http://lists.llvm.org/pipermail/llvm-dev/2020-May/141640.html
Reviewed By: spatel, mehdi_amini

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

4 years ago[PhaseOrdering] add tests for x86 horizontal math ops (PR41813); NFC
Sanjay Patel [Tue, 19 May 2020 18:54:19 +0000 (14:54 -0400)]
[PhaseOrdering] add tests for x86 horizontal math ops (PR41813); NFC

4 years ago[PhaseOrdering] make different pass manager runs equivalent; NFC
Sanjay Patel [Tue, 19 May 2020 18:51:21 +0000 (14:51 -0400)]
[PhaseOrdering] make different pass manager runs equivalent; NFC

I don't see any difference from the 'avx' setting, so leaving that
off until there's a need for it.

4 years ago[IR] Simplify BasicBlock::removePredecessor. NFCI.
Jay Foad [Mon, 18 May 2020 15:24:18 +0000 (16:24 +0100)]
[IR] Simplify BasicBlock::removePredecessor. NFCI.

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

4 years ago[SVE] Add specialized getters to derived vector types
Christopher Tetreault [Tue, 19 May 2020 17:47:16 +0000 (10:47 -0700)]
[SVE] Add specialized getters to derived vector types

Summary:
Add versions of the specialized getters in base VectorType to the
derived vector types that return derived pointers. This reduces the
amount of casting you need to do when working with derived vectors

Reviewers: efriedma, david-arm, fpetrogalli, craig.topper

Reviewed By: david-arm

Subscribers: tschuett, rkruppe, psnobl, llvm-commits

Tags: #llvm

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

4 years ago[lldb/Properties] Move OSPluginReportsAllThreads from Target to Process
Jonas Devlieghere [Tue, 19 May 2020 18:16:57 +0000 (11:16 -0700)]
[lldb/Properties] Move OSPluginReportsAllThreads from Target to Process

This is what Jim wanted originally.

rdar://problem/61236293

Differential revision: https://reviews.llvm.org/D80159

4 years ago[LVI] Don't require DominatorTree in LVI (NFC)
Nikita Popov [Wed, 25 Mar 2020 19:02:07 +0000 (20:02 +0100)]
[LVI] Don't require DominatorTree in LVI (NFC)

After D76797 the dominator tree is no longer used in LVI, so we
can remove it as a pass dependency, and also get rid of the
dominator tree enabling/disabling logic in JumpThreading.

Apart from cleaning up the code, this also clarifies LVI
cache consistency, in that the LVI cache can no longer
depend on whether the DT was or wasn't enabled due to
pending DT updates at any given time.

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

4 years ago[mlir][StandardToSPIRV] Fix signedness issue in bitwidth emulation.
Hanhan Wang [Tue, 19 May 2020 17:55:17 +0000 (10:55 -0700)]
[mlir][StandardToSPIRV] Fix signedness issue in bitwidth emulation.

Summary:
Previously, after applying the mask, a negative number would convert to a
positive number because the sign flag was forgotten. This patch adds two more
shift operations to do the sign extension. This assumes that we're using two's
complement.

This patch applies sign extension unconditionally when loading a unspported integer width, and it relies the pattern to do the casting because the signedness semantic is carried by operator itself.

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

4 years agoSilence warnings around int/float conversions.
Eric Christopher [Tue, 19 May 2020 17:55:30 +0000 (10:55 -0700)]
Silence warnings around int/float conversions.

4 years ago[lldb/Reproducers] Move connection logic into replay server (NFC)
Jonas Devlieghere [Tue, 19 May 2020 16:55:07 +0000 (09:55 -0700)]
[lldb/Reproducers] Move connection logic into replay server (NFC)

Move the logic for connecting to the replay server into the replay
server itself, so it can be reused outside of ProcessGDBRemote.

4 years agoFix aux-target diagnostics for certain builtins
Erich Keane [Tue, 19 May 2020 17:15:34 +0000 (10:15 -0700)]
Fix aux-target diagnostics for certain builtins

When I fixed the targets specific builtins to make sure that aux-targets
are checked, it seems I didn't consider cases where the builtins check
the target info for further info.  This patch bubbles the target-info
down to the individual checker functions to ensure that they validate
against the aux-target as well.

For non-aux-target invocations, this is an NFC.

4 years ago[StackColoring] When remapping alloca's move the To alloca if the From alloca is...
Craig Topper [Tue, 19 May 2020 16:59:24 +0000 (09:59 -0700)]
[StackColoring] When remapping alloca's move the To alloca if the From alloca is before it.

If To is after From its possible that there's a use of From
between them.

Fixes issue reported here http://lists.llvm.org/pipermail/llvm-dev/2020-May/141421.html

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

4 years agoEntropic: Boosting LibFuzzer Performance
Matt Morehouse [Tue, 19 May 2020 17:28:18 +0000 (10:28 -0700)]
Entropic: Boosting LibFuzzer Performance

Summary:
This is collaboration between Marcel Boehme @ Monash, Australia and Valentin Manès plus Sang Kil Cha @ KAIST, South Korea.

We have made a few modifications to boost LibFuzzer performance by changing how weights are assigned to the seeds in the corpus. Essentially, seeds that reveal more "information" about globally rare features are assigned a higher weight. Our results on the Fuzzer Test Suite seem quite promising. In terms of bug finding, our Entropic patch usually finds the same errors much faster and in more runs. In terms of coverage, our version Entropic achieves the same coverage in less than half the time for the majority of subjects. For the lack of space, we shared more detailed performance results directly with @kcc. We'll publish the preprint with all the technical details as soon as it is accepted. Happy to share if you drop us an email.

There should be plenty of opportunities to optimise further. For instance, while Entropic achieves the same coverage in less than half the time, Entropic has a much lower #execs per second. We ran the perf-tool and found a few performance bottlenecks.

Thanks for open-sourcing LibFuzzer (and the entire LLVM Compiler Infrastructure)! This has been such a tremendous help to my research.

Patch By: Marcel Boehme

Reviewers: kcc, metzman, morehouse, Dor1s, vitalybuka

Reviewed By: kcc

Subscribers: dgg5503, Valentin, llvm-commits, kcc

Tags: #llvm

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

4 years ago[X86] Split masked integer vector stores into vXi32/vXi64 variants (PR45975). NFC
Andrea Di Biagio [Tue, 19 May 2020 10:20:33 +0000 (11:20 +0100)]
[X86] Split masked integer vector stores into vXi32/vXi64 variants (PR45975). NFC

This effectively splits the scheduling WriteVecMaskedStore(Y) classes
into four different classes (one per each variant).

The new VecMaskedStore scheduling classes are now correctly marked as
'unsupported' by the bdver2 and btver2 models.

No functional change intended.

Reviewed By: RKSimon

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

4 years ago[LV] Remove duplicated return stmt (NFC).
Florian Hahn [Tue, 19 May 2020 14:35:59 +0000 (15:35 +0100)]
[LV] Remove duplicated return stmt (NFC).

4 years ago[InstCombine] Remove hasNoInfs check for pow(C,y) -> exp2(log2(C)*y)
Jay Foad [Tue, 5 May 2020 12:00:48 +0000 (13:00 +0100)]
[InstCombine] Remove hasNoInfs check for pow(C,y) -> exp2(log2(C)*y)

We already check hasNoNaNs and that x is finite and strictly positive.
That only leaves the following special cases (taken from the Linux man
page for pow):

If x is +1, the result is 1.0 (even if y is a NaN).
If the absolute value of x is less than 1, and y is negative infinity, the result is positive infinity.
If the absolute value of x is greater than 1, and y is negative infinity, the result is +0.
If the absolute value of x is less than 1, and y is positive infinity, the result is +0.
If the absolute value of x is greater than 1, and y is positive infinity, the result is positive infinity.

The first case is handled elsewhere, and this transformation preserves
all the others, so there is no need to limit it to hasNoInfs.

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

4 years ago[ELF] Make --trace-symbol track preempted shared definitions
Fangrui Song [Mon, 18 May 2020 17:15:59 +0000 (10:15 -0700)]
[ELF] Make --trace-symbol track preempted shared definitions

Note, we still name a preempted SharedSymbol "shared definition",
instead of "reference" as printed by GNU ld. This difference should not matter.

```
// GNU ld
ld.bfd: t: definition of f@v1
ld.bfd: t.so: reference to f@v1
```

Reviewed By: psmith

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

4 years ago[clang-format] @lefticus just taught the world how to use [[unlikely]] but we forgot...
mydeveloperday [Tue, 19 May 2020 15:50:24 +0000 (16:50 +0100)]
[clang-format] @lefticus just taught the world how to use [[unlikely]] but we forgot to teach clang-format

Summary:
https://twitter.com/lefticus/status/1262392152950288384?s=20

Jason Turner's (@lefticus) most recent C++ weekly explains the usage of [[likely]] and [[unlikely]] in an 'if/else' context in C++ 20

clang-format leaves the code a little messy afterwards..

```
if (argc > 5)
  [[unlikely]] {
    // ...
  }
else if (argc < 0)
  [[likely]] {
    // ...
  }
else
  [[likely]] {
    // ...
  }
```

try to improve the situation

```
if (argc > 5) [[unlikely]] {
  // ...
} else if (argc < 0) [[likely]] {
  // ...
} else [[likely]] {
  // ...
}
```

Reviewed By: JakeMerdichAMD

Subscribers: cfe-commits, lefticus

Tags: #clang, #clang-format

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

4 years ago[clang-format] [PR45614] Incorrectly indents [[nodiscard]] attribute funtions after...
mydeveloperday [Tue, 19 May 2020 15:47:38 +0000 (16:47 +0100)]
[clang-format] [PR45614] Incorrectly indents [[nodiscard]] attribute funtions after a macro without semicolon

Summary:
https://bugs.llvm.org/show_bug.cgi?id=45614

`[[nodiscard]]` after a macro doesn't behave the same as an __attribute__ resulting in incorrect indentation

This revision corrects that behavior

See original Mozilla bug:
https://bugzilla.mozilla.org/show_bug.cgi?id=1629756

Before:

```
class FooWidget : public nsBaseWidget {
public:
  FooWidget();

  NS_DECL_ISUPPORTS_INHERITED

      [[nodiscard]] nsresult
      FunctionOne();
  [[nodiscard]] nsresult FunctionTwo();
};
```

After:
```
class FooWidget : public nsBaseWidget {
public:
  FooWidget();

  NS_DECL_ISUPPORTS_INHERITED

  [[nodiscard]] nsresult FunctionOne();
  [[nodiscard]] nsresult FunctionTwo();
};
```

Reviewed By: Abpostelnicu

Subscribers: cfe-commits

Tags: #clang, #clang-format

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

4 years ago[clang-format] [PR44476] Add space between template and attribute
mydeveloperday [Tue, 19 May 2020 15:43:50 +0000 (16:43 +0100)]
[clang-format] [PR44476] Add space between template and attribute

Summary:
https://bugs.llvm.org/show_bug.cgi?id=44476

```template <typename T> [[nodiscard]] int a() { return 1; }```

gets incorrectly formatted to be

```template <typename T>[[nodiscard]] int a() { return 1; }```

This revision ensure there is a space between the template and the attribute

Reviewed By: JakeMerdichAMD

Subscribers: cfe-commits

Tags: #clang, #clang-format

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

4 years ago[clang-format] [PR45942] [[nodiscard]] causes && to be miss interpreted as BinaryOper...
mydeveloperday [Tue, 19 May 2020 15:41:50 +0000 (16:41 +0100)]
[clang-format] [PR45942] [[nodiscard]] causes && to be miss interpreted as BinaryOperators

Summary:
https://bugs.llvm.org/show_bug.cgi?id=45942

With Chromium style (although that is not important) its just it defines PointerAligmment: Left

The following arguments `S&&` are formatted differently depending on if the class has an attribute between it and the class identifier

```
class S {
  S(S&&) = default;
};

class [[nodiscard]] S {
  S(S &&) = default;
};
```

The prescense of [[nodiscard]] between the `class/struct` and the `{` causes the `{` to be incorrectly seen as a `TT_FunctionLBrace` which in turn transforms all the && to be `TT_BinaryOperators` rather than `TT_PointerOrReference`, as binary operators other spacing rules come into play causing a miss format

This revision resolves this by allowing the parseRecord to consider the [[nodisscard]]

Reviewed By: Abpostelnicu

Subscribers: cfe-commits

Tags: #clang, #clang-format

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

4 years agoRevert "[lld-macho] Support .subsections_via_symbols"
Jez Ng [Tue, 19 May 2020 15:29:17 +0000 (08:29 -0700)]
Revert "[lld-macho] Support .subsections_via_symbols"

Due to build breakage mentioned in https://reviews.llvm.org/D79926.

This reverts commit e270b2f1727c0fbde2676e8d0340c0d934726d3c.

4 years agoRevert "[lld-macho] Support X86_64_RELOC_UNSIGNED"
Jez Ng [Tue, 19 May 2020 15:29:11 +0000 (08:29 -0700)]
Revert "[lld-macho] Support X86_64_RELOC_UNSIGNED"

This reverts commit 1f820e35596bac036a7f759c4de41fcc2e642719.

4 years ago[clangd-remote] Replace YAML serialization with proper Protobuf messages
Kirill Bobyrev [Tue, 19 May 2020 14:59:04 +0000 (16:59 +0200)]
[clangd-remote] Replace YAML serialization with proper Protobuf messages

Summary:
YAML serialization was used in the Proof of Concept for simplicity.
This patch replaces implements Protobuf (de) serialization of almost all
types that need to be transferred over the protocol.

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: mgorny, ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits

Tags: #clang

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

4 years ago[MLIR] Update the FunctionAndBlockSignatureConverter and NonVoidToVoidReturnOpConvert...
Ehsan Toosi [Mon, 4 May 2020 14:06:59 +0000 (16:06 +0200)]
[MLIR] Update the FunctionAndBlockSignatureConverter and NonVoidToVoidReturnOpConverter of Buffer Assignment

Making these two converters more generic. FunctionAndBlockSignatureConverter now
moves only memref results (after type conversion) to the function argument and
keeps other legal function results unchanged. NonVoidToVoidReturnOpConverter is
renamed to NoBufferOperandsReturnOpConverter. It removes only the buffer
operands from the operands of the converted ReturnOp and inserts CopyOps to copy
each buffer to the target function argument.

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

4 years ago[analyzer][Nullability] Don't emit under the checker name NullabilityBase
Kirstóf Umann [Tue, 14 Apr 2020 15:13:41 +0000 (17:13 +0200)]
[analyzer][Nullability] Don't emit under the checker name NullabilityBase

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

4 years ago[clang][AIX] Implement ABIInfo and TargetCodeGenInfo for AIX
jasonliu [Tue, 19 May 2020 14:56:56 +0000 (14:56 +0000)]
[clang][AIX] Implement ABIInfo and TargetCodeGenInfo for AIX

Summary:
Created AIXABIInfo and AIXTargetCodeGenInfo for AIX ABI.

Reviewed By: Xiangling_L, ZarkoCA

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

4 years ago[analyzer] Don't print the config count in debug.ConfigDumper
Kirstóf Umann [Tue, 19 May 2020 14:46:16 +0000 (16:46 +0200)]
[analyzer] Don't print the config count in debug.ConfigDumper

I think anyone who added a checker config wondered why is there a need
to test this. Its just a chore when adding a new config, so I removed
it.

To give some historic insight though, we used to not list **all**
options, but only those explicitly added to AnalyzerOptions, such as the
ones specified on the command line. However, past this change (and
arguably even before that) this line makes little sense.

There is an argument to be made against the entirety of
analyzer-config.c test file, but since this commit fixes some builtbots
and is landing without review, I wouldn't like to be too invasive.

4 years ago[clangd] Avoid StringRef entirely with gmock
Sam McCall [Tue, 19 May 2020 14:50:30 +0000 (16:50 +0200)]
[clangd] Avoid StringRef entirely with gmock

4 years ago[clangd] findExplicitReferences supports goto labels
Sam McCall [Mon, 18 May 2020 22:45:27 +0000 (00:45 +0200)]
[clangd] findExplicitReferences supports goto labels

Summary:
This means they're renamable and textDocument/highlight works

This fell out of D78454

Reviewers: adamcz

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits

Tags: #clang

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

4 years ago[lld-macho] Support X86_64_RELOC_UNSIGNED
Jez Ng [Fri, 15 May 2020 19:02:40 +0000 (12:02 -0700)]
[lld-macho] Support X86_64_RELOC_UNSIGNED

Note that it's only used for non-pc-relative contexts.

Reviewed By: MaskRay, smeenai

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

4 years ago[lld-macho] Support .subsections_via_symbols
Jez Ng [Mon, 11 May 2020 22:48:47 +0000 (15:48 -0700)]
[lld-macho] Support .subsections_via_symbols

This diff restores and builds upon @pcc and @ruiu's initial work on
subsections.

The .subsections_via_symbols directive indicates we can split each
section along symbol boundaries, unless those symbols have been marked
with `.alt_entry`.

We exercise this functionality in our tests by using order files that
rearrange those symbols.

Reviewed By: smeenai

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

4 years ago[lld-macho] Support -order_file
Jez Ng [Tue, 5 May 2020 23:37:34 +0000 (16:37 -0700)]
[lld-macho] Support -order_file

The order file indicates how input sections should be sorted within each
output section, based on the symbols contained within those sections.

This diff sets the stage for implementing and testing
`.subsections_via_symbols`, where we will break up InputSections by each
symbol and sort them more granularly.

Reviewed By: smeenai

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

4 years ago[VPlan] Fix comment for User in VPWidenSelectRecipe (NFC).
Florian Hahn [Tue, 19 May 2020 14:29:40 +0000 (15:29 +0100)]
[VPlan] Fix comment for User in VPWidenSelectRecipe (NFC).

The comment was referring the arguments of the call, but the recipe
widens a select.

4 years ago[mlir] scf::ForOp: provide builders with callbacks for loop body
Alex Zinenko [Tue, 19 May 2020 14:22:00 +0000 (16:22 +0200)]
[mlir] scf::ForOp: provide builders with callbacks for loop body

Thanks to a recent change that made `::build` functions take an instance of
`OpBuilder`, it is now possible to build operations within a region attached to
the operation about to be created. Exercise this on `scf::ForOp` by taking a
callback that populates the loop body while the loop is being created.

Additionally, provide helper functions to build perfect nests of `ForOp`s,
with support for iteration arguments. These functions provide the same
functionality as EDSC LoopNestBuilder with simpler implementation, without
relying on edsc::ScopedContext, and using `OpBuilder` in an unambiguous way.
Compatibility functions for EDSC are provided, but may be removed in the
future.

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

4 years ago[lld] Remove unused lld/test/Driver/Inputs/**/libtest.a
Greg McGary [Tue, 19 May 2020 14:17:44 +0000 (07:17 -0700)]
[lld] Remove unused lld/test/Driver/Inputs/**/libtest.a

Under `lld/test/Driver/Inputs/`, all instances of `libtest.a` are
unreferenced. FYI, all of these are empty archives, and the files
contain only a magic number.

Reviewed By: MaskRay

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

4 years agoMCTargetOptionsCommandFlags.h - remove unnecessary includes. NFC.
Simon Pilgrim [Tue, 19 May 2020 14:04:05 +0000 (15:04 +0100)]
MCTargetOptionsCommandFlags.h - remove unnecessary includes. NFC.

Replace with MCTargetOptions forward declaration and move includes down to MCTargetOptionsCommandFlags.cpp

4 years agoCommandLine.h - remove unnecessary raw_ostream forward declaration. NFC.
Simon Pilgrim [Tue, 19 May 2020 13:22:11 +0000 (14:22 +0100)]
CommandLine.h - remove unnecessary raw_ostream forward declaration. NFC.

We already have to include raw_ostream.h.

4 years agoMachineBasicBlock.h - remove unnecessary includes. NFC.
Simon Pilgrim [Tue, 19 May 2020 13:00:37 +0000 (14:00 +0100)]
MachineBasicBlock.h - remove unnecessary includes. NFC.

Don't explicitly include ilist_node.h + simple_ilist.h - we already include ilist.h that include these for us and all references are in terms of that.

The rest can be covered by forward declarations.

4 years ago[analyzer] SATestBuild.py: Optionally override compiler
Valeriy Savchenko [Tue, 19 May 2020 14:05:51 +0000 (17:05 +0300)]
[analyzer] SATestBuild.py: Optionally override compiler

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

4 years ago[VPlan] Add & use VPValue operands for VPReplicateRecipe (NFC).
Florian Hahn [Tue, 19 May 2020 14:04:48 +0000 (15:04 +0100)]
[VPlan] Add & use VPValue operands for VPReplicateRecipe (NFC).

This patch adds VPValue version of the instruction operands to
VPReplicateRecipe and uses them during code-generation.

Reviewers: Ayal, gilr, rengolin

Reviewed By: gilr

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

4 years ago[clangd] Delete regex assertion, breaking on windows too...
Sam McCall [Tue, 19 May 2020 14:06:08 +0000 (16:06 +0200)]
[clangd] Delete regex assertion, breaking on windows too...

4 years ago[VPlan] Remove unique_ptr from VPBranchOnRecipeMask (NFC).
Florian Hahn [Tue, 19 May 2020 13:03:18 +0000 (14:03 +0100)]
[VPlan] Remove unique_ptr from VPBranchOnRecipeMask (NFC).

We can remove a dynamic memory allocation, by checking the number of
operands: no operands = all true, 1 operand = mask.

Reviewers: Ayal, gilr, rengolin

Reviewed By: Ayal

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

4 years agoGlobalISel: Fix IRTranslator for constantexpr selects
Matt Arsenault [Tue, 19 May 2020 12:59:16 +0000 (08:59 -0400)]
GlobalISel: Fix IRTranslator for constantexpr selects

This was assuming a select is always an instruction, which is not
true.

4 years ago[analyzer][DirectIvarAssignment] Turn DirectIvarAssignmentForAnnotatedFunctions into...
Kirstóf Umann [Tue, 14 Apr 2020 15:13:41 +0000 (17:13 +0200)]
[analyzer][DirectIvarAssignment] Turn DirectIvarAssignmentForAnnotatedFunctions into a checker option

Since this is an alpha checker, I don't worry about backward compatibility :)

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

4 years ago[AST] Fix an assertion violation in FieldDecl::getParent.
Haojian Wu [Tue, 19 May 2020 13:26:42 +0000 (15:26 +0200)]
[AST] Fix an assertion violation in FieldDecl::getParent.

Summary:
FieldDecl::getParent assumes that the FiledDecl::getDeclContext returns a
RecordDecl, this is true for C/C++, but not for ObjCIvarDecl:

The Decls hierarchy is like following

FieldDecl <-- ObjCIvarDecl

DeclContext <-- ObjCContainerDecl <-- ObjCInterfaceDecl
         ^
         |----- TagDecl <-- RecordDecl

calling getParent() on ObjCIvarDecl will:
1. invoke getDeclContext(), which returns a DeclContext*, which points to an ObjCInterfaceDecl;
2. then downcast the "DeclContext" pointer to a RecordDecl*, and we will hit
the "is_a<RecordDecl>" assertion in llvm::cast (undefined behavior
in release build without assertion enabled);

Fixes https://github.com/clangd/clangd/issues/369

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: rsmith, jkorous, arphaman, kadircet, usaxena95, cfe-commits

Tags: #clang

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

4 years ago[clangd] Add a flag to preserve type for recovery expression.
Haojian Wu [Tue, 19 May 2020 13:21:50 +0000 (15:21 +0200)]
[clangd] Add a flag to preserve type for recovery expression.

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits

Tags: #clang

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

4 years ago[AST] Fix the PrintQualifiedName for ObjC instance variable in class extension.
Haojian Wu [Tue, 19 May 2020 13:10:10 +0000 (15:10 +0200)]
[AST] Fix the PrintQualifiedName for ObjC instance variable in class extension.

Summary:
Similar to property, we print the containing interface decl as the
nested name specifier for ivar; otherwise we will get "::ivar_name".

this would fix an assertion crash in clangd: https://github.com/clangd/clangd/issues/365

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: ilya-biryukov, kadircet, usaxena95, cfe-commits

Tags: #clang

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

4 years agoAdded a TanOp to SPIR-V dialect GLSL ops
George [Tue, 19 May 2020 13:07:49 +0000 (09:07 -0400)]
Added a TanOp to SPIR-V dialect GLSL ops

Implemented tangent op from SPIR-V's GLSL extended instruction set.
Added a round-trip and serialization/deserialization tests for the op.

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

4 years ago[AST][RecoveryExpr] Fix an assertion crash on openMP.
Haojian Wu [Tue, 19 May 2020 10:02:52 +0000 (12:02 +0200)]
[AST][RecoveryExpr] Fix an assertion crash on openMP.

Summary:
With recovery expr, it is possible that we have a value-dependent expr
within non-dependent context.

Reviewers: sammccall, jdoerfert

Subscribers: yaxunl, guansong, cfe-commits

Tags: #clang

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

4 years ago[NFC][ARM] Add more tail predication tests
Sam Parker [Tue, 19 May 2020 12:56:51 +0000 (13:56 +0100)]
[NFC][ARM] Add more tail predication tests

4 years ago[OPENMP50]Add initial support for 'affinity' clause.
Alexey Bataev [Mon, 18 May 2020 17:37:53 +0000 (13:37 -0400)]
[OPENMP50]Add initial support for 'affinity' clause.

Summary:
Added parsing/sema/serialization support for affinity clause in task
directives.

Reviewers: jdoerfert

Subscribers: yaxunl, guansong, arphaman, llvm-commits, cfe-commits, caomhin

Tags: #clang, #llvm

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

4 years ago[IR] Revert r119493
Jay Foad [Tue, 19 May 2020 11:30:26 +0000 (12:30 +0100)]
[IR] Revert r119493

r119493 protected against PHINode::hasConstantValue returning the PHI
node itself, but a later fix in r159687 means that can never happen, so
the workarounds are no longer required.

4 years agoFix "not all control paths return a value" warning on MSVC builds.
Simon Pilgrim [Tue, 19 May 2020 12:16:24 +0000 (13:16 +0100)]
Fix "not all control paths return a value" warning on MSVC builds.

Use llvm_unreachable as typeName(Metric::MetricType T) should handle all enum values.

4 years agoObjectCache.h - replace unnecessary MemoryBuffer.h include with forward declarations...
Simon Pilgrim [Tue, 19 May 2020 11:33:28 +0000 (12:33 +0100)]
ObjectCache.h - replace unnecessary MemoryBuffer.h include with forward declarations. NFC.

4 years agoGlobalVariable.h - remove unused PointerUnion.h include. NFC
Simon Pilgrim [Tue, 19 May 2020 11:08:29 +0000 (12:08 +0100)]
GlobalVariable.h - remove unused PointerUnion.h include. NFC

4 years ago[analyzer][MallocChecker] When modeling realloc-like functions, don't early return...
Kirstóf Umann [Tue, 5 May 2020 12:55:37 +0000 (14:55 +0200)]
[analyzer][MallocChecker] When modeling realloc-like functions, don't early return if the argument is symbolic

The very essence of MallocChecker lies in 2 overload sets: the FreeMemAux
functions and the MallocMemAux functions. The former houses most of the error
checking as well (aside from leaks), such as incorrect deallocation. There, we
check whether the argument's MemSpaceRegion is the heap or unknown, and if it
isn't, we know we encountered a bug (aside from a corner case patched by
@balazske in D76830), as specified by MEM34-C.

In ReallocMemAux, which really is the combination of  FreeMemAux and
MallocMemAux, we incorrectly early returned if the memory argument of realloc is
non-symbolic. The problem is, one of the cases where this happens when we know
precisely what the region is, like an array, as demonstrated in the test file.
So, lets get rid of this false negative :^)

Side note, I dislike the warning message and the associated checker name, but
I'll address it in a later patch.

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

4 years agoUnrank mcuMemHostRegister tensor argument.
Christian Sigg [Mon, 18 May 2020 12:13:14 +0000 (14:13 +0200)]
Unrank mcuMemHostRegister tensor argument.

Reviewers: herhut

Reviewed By: herhut

Subscribers: mehdi_amini, rriddle, jpienaar, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, stephenneuendorffer, Joonsoo, grosul1, frgossen, Kayjukh, jurahul, llvm-commits

Tags: #llvm

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

4 years ago[clangd] Squash GCC error with StringRef + gtest MatchesRegex()
Sam McCall [Tue, 19 May 2020 11:58:12 +0000 (13:58 +0200)]
[clangd] Squash GCC error with StringRef + gtest MatchesRegex()

4 years ago[MLIR] Add helper functions for common integer types
Frederik Gossen [Mon, 18 May 2020 08:56:22 +0000 (08:56 +0000)]
[MLIR] Add helper functions for common integer types

Add helper functions for 32-bit and 64-bit integer types.

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

4 years ago[clangd] Add CSV export for trace metrics
Sam McCall [Sat, 9 May 2020 20:43:35 +0000 (22:43 +0200)]
[clangd] Add CSV export for trace metrics

Summary: Example: https://docs.google.com/spreadsheets/d/1VZKGetSUTTDe9p4ooIETmdcwUod1_aE3vgD0E9x7HhI/edit

Reviewers: kadircet

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, jfb, usaxena95, cfe-commits

Tags: #clang

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

4 years ago[clangd] Complete filenames after < / ".
Sam McCall [Tue, 5 May 2020 23:39:59 +0000 (01:39 +0200)]
[clangd] Complete filenames after < / ".

Summary:
Extract prefix filters to CodeComplete so it can be easily tested.

Fixes https://github.com/clangd/clangd/issues/366

Reviewers: adamcz

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits

Tags: #clang

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

4 years ago[MLIR, OpenMP] Support for flush operation, and translating the same to LLVM IR
Kiran Kumar T P [Tue, 19 May 2020 11:30:15 +0000 (17:00 +0530)]
[MLIR, OpenMP] Support for flush operation, and translating the same to LLVM IR

Summary:
This patch adds support for flush operation in OpenMP dialect and translation of this construct to LLVM IR.
The OpenMP IRBuilder is used for this translation.
The patch includes code changes and testcase modifications.

Reviewed By: ftynse, kiranchandramohan

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

4 years ago[AMDGPU] Add more VMEM to SALU WAR hazard tests. NFC
Carl Ritson [Tue, 19 May 2020 10:27:16 +0000 (19:27 +0900)]
[AMDGPU] Add more VMEM to SALU WAR hazard tests. NFC