platform/upstream/llvm.git
4 years agoRevert "[mlir] Add padding to 1-D Vector in CRunnerUtils.h"
Eric Christopher [Tue, 3 Mar 2020 04:12:12 +0000 (20:12 -0800)]
Revert "[mlir] Add padding to 1-D Vector in CRunnerUtils.h"

Due to Werror breakage.

This reverts commits a68235d583fccb465694fdfd72eeb8d45d3369c0 and
bcee8982a2931960ca29a9e95e3d10355e7393ab.

4 years ago[mlir] Hotfix - Fix Windows build
Nicolas Vasilache [Tue, 3 Mar 2020 03:47:16 +0000 (22:47 -0500)]
[mlir] Hotfix - Fix Windows build

This revision adds a static `mlir_c_runner_utils_static` library
for the sole purpose of being linked into `mlir_runner_utils` on
Windows.

It was previously reported that:
```

`add_llvm_library(mlir_c_runner_utils SHARED CRunnerUtils.cpp)`

produces *only* a dll on windows, the linking of mlir_runner_utils fails
because target_link_libraries is looking for a .lib file as opposed to a
.dll file. I think this may be a case where either we need to use
LINK_LIBS or explicitly build a static lib as well, but I haven't tried
either yet.
```

4 years ago[mlir] Add padding to 1-D Vector in CRunnerUtils.h
Nicolas Vasilache [Mon, 2 Mar 2020 14:59:01 +0000 (09:59 -0500)]
[mlir] Add padding to 1-D Vector in CRunnerUtils.h

Summary:
This revision fixes a -Wzero-length-array compile error that
caused e459596917a72f11bd8251a81bdb521401abdd3d which reverted
78f9e5d098af95610f4542ee41479d7931261066.

This revision adds padding for 1-D Vector in the common case of x86
execution with a stadard data layout. This supports properly interfacing
codegen with arrays of e.g. `vector<9xf32>`.

Such vectors are already assumed padded to the next power of 2 by LLVM
codegen with the default x86 data layout:
```
define void @test_vector_add_1d_2_3(<3 x float>* nocapture readnone %0,
<3 x float>* nocapture readonly %1, i64 %2, i64 %3, i64 %4, <3 x float>*
nocapture readnone %5, <3 x float>* nocapture readonly %6, i64 %7, i64
%8, i64 %9, <3 x float>* nocapture readnone %10, <3 x float>* nocapture
%11, i64 %12, i64 %13, i64 %14) local_unnamed_addr {
  %16 = getelementptr <3 x float>, <3 x float>* %6, i64 1
  %17 = load <3 x float>, <3 x float>* %16, align 16
  %18 = getelementptr <3 x float>, <3 x float>* %1, i64 1
  %19 = load <3 x float>, <3 x float>* %18, align 16
  %20 = fadd <3 x float> %17, %19
  %21 = getelementptr <3 x float>, <3 x float>* %11, i64 1
```

The pointer addressing a `vector<3xf32>` is assumed aligned `@16`.
Similarly, the pointer addressing a `vector<65xf32>` is assumed aligned
`@512`.

This revision allows using objects such as `vector<3xf32>` properly with
the standard x86 data layout used in the JitRunner. Integration testing
is done out of tree, at the moment such testing fails without this
change.

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

4 years agoDebugInfo: Separate different debug_macinfo contributions & print the offset of a...
David Blaikie [Tue, 3 Mar 2020 03:30:03 +0000 (19:30 -0800)]
DebugInfo: Separate different debug_macinfo contributions & print the offset of a contribution

4 years ago[LICM] Allow freeze to hoist/sink out of a loop
Juneyoung Lee [Sat, 29 Feb 2020 13:00:44 +0000 (22:00 +0900)]
[LICM] Allow freeze to hoist/sink out of a loop

Summary: This patch allows LICM to hoist/sink freeze instructions out of a loop.

Reviewers: reames, fhahn, efriedma

Reviewed By: reames

Subscribers: jfb, lebedev.ri, hiraditya, asbirlea, llvm-commits

Tags: #llvm

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

4 years agoTemporarily Revert [X86] Not track size of the boudaryalign fragment during the layout
Shengchen Kan [Tue, 3 Mar 2020 03:10:54 +0000 (11:10 +0800)]
Temporarily Revert [X86] Not track size of the boudaryalign fragment during the layout

Summary: This reverts commit 2ac19feb1571960b8e1479a451b45ab56da7034e.
This commit causes some test cases to run fail when branch is aligned.

4 years agofix typo
Nico Weber [Tue, 3 Mar 2020 02:01:50 +0000 (21:01 -0500)]
fix typo

4 years ago[lldb/GDBRemote] Fix obvious typo in error message.
Fred Riss [Tue, 3 Mar 2020 01:52:30 +0000 (17:52 -0800)]
[lldb/GDBRemote] Fix obvious typo in error message.

It's unlikely that `errno` is the value the user wants to see in this
error message.

4 years ago[LTO] onfig::addSaveTemps: clear ResolutionFile upon an error
Fangrui Song [Sun, 1 Mar 2020 20:06:51 +0000 (12:06 -0800)]
[LTO] onfig::addSaveTemps: clear ResolutionFile upon an error

Otherwise ld.lld -save-temps will crash when writing to ResolutionFile.

llvm-lto2 -save-temps does not crash because it exits immediately.

Reviewed By: evgeny777

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

4 years ago[lldb/API] NFC: Reformat and simplify SBThread::GetStopDescription()
Fred Riss [Thu, 6 Feb 2020 05:47:33 +0000 (21:47 -0800)]
[lldb/API] NFC: Reformat and simplify SBThread::GetStopDescription()

Summary:
This gets rid of some nesting and of the raw char* variable that caused
the memory management bug we hit recently.

This commit also removes the fallback code which should trigger when
the StopInfo provides no stop description. All currently implemented
StopInfos have a `GetDescription()` method that shouldn't return an
empty description.

Reviewers: JDevlieghere, labath, mib

Subscribers: lldb-commits

Tags: #lldb

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

4 years ago[AVR] Add missing ROLLOOP and RORLOOP into getTargetNodeName
Jim Lin [Mon, 2 Mar 2020 10:46:22 +0000 (18:46 +0800)]
[AVR] Add missing ROLLOOP and RORLOOP into getTargetNodeName

4 years ago[llvm][MachO] fix adding weak def syms
Cyndy Ishida [Tue, 3 Mar 2020 00:58:14 +0000 (16:58 -0800)]
[llvm][MachO] fix adding weak def syms

the weak defined symbol flag was missing from the call site for adding
symbols which didn't cause issues because it invoked the default
parameter.

4 years ago[LiveDebugValues] Prevent some misuse of LocIndex::fromRawInteger, NFC
Vedant Kumar [Tue, 3 Mar 2020 00:56:17 +0000 (16:56 -0800)]
[LiveDebugValues] Prevent some misuse of LocIndex::fromRawInteger, NFC

Make it a compile-time error to pass an int/unsigned/etc to
fromRawInteger.

Hopefully this prevents errors of the form:

```
for (unsigned ID : getVarLocs()) {
  auto VL = LocMap[LocIndex::fromRawInteger(ID)];
  ...
```

4 years ago[Sema] Fix a crash when attaching comments to an implicit decl
Erik Pilkington [Tue, 3 Mar 2020 00:30:16 +0000 (16:30 -0800)]
[Sema] Fix a crash when attaching comments to an implicit decl

When an implicitly generated decl was the first entry in the group, we
attempted to lookup comments with an empty FileID, leading to crashes. Avoid
this by trying to use the other declarations in the group, and then bailing out
if none are valid.

rdar://59919733
Differential revision: https://reviews.llvm.org/D75483

4 years ago[ARM][ConstantIslands] Fix stack mis-alignment caused by undoLRSpillRestore.
Huihui Zhang [Tue, 3 Mar 2020 00:11:50 +0000 (16:11 -0800)]
[ARM][ConstantIslands] Fix stack mis-alignment caused by undoLRSpillRestore.

Summary:
It is not safe for ARMConstantIslands to undoLRSpillRestore. PrologEpilogInserter is
the one to ensure stack alignment, taking into consideration LR is spilled or not.

For noreturn function with StackAlignment 8 (function contains call/alloc),
undoLRSpillRestore cause stack be mis-aligned. Fixing stack alignment in
ARMConstantIslands doesn't give us much benefit, as undo LR spill/restore only
occur in large function with near branches only, also doesn't have callee-saved LR spill.

Reviewers: t.p.northover, rengolin, efriedma, apazos, samparker, ostannard

Reviewed By: ostannard

Subscribers: dmgreen, ostannard, kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[libcxx] Drop -D option from libtool when merging archives
Petr Hosek [Tue, 3 Mar 2020 00:07:18 +0000 (16:07 -0800)]
[libcxx] Drop -D option from libtool when merging archives

This is a follow up to D74108. This option is not supported by older
versions of libtool so remove it. We keep the -s option to build the
index.

4 years ago[lldb/Utility] Use emplace_back instead of push_back (NFC)
Jonas Devlieghere [Mon, 2 Mar 2020 23:53:59 +0000 (15:53 -0800)]
[lldb/Utility] Use emplace_back instead of push_back (NFC)

Use emplace_back to allow for in-place construction of the
BroadcastEventSpec instead of copying it.

4 years agoFix GSYM tests to run the yaml files and fix test failures on some machines.
Greg Clayton [Mon, 2 Mar 2020 23:37:27 +0000 (15:37 -0800)]
Fix GSYM tests to run the yaml files and fix test failures on some machines.

YAML files were not being run during lit testing as there was no lit.local.cfg file. Once this was fixed, some buildbots would fail due to a StringRef that pointed to a std::string inside of a temporary llvm::Triple object. These issues are fixed here by making a local triple object that stays around long enough so the StringRef points to valid data. Also fixed an issue where strings for files in the file table could be added in opposite order due to parameters to function calls not having a strong ordering, which caused tests to fail. Added new arch specfic directories so when targets are not enabled, we continue to function just fine.

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

4 years ago[lldb] Don't iterate over a std::set<Type*> in SymbolFileDWARF::GetTypes to make...
Raphael Isemann [Mon, 2 Mar 2020 22:45:53 +0000 (14:45 -0800)]
[lldb] Don't iterate over a std::set<Type*> in SymbolFileDWARF::GetTypes to make it deterministic

Summary:
Currently `SymbolFileDWARF::TypeSet` is a typedef to a `std::set<Type *>`.
In `SymbolFileDWARF::GetTypes` we iterate over a TypeSet variable when finding
types so that logic is non-deterministic as it depends on the actual pointer address values.

This patch changes the `TypeSet` to a `llvm::UniqueVector` which always iterates in
the order in which we inserted the types into the list.

Reviewers: JDevlieghere, aprantl

Reviewed By: JDevlieghere

Subscribers: mgrang, abidh, lldb-commits

Tags: #lldb

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

4 years agoUse range-for in MCAssembler [NFC]
Philip Reames [Mon, 2 Mar 2020 22:57:11 +0000 (14:57 -0800)]
Use range-for in MCAssembler [NFC]

4 years ago[docs] Use 0 as version placeholder instead of a made up number.
Davide Italiano [Mon, 2 Mar 2020 22:55:05 +0000 (14:55 -0800)]
[docs] Use 0 as version placeholder instead of a made up number.

While here, explain that this is not really used. Probably NFC.

4 years agoTemporarily Revert "[mlir] Add padding to 1-D Vector in CRunnerUtils.h"
Eric Christopher [Mon, 2 Mar 2020 22:44:38 +0000 (14:44 -0800)]
Temporarily Revert "[mlir] Add padding to 1-D Vector in CRunnerUtils.h"
as it broke the Werror build:

.../sources/llvm-project/mlir/include/mlir/ExecutionEngine/CRunnerUtils.h:85:16: error: zero size arrays are an extension [-Werror,-Wzero-length-array]
  char padding[detail::nextPowerOf2<sizeof(T[Dim])>() - sizeof(T[Dim])];
               ^~~~~~~~~~~~~~~

This reverts commit 78f9e5d098af95610f4542ee41479d7931261066.

4 years ago[BranchAlign] Fix bug w/nop padding for SS manipulation
Philip Reames [Mon, 2 Mar 2020 21:21:53 +0000 (13:21 -0800)]
[BranchAlign] Fix bug w/nop padding for SS manipulation

X86 has several instructions which are documented as enabling interrupts exactly one instruction *after* the one which changes the SS segment register. Inserting a nop between these two instructions allows an interrupt to arrive before the execution of the following instruction which changes semantic behaviour.

The list of instructions is documented in "Table 24-3. Format of Interruptibility State" in Volume 3c of the Intel manual. They basically all come down to different ways to write to the SS register.

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

4 years agoUpdate LSR's logic that identifies a post-increment SCEV value.
Sumanth Gundapaneni [Mon, 2 Mar 2020 22:32:19 +0000 (16:32 -0600)]
Update LSR's logic that identifies a post-increment SCEV value.

One of the checks has been removed as it seem invalid.
The LoopStep size is always almost a 32-bit.

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

4 years agoAdd default case to fix -Wswitch errors
Jordan Rupprecht [Mon, 2 Mar 2020 22:23:17 +0000 (14:23 -0800)]
Add default case to fix -Wswitch errors

4 years ago[lldb/Docs] Remove the version from the home page
Jonas Devlieghere [Mon, 2 Mar 2020 22:01:55 +0000 (14:01 -0800)]
[lldb/Docs] Remove the version from the home page

4 years ago[TargetLowering] Fix what look like copy/paste mistakes in compare with infinity...
Craig Topper [Mon, 2 Mar 2020 22:12:16 +0000 (14:12 -0800)]
[TargetLowering] Fix what look like copy/paste mistakes in compare with infinity handling SimplifySetCC.

I expect that the isCondCodeLegal checks should match that CC of
the node that we're going to create.

Rewriting to a switch to minimize repeated mentions of the same
constants.

4 years agoRevert "Restore "[WPD/LowerTypeTests] Delay lowering/removal of type tests until...
Teresa Johnson [Mon, 2 Mar 2020 21:09:56 +0000 (13:09 -0800)]
Revert "Restore "[WPD/LowerTypeTests] Delay lowering/removal of type tests until after ICP""

This reverts commit 80d0a137a5aba6998fadb764f1e11cb901aae233, and the
follow on fix in 873c0d0786dcf22f4af39f65df824917f70f2170. It is
causing test failures after a multi-stage clang bootstrap. See
discussion on D73242 and D75201.

4 years agoExplicitly include <cassert> when using assert
Joerg Sonnenberger [Mon, 2 Mar 2020 17:24:11 +0000 (18:24 +0100)]
Explicitly include <cassert> when using assert

Depending on the OS used, a module-enabled build can fail due to the
special handling <cassert> gets as textual header.

4 years agoRevert "[clang] detect switch fallthrough marked by a comment (PR43465)"
Luboš Luňák [Mon, 2 Mar 2020 21:31:37 +0000 (22:31 +0100)]
Revert "[clang] detect switch fallthrough marked by a comment (PR43465)"

This reverts commit 398b4ed87d488b42032c8d0304324dce76ba9b66.
As requested in https://bugs.llvm.org/show_bug.cgi?id=43465#c37 .

4 years ago[mlir][ods] Add query for derived attribute
Jacques Pienaar [Mon, 2 Mar 2020 21:26:16 +0000 (13:26 -0800)]
[mlir][ods] Add query for derived attribute

For ODS generated operations enable querying whether there is a derived
attribute with a given name.

4 years agoRevert "Fix GSYM tests to run the yaml files and fix test failures on some machines."
Greg Clayton [Mon, 2 Mar 2020 21:07:58 +0000 (13:07 -0800)]
Revert "Fix GSYM tests to run the yaml files and fix test failures on some machines."

This reverts commit 57688350adea307e7bccb83b68a5b7333de31fd7.

Need to conditionalize for ARM targets, this is failing on machines that don't have ARM targets.

4 years agoFix GSYM tests to run the yaml files and fix test failures on some machines.
Greg Clayton [Mon, 2 Mar 2020 20:40:46 +0000 (12:40 -0800)]
Fix GSYM tests to run the yaml files and fix test failures on some machines.

YAML files were not being run during lit testing as there was no lit.local.cfg file. Once this was fixed, some buildbots would fail due to a StringRef that pointed to a std::string inside of a temporary llvm::Triple object. These issues are fixed here by making a local triple object that stays around long enough so the StringRef points to valid data. Also fixed an issue where strings for files in the file table could be added in opposite order due to parameters to function calls not having a strong ordering, which caused tests to fail.

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

4 years ago[PSI] Add the isCold query support with a given percentile value.
Hiroshi Yamauchi [Thu, 27 Feb 2020 18:49:04 +0000 (10:49 -0800)]
[PSI] Add the isCold query support with a given percentile value.

Summary: This follows up D67377 that added the isHot side.

Reviewers: davidxl

Subscribers: eraman, hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[Clang] Fix Hurd toolchain test on a two-stage build with ThinLTO
Alexandre Ganea [Mon, 2 Mar 2020 20:41:47 +0000 (15:41 -0500)]
[Clang] Fix Hurd toolchain test on a two-stage build with ThinLTO

A two-stage ThinLTO build previously failed the clang/test/Driver/hurd.c test because of a static_cast in "tools::gnutools::Linker::ConstructJob()" which wrongly converted an instance of "clang::driver::toolchains::Hurd" into that of "clang::driver::toolchains::Linux". ThinLTO would later devirtualize the "ToolChain.getDynamicLinker(Args)" call and use "Linux::getDynamicLinker()" instead, causing the test to generate a wrong "-dynamic-linker" linker flag (/lib/ld-linux.so.2 instead of /lib/ld.so)

Fixes PR45061.

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

4 years ago[LIBOMPTARGET]Lower priority of global constructor/destructor to silence the warning...
Alexey Bataev [Mon, 2 Mar 2020 15:25:58 +0000 (10:25 -0500)]
[LIBOMPTARGET]Lower priority of  global constructor/destructor to silence the warning from gcc.

Summary: fixed the warning from gcc since prios 0-100 are reserved for the internal use.

Reviewers: grokos

Subscribers: kkwli0, caomhin, openmp-commits

Tags: #openmp

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

4 years agoExtend LaneBitmask to 64 bit
Stanislav Mekhanoshin [Fri, 28 Feb 2020 20:28:45 +0000 (12:28 -0800)]
Extend LaneBitmask to 64 bit

This is needed for D74873, AMDGPU going to have 16 bit subregs
and the largest tuple is 32 VGPRs, which results in 64 lanes.

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

4 years agoRevert "Add default paths to support musl target"
Sid Manning [Mon, 2 Mar 2020 20:08:57 +0000 (14:08 -0600)]
Revert "Add default paths to support musl target"

This reverts commit 637767665141ae48c7a0558903bb29e03bf5ad6f.
Need to fix the testcase.

4 years ago[test/compiler-rt] Disable ubsan/TestCases/Misc/nullability.c on Android
Vedant Kumar [Mon, 2 Mar 2020 19:45:02 +0000 (11:45 -0800)]
[test/compiler-rt] Disable ubsan/TestCases/Misc/nullability.c on Android

It looks like the suppression file isn't being copied over to the
device.

4 years ago[Coverage] Collect all function records in an object (D69471 followup)
Vedant Kumar [Mon, 2 Mar 2020 19:37:19 +0000 (11:37 -0800)]
[Coverage] Collect all function records in an object (D69471 followup)

After the format change from D69471, there can be more than one section
in an object that contains coverage function records. Look up each of
these sections and concatenate all the records together.

This re-enables the instrprof-merging.cpp test, which previously was
failing on OSes which use comdats.

Thanks to Jeremy Morse, who very kindly provided object files from the
bot I broke to help me debug.

4 years ago[OPENMP50]Support 'destroy' clause on 'depobj' directives.
Alexey Bataev [Mon, 2 Mar 2020 19:21:20 +0000 (14:21 -0500)]
[OPENMP50]Support 'destroy' clause on 'depobj' directives.

Added basic support (parsing/sema/serialization) for 'destroy' clause in
depobj directives.

4 years agoAdd default paths to support musl target
Sid Manning [Fri, 21 Feb 2020 19:36:41 +0000 (13:36 -0600)]
Add default paths to support musl target

Pickup the default crt and libs when the target is musl.

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

4 years ago[Sema] Look through OpaqueValueExpr when checking implicit conversions
Erik Pilkington [Mon, 2 Mar 2020 18:27:41 +0000 (10:27 -0800)]
[Sema] Look through OpaqueValueExpr when checking implicit conversions

Specifically, this fixes a false-positive in -Wobjc-signed-char-bool.
rdar://57372317

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

4 years ago[libcxx] When merging archives, build index even on Darwin
Petr Hosek [Thu, 6 Feb 2020 03:42:18 +0000 (19:42 -0800)]
[libcxx] When merging archives, build index even on Darwin

We always want to build the table of contents. Additionally, we also
set the flag to make the output deterministic which is already the
default for llvm-ar.

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

4 years ago[lldb] Remove checks behind LLDB_CONFIGURATION_DEBUG from TypeSystemClang
Raphael Isemann [Mon, 2 Mar 2020 18:24:59 +0000 (10:24 -0800)]
[lldb] Remove checks behind LLDB_CONFIGURATION_DEBUG from TypeSystemClang

Summary:
This function is (supposed) to be a list of asserts that just do a generic sanity check
on declarations we return. Right now this function is hidden behind the
LLDB_CONFIGURATION_DEBUG macro which means it will *only* be run in
debug builds (but not Release+assert builds and so on).

As we have not a single CI running in Debug build, failures in VerifyDecl are hidden
from us until someone by accident executes the tests in Debug mode on their own machine.

This patch removes the `ifdef`'s for LLDB_CONFIGURATION_DEBUG and puts
the `getAccess()` call in `VerifyDecl` behind a `#ifndef NDEBUG` to make sure
that this function is just an empty function with internal linkage when NDEBUG
is defined (so compilers should just optimize away the calls to it).

Reviewers: aprantl

Reviewed By: aprantl

Subscribers: shafik, abidh, JDevlieghere, lldb-commits

Tags: #lldb

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

4 years ago[AArch64][MachineOutliner] Don't outline CFI instructions
Jessica Paquette [Mon, 2 Mar 2020 18:49:18 +0000 (10:49 -0800)]
[AArch64][MachineOutliner] Don't outline CFI instructions

CFI instructions can only safely be outlined when the outlined call is a tail
call, or when the outlined frame is fixed up.

For the sake of correctness, disable outlining from CFI instructions.

Add machine-outliner-cfi.mir to test this.

4 years agoFix shadow variable warning. NFC.
Simon Pilgrim [Mon, 2 Mar 2020 18:22:58 +0000 (18:22 +0000)]
Fix shadow variable warning. NFC.

4 years agoFix 'unsigned variable can never be negative' cppcheck warning. NFCI.
Simon Pilgrim [Mon, 2 Mar 2020 18:10:15 +0000 (18:10 +0000)]
Fix 'unsigned variable can never be negative' cppcheck warning. NFCI.

4 years ago[OPENMP50]Add basic support for depobj construct.
Alexey Bataev [Fri, 28 Feb 2020 14:52:15 +0000 (09:52 -0500)]
[OPENMP50]Add basic support for depobj construct.

Added basic parsing/sema/serialization support for depobj directive.

4 years agoMore principled implementation of DISubprogram::describes()
Adrian Prantl [Mon, 2 Mar 2020 17:39:27 +0000 (09:39 -0800)]
More principled implementation of DISubprogram::describes()

Previously we would also accept DISubprograms that matched in name
only, but this doesn't appear to be necessary any more.

I did a Full and Thin LTO build of Clang and it completed without a warning.

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

4 years agoFix unused-variable warning
Brian Cain [Mon, 24 Feb 2020 17:58:50 +0000 (11:58 -0600)]
Fix unused-variable warning

4 years ago[clangd] Split locateSymbolAt into several component functions, to allow later reuse...
Sam McCall [Mon, 2 Mar 2020 17:45:05 +0000 (18:45 +0100)]
[clangd] Split locateSymbolAt into several component functions, to allow later reuse. NFC

4 years agoclang: Switch C compilations to C17 by default.
Nick Desaulniers [Mon, 2 Mar 2020 17:33:14 +0000 (09:33 -0800)]
clang: Switch C compilations to C17 by default.

Summary:
Matches GCC 8.1 (2018).

Updates documentation+release notes as well.

See also https://reviews.llvm.org/rL220244.

Reviewers: rsmith, aaron.ballman

Reviewed By: rsmith, aaron.ballman

Subscribers: aaron.ballman, dschuff, aheejin, simoncook, s.egerton, cfe-commits, hans, srhines

Tags: #clang

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

4 years ago[gn build] Port 49684f9db5c
LLVM GN Syncbot [Mon, 2 Mar 2020 17:35:47 +0000 (17:35 +0000)]
[gn build] Port 49684f9db5c

4 years agoRevert "Syndicate, test and fix base64 implementation"
Mitch Phillips [Mon, 2 Mar 2020 17:29:29 +0000 (09:29 -0800)]
Revert "Syndicate, test and fix base64 implementation"

This reverts commit 5a1958f2673f8c771e406a7e309e160b432c9a79.

This change broke the UBSan build bots. See
https://reviews.llvm.org/D75057 for more information.

4 years agoRevert "Fix Base64Test - for StringRef size"
Mitch Phillips [Mon, 2 Mar 2020 17:28:59 +0000 (09:28 -0800)]
Revert "Fix Base64Test - for StringRef size"

This reverts commit b52355f8a196b5040dc2e42870bf8c459306cfaa.

The change this patch depends on
(5a1958f2673f8c771e406a7e309e160b432c9a79) broke the UBSan buildbots.
See https://reviews.llvm.org/D75057 for more information.

4 years ago[ThinLTO/LowerTypeTests] Handle unpromoted local type ids
Teresa Johnson [Wed, 26 Feb 2020 18:54:56 +0000 (10:54 -0800)]
[ThinLTO/LowerTypeTests] Handle unpromoted local type ids

Summary:
Fixes an issue that cropped up after the changes in D73242 to delay
the lowering of type tests. LTT couldn't handle any type tests with
non-string type id (which happens for local vtables, which we try to
promote during the compile step but cannot always when there are no
exported symbols).

We can simply treat the same as having an Unknown resolution, which
delays their lowering, still allowing such type tests to be used in
subsequent optimization (e.g. planned usage during ICP). The final
lowering which simply removes these handles them fine.

Beefed up an existing ThinLTO test for such unpromoted type ids so that
the internal vtable isn't removed before lower type tests, which hides
the problem.

Reviewers: evgeny777, pcc

Subscribers: inglorion, hiraditya, steven_wu, dexonsmith, aganea, llvm-commits

Tags: #llvm

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

4 years ago[mlir][DialectConversion] Abort early if a subregion has a disconnected CFG.
Matthias Kramm [Mon, 2 Mar 2020 17:23:28 +0000 (09:23 -0800)]
[mlir][DialectConversion] Abort early if a subregion has a disconnected CFG.

Summary:
Make computeConversionSet bubble up errors from nested regions. Note
that this doesn't change top-level behavior - since the nested region
calls emitError, the error was visible before, just not surfaced as
quickly.

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

4 years agoSecond attempt to disable instrprof-merging.cpp
Vedant Kumar [Mon, 2 Mar 2020 17:25:22 +0000 (09:25 -0800)]
Second attempt to disable instrprof-merging.cpp

The first attempt in f82ae3ad was not handled correctly, as
'UNSUPPORTED: *' is not accepted by lit.

4 years ago[mlir] Update several usages of IntegerType to properly handled unsignedness.
River Riddle [Mon, 2 Mar 2020 17:18:45 +0000 (09:18 -0800)]
[mlir] Update several usages of IntegerType to properly handled unsignedness.

Summary: For example, DenseElementsAttr currently does not properly round-trip unsigned integer values.

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

4 years agoGlobalISel: Move Localizer::shouldLocalize(..) to TargetLowering
Volkan Keles [Mon, 2 Mar 2020 17:15:40 +0000 (09:15 -0800)]
GlobalISel: Move Localizer::shouldLocalize(..) to TargetLowering

Add a new target hook for shouldLocalize so that
targets can customize the logic.

https://reviews.llvm.org/D75207

4 years ago[Loop Peeling] Add possibility to enable peeling on loop nests.
Arkady Shlykov [Fri, 17 Jan 2020 13:35:19 +0000 (05:35 -0800)]
[Loop Peeling] Add possibility to enable peeling on loop nests.

Summary:
Current peeling implementation bails out in case of loop nests.
The patch introduces a field in TargetTransformInfo structure that
certain targets can use to relax the constraints if it's
profitable (disabled by default).
Also additional option is added to enable peeling manually for
experimenting and testing purposes.

Reviewers: fhahn, lebedev.ri, xbolva00

Reviewed By: xbolva00

Subscribers: RKSimon, xbolva00, hiraditya, zzheng, llvm-commits

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

4 years ago[mlir] Add padding to 1-D Vector in CRunnerUtils.h
Nicolas Vasilache [Mon, 2 Mar 2020 14:59:01 +0000 (09:59 -0500)]
[mlir] Add padding to 1-D Vector in CRunnerUtils.h

Summary:
This revision adds padding for 1-D Vector in the common case of x86
execution with a stadard data layout. This supports properly interfacing
codegen with arrays of e.g. `vector<9xf32>`.

Such vectors are already assumed padded to the next power of 2 by LLVM
codegen with the default x86 data layout:
```
define void @test_vector_add_1d_2_3(<3 x float>* nocapture readnone %0,
<3 x float>* nocapture readonly %1, i64 %2, i64 %3, i64 %4, <3 x float>*
nocapture readnone %5, <3 x float>* nocapture readonly %6, i64 %7, i64
%8, i64 %9, <3 x float>* nocapture readnone %10, <3 x float>* nocapture
%11, i64 %12, i64 %13, i64 %14) local_unnamed_addr {
  %16 = getelementptr <3 x float>, <3 x float>* %6, i64 1
  %17 = load <3 x float>, <3 x float>* %16, align 16
  %18 = getelementptr <3 x float>, <3 x float>* %1, i64 1
  %19 = load <3 x float>, <3 x float>* %18, align 16
  %20 = fadd <3 x float> %17, %19
  %21 = getelementptr <3 x float>, <3 x float>* %11, i64 1
```

The pointer addressing a `vector<3xf32>` is assumed aligned `@16`.
Similarly, the pointer addressing a `vector<65xf32>` is assumed aligned
`@512`.

This revision allows using objects such as `vector<3xf32>` properly with
the standard x86 data layout used in the JitRunner. Integration testing
is done out of tree, at the moment such testing fails without this
change.

Reviewers: ftynse

Subscribers: mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, llvm-commits

Tags: #llvm

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

4 years ago[OpenCL] Remove spurious atomic_fetch_min/max builtins
Sven van Haastregt [Mon, 2 Mar 2020 15:56:48 +0000 (15:56 +0000)]
[OpenCL] Remove spurious atomic_fetch_min/max builtins

These declarations use a mix of unsigned and signed argument and
return types.  This is not in accordance with OpenCL v2.0 s6.13.11.

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

4 years agoDisable instrprof-merging.cpp to unblock bots while I investigate
Vedant Kumar [Mon, 2 Mar 2020 15:51:06 +0000 (07:51 -0800)]
Disable instrprof-merging.cpp to unblock bots while I investigate

After D69471, this test started failing on powerpc64, s390x and on a
sanitizer bot. Disable the test while I investigate.

4 years ago[Hexagon] Use BUILD_PAIR to expand i128 instead of doing arithmetic
Krzysztof Parzyszek [Mon, 2 Mar 2020 15:49:53 +0000 (09:49 -0600)]
[Hexagon] Use BUILD_PAIR to expand i128 instead of doing arithmetic

4 years ago[clang-format] Rename CSharpNullConditionalSq and add missing test
Jonathan Coe [Mon, 2 Mar 2020 15:46:33 +0000 (15:46 +0000)]
[clang-format] Rename CSharpNullConditionalSq and add missing test

Summary:
Rename CSharpNullConditionalSq to CSharpNullConditionalLSquare.

Add test for spaces inside [] with C# Null conditionals.

Address comments missed from https://reviews.llvm.org/D75368.

Reviewers: krasimir

Reviewed By: krasimir

Subscribers: cfe-commits

Tags: #clang-format, #clang

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

4 years agoAdd flag _LIBCPP_ABI_STRING_OPTIMIZED_EXTERNAL_INSTANTIATIONS for basic_string ABI
Martijn Vels [Mon, 2 Mar 2020 15:11:35 +0000 (10:11 -0500)]
Add flag _LIBCPP_ABI_STRING_OPTIMIZED_EXTERNAL_INSTANTIATIONS for basic_string ABI

Summary: This review is a mostly trivial change to use an explicit ABI flag for the unstable external template list. This follows the practice for an ABI flag per feature, and provides a spot for the rational / motivation for the flag.

Reviewers: EricWF, ldionne

Subscribers: dexonsmith, libcxx-commits

Tags: #libc

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

4 years agoBuild fix: Turn off _GLIBCXX_DEBUG based on a compile check
Nicolai Hähnle [Wed, 26 Feb 2020 18:47:14 +0000 (19:47 +0100)]
Build fix: Turn off _GLIBCXX_DEBUG based on a compile check

Summary:
Enabling _GLIBCXX_DEBUG (implied by LLVM_ENABLE_EXPENSIVE_CHECKS) causes
std::min_element (and presumably others) to no longer be constexpr, which
in turn causes the build to fail.

This seems like a bug in the GCC STL. This change works around it.

Change-Id: I5fc471caa9c4de3ef4e87aeeac8df1b960e8e72c

Reviewers: tstellar, hans, serge-sans-paille

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

4 years ago[X86] Cleanup ShuffleDecode implementations. NFCI.
Simon Pilgrim [Mon, 2 Mar 2020 14:59:06 +0000 (14:59 +0000)]
[X86] Cleanup ShuffleDecode implementations. NFCI.
 - Remove unnecessary includes from the headers
 - Fix cppcheck definition/declaration arg mismatch warnings
 - Tidyup old comments (MVT usage was removed a long time ago)
 - Use SmallVector::append for repeated mask entries

4 years ago[CodeGenPGO] Fix shadow variable warning. NFC.
Simon Pilgrim [Mon, 2 Mar 2020 13:58:21 +0000 (13:58 +0000)]
[CodeGenPGO] Fix shadow variable warning. NFC.

4 years agoEHScopeStack::Cleanup has virtual functions so the destructor should be too.
Simon Pilgrim [Mon, 2 Mar 2020 13:26:39 +0000 (13:26 +0000)]
EHScopeStack::Cleanup has virtual functions so the destructor should be too.

Fixes cppcheck warning.

4 years ago[LoopVectorizer] Change types of lists from pointers to references. NFC
David Green [Mon, 2 Mar 2020 14:26:32 +0000 (14:26 +0000)]
[LoopVectorizer] Change types of lists from pointers to references. NFC

getReductionVars, getInductionVars and getFirstOrderRecurrences were all
being returned from LoopVectorizationLegality as pointers to lists. This
just changes them to be references, cleaning up the interface slightly.

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

4 years agoPartially inline basic_string::operator=(const basic_string&)
Martijn Vels [Wed, 26 Feb 2020 20:55:49 +0000 (15:55 -0500)]
Partially inline basic_string::operator=(const basic_string&)

Summary:
This change partially inlines operator=(const basic_string&) where both the input and current instance are short strings, making the assignment a fixed length inlined memcpy.

Assignments where either of the strings are long are delegate to __assign_no_alias<__is_short>(), which is templated for the long / short branch already observed in the caller.

Stable:
```
--------------------------------------------------------------------------------
Benchmark                                     Time             CPU   Iterations
--------------------------------------------------------------------------------
BM_StringAssignStr_Empty_Opaque            2.65 ns         2.66 ns    263745536
BM_StringAssignStr_Empty_Transparent       2.95 ns         2.96 ns    236494848
BM_StringAssignStr_Small_Opaque            2.93 ns         2.94 ns    237301760
BM_StringAssignStr_Small_Transparent       2.69 ns         2.69 ns    265809920
BM_StringAssignStr_Large_Opaque            19.6 ns         19.6 ns     35573760
BM_StringAssignStr_Large_Transparent       19.1 ns         19.1 ns     36716544
BM_StringAssignStr_Huge_Opaque             1901 ns         1901 ns       364544
BM_StringAssignStr_Huge_Transparent        1889 ns         1889 ns       360448
```

Unstable
```
--------------------------------------------------------------------------------
Benchmark                                     Time             CPU   Iterations
--------------------------------------------------------------------------------
BM_StringAssignStr_Empty_Opaque            1.29 ns         1.29 ns    540454912
BM_StringAssignStr_Empty_Transparent       1.11 ns         1.12 ns    628482048
BM_StringAssignStr_Small_Opaque            1.29 ns         1.29 ns    541216768
BM_StringAssignStr_Small_Transparent       1.11 ns         1.11 ns    629469184
BM_StringAssignStr_Large_Opaque            15.6 ns         15.6 ns     44945408
BM_StringAssignStr_Large_Transparent       14.9 ns         14.9 ns     46764032
BM_StringAssignStr_Huge_Opaque             1713 ns         1713 ns       401408
BM_StringAssignStr_Huge_Transparent        1704 ns         1704 ns       397312

```

Subscribers: libcxx-commits

Tags: #libc

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

4 years ago[OpenMP] Allow const parameters in declare simd linear clause
Graham Hunter [Fri, 28 Feb 2020 13:53:40 +0000 (13:53 +0000)]
[OpenMP] Allow const parameters in declare simd linear clause

Reviewers: ABataev, kkwli0, jdoerfert, fpetrogalli

Reviewed By: ABataev, fpetrogalli

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

4 years ago[MLIR][GPU] fix loop trip count computation in LoopsToGPU
Stephan Herhut [Mon, 2 Mar 2020 14:47:48 +0000 (15:47 +0100)]
[MLIR][GPU] fix loop trip count computation in LoopsToGPU

Summary: Added brackets to fix the loop trip count computation.
The brackets ensure the bounds are subtracted before we divide
the result by the step of the loop.

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

4 years ago[CodeGen] avoid running the entire optimizer pipeline in clang test file; NFC
Sanjay Patel [Mon, 2 Mar 2020 14:33:11 +0000 (09:33 -0500)]
[CodeGen] avoid running the entire optimizer pipeline in clang test file; NFC

I'm making the CHECK lines vague enough that they pass at -O0.
If that is too vague (we really want to check the data flow
to verify that the variables are not mismatched, etc), then
we can adjust those lines again to more closely match the output
at -O0 rather than -O1.

This change is based on the post-commit comments for:
https://github.com/llvm/llvm-project/commit/83f4372f3a708ceaa800feff8b1bd92ae2c3be5f
http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20200224/307888.html

4 years ago[mlir] NFC - Move Vector structure from RunnerUtils.h to CRunnerUtils.h
Nicolas Vasilache [Sat, 29 Feb 2020 18:40:59 +0000 (13:40 -0500)]
[mlir] NFC - Move Vector structure from RunnerUtils.h to CRunnerUtils.h

Summary: The Vector struct does not require a C++ runtime.

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

4 years ago[clangd] No need to query ctor refs in cross-file rename.
Haojian Wu [Mon, 2 Mar 2020 08:58:14 +0000 (09:58 +0100)]
[clangd] No need to query ctor refs in cross-file rename.

Summary:
This patch reverts https://github.com/llvm/llvm-project/commit/2c5ee78de113484978450b834498e1b0e2aab5c4,
now kythe (https://github.com/kythe/kythe/issues/4381) supports returning ctors refs as part of class references, so
there is no need to query the ctor refs in the index (this would also
make the results worse, lots of duplications)

Reviewers: sammccall

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

Tags: #clang

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

4 years ago[CodeGen] avoid running the entire optimizer pipeline in clang test file; NFC
Sanjay Patel [Mon, 2 Mar 2020 14:09:39 +0000 (09:09 -0500)]
[CodeGen] avoid running the entire optimizer pipeline in clang test file; NFC

There are no failures from the first set of RUN lines here,
so the CHECKs were already vague enough to not be affected
by optimizations. The final RUN line does induce some kind
of failure, so I'll try to fix that separately in a
follow-up.

4 years ago[clang-format] Handle NullCoalescing and NullConditional operators in C#
Jonathan Coe [Mon, 2 Mar 2020 13:55:54 +0000 (13:55 +0000)]
[clang-format] Handle NullCoalescing and NullConditional operators in C#

Summary:
Disable merging of Type? into a single token.

Merge ?? ?. and ?[ into a single token.

Reviewers: krasimir, MyDeveloperDay

Reviewed By: krasimir

Subscribers: cfe-commits

Tags: #clang-format, #clang

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

4 years ago[MLIR] Add includes to PointerLikeTypeTraits where needed.
Stephan Herhut [Mon, 2 Mar 2020 10:34:25 +0000 (11:34 +0100)]
[MLIR] Add includes to PointerLikeTypeTraits where needed.

Summary:
This is to ensure that the template declaration is seen before
any template specialization.

Reviewers: mravishankar, antiagainst, rriddle!

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

4 years ago[clangd] Get rid of lexer usage in locateMacroAt
Kadir Cetinkaya [Fri, 28 Feb 2020 08:25:40 +0000 (09:25 +0100)]
[clangd] Get rid of lexer usage in locateMacroAt

Reviewers: sammccall, hokein

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

Tags: #clang

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

4 years ago[clangd] Get rid of unnecessary source transformations in locateMacroAt
Kadir Cetinkaya [Thu, 27 Feb 2020 15:02:44 +0000 (16:02 +0100)]
[clangd] Get rid of unnecessary source transformations in locateMacroAt

Summary:
All callers are already passing spelling locations to locateMacroAt.
Also there's no point at looking at macro expansion for figuring out undefs as
it is forbidden to have PP directives inside macro bodies.
Also fixes a bug when the previous sourcelocation is unavailable.

Reviewers: sammccall, hokein

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

Tags: #clang

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

4 years ago[ARM] Add Cortex-M55 Support for clang and llvm
Luke Geeson [Fri, 14 Feb 2020 13:33:32 +0000 (13:33 +0000)]
[ARM] Add Cortex-M55 Support for clang and llvm

This patch upstreams support for the ARM Armv8.1m cpu Cortex-M55.

In detail adding support for:

 - mcpu option in clang
 - Arm Target Features in clang
 - llvm Arm TargetParser definitions

details of the CPU can be found here:
https://developer.arm.com/ip-products/processors/cortex-m/cortex-m55

Reviewers: chill

Reviewed By: chill

Subscribers: dmgreen, kristof.beyls, hiraditya, cfe-commits,
llvm-commits

Tags: #clang, #llvm

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

4 years agoFix shadow variable warning. NFC.
Simon Pilgrim [Mon, 2 Mar 2020 11:30:42 +0000 (11:30 +0000)]
Fix shadow variable warning. NFC.

4 years agoFix shadow variable warning. NFC.
Simon Pilgrim [Mon, 2 Mar 2020 11:19:48 +0000 (11:19 +0000)]
Fix shadow variable warning. NFC.

4 years ago[CostModel][X86] Add vXi1 extract/insert cost tests
Simon Pilgrim [Mon, 2 Mar 2020 11:18:41 +0000 (11:18 +0000)]
[CostModel][X86] Add vXi1 extract/insert cost tests

4 years ago[clang-tidy] Copy the Ranges field from the Diagnostic when creating the ClangTidyError
Joe Turner [Thu, 27 Feb 2020 19:18:38 +0000 (20:18 +0100)]
[clang-tidy] Copy the Ranges field from the Diagnostic when creating the ClangTidyError

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

4 years ago[analyzer][StreamChecker] Using function description objects - NFC.
Balázs Kéri [Mon, 2 Mar 2020 10:48:19 +0000 (11:48 +0100)]
[analyzer][StreamChecker] Using function description objects - NFC.

Summary:
Have a description object for the stream functions
that can store different aspects of a single stream operation.

I plan to extend the structure with other members,
for example pre-callback and index of the stream argument.

Reviewers: Szelethus, baloghadamsoftware, NoQ, martong, Charusso, xazax.hun

Reviewed By: Szelethus

Subscribers: rnkovacs, xazax.hun, baloghadamsoftware, szepet, a.sidorin, mikhail.ramalho, Szelethus, donat.nagy, dkrupp, gamesh411, Charusso, martong, cfe-commits

Tags: #clang

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

4 years agoReland "[DebugInfo][clang][DWARF5]: Added support for debuginfo generation for defaul...
Awanish Pandey [Mon, 2 Mar 2020 05:22:12 +0000 (10:52 +0530)]
Reland "[DebugInfo][clang][DWARF5]: Added support for debuginfo generation for defaulted parameters
in C++ templates."

This was reverted in 802b22b5c8c30bebc1695a217478be02653c6b53 due to
missing .bc file and a chromium bot failure.
https://bugs.chromium.org/p/chromium/issues/detail?id=1057559#c1
This revision address both of them.

Summary:
This patch adds support for debuginfo generation for defaulted
parameters in clang and also extends corresponding DebugMetadata/IR to support this feature.

Reviewers: probinson, aprantl, dblaikie

Reviewed By: aprantl, dblaikie

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

4 years agoFix operator precedence warning. NFCI.
Simon Pilgrim [Mon, 2 Mar 2020 10:56:29 +0000 (10:56 +0000)]
Fix operator precedence warning. NFCI.

4 years ago[mlir] mlir-opt: print a newline after the top-level module
Alex Zinenko [Mon, 2 Mar 2020 10:40:50 +0000 (11:40 +0100)]
[mlir] mlir-opt: print a newline after the top-level module

A printer refactoring removed automatic newline printing in the printer
of a ModuleOp. As a consequence, mlir-opt no longer printed a newline
after the closing brace of a module, which made it hard to distinguish
when used from command line. Print the newline character explicitly in
mlir-opt.

4 years ago[AArch64][SVE] Add intrinsics for non-temporal gather-loads/scatter-stores
Andrzej Warzynski [Wed, 19 Feb 2020 12:25:30 +0000 (12:25 +0000)]
[AArch64][SVE] Add intrinsics for non-temporal gather-loads/scatter-stores

Summary:
This patch adds the following LLVM IR intrinsics for SVE:
1. non-temporal gather loads
  * @llvm.aarch64.sve.ldnt1.gather
  * @llvm.aarch64.sve.ldnt1.gather.uxtw
  * @llvm.aarch64.sve.ldnt1.gather.scalar.offset
2. non-temporal scatter stores
  * @llvm.aarch64.sve.stnt1.scatter
  * @llvm.aarch64.sve.ldnt1.gather.uxtw
  * @llvm.aarch64.sve.ldnt1.gather.scalar.offset
These intrinsic are mapped to the corresponding SVE instructions
(example for half-words, zero-extending):
  * ldnt1h { z0.s }, p0/z, [z0.s, x0]
  * stnt1h { z0.s }, p0/z, [z0.s, x0]

Note that for non-temporal gathers/scatters, the SVE spec defines only
one instruction type: "vector + scalar". For this reason, we swap the
arguments when processing intrinsics that implement the "scalar +
vector" addressing mode:
  * @llvm.aarch64.sve.ldnt1.gather
  * @llvm.aarch64.sve.ldnt1.gather.uxtw
  * @llvm.aarch64.sve.stnt1.scatter
  * @llvm.aarch64.sve.ldnt1.gather.uxtw
In other words, all intrinsics for gather-loads and scatter-stores
implemented in this patch are mapped to the same load and store
instruction, respectively.

The sve2_mem_gldnt_vs multiclass (and it's counterpart for scatter
stores) from SVEInstrFormats.td was split into:
  * sve2_mem_gldnt_vec_vs_32_ptrs (32bit wide base addresses)
  * sve2_mem_gldnt_vec_vs_62_ptrs (64bit wide base addresses)
This is consistent with what we did for
@llvm.aarch64.sve.ld1.scalar.offset and highlights the actual split in
the spec and the implementation.

Reviewed by: sdesmalen

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

4 years ago[ARM,MVE] Add ACLE intrinsics for VCVT[ANPM] family.
Simon Tatham [Mon, 2 Mar 2020 09:06:09 +0000 (09:06 +0000)]
[ARM,MVE] Add ACLE intrinsics for VCVT[ANPM] family.

Summary:
These instructions convert a vector of floats to a vector of integers
of the same size, with assorted non-default rounding modes.
Implemented in IR as target-specific intrinsics, because as far as I
can see there are no matches for that functionality in the standard IR
intrinsics list.

Reviewers: MarkMurrayARM, dmgreen, miyuki, ostannard

Reviewed By: dmgreen

Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

4 years ago[ARM,MVE] Add ACLE intrinsics for VCVT.F32.F16 family.
Simon Tatham [Mon, 2 Mar 2020 09:06:00 +0000 (09:06 +0000)]
[ARM,MVE] Add ACLE intrinsics for VCVT.F32.F16 family.

Summary:
These instructions make a vector of `<4 x float>` by widening every
other lane of a vector of `<8 x half>`.

I wondered about representing these using standard IR, along the lines
of a shufflevector to extract elements of the input into a `<4 x half>`
followed by an `fpext` to turn that into `<4 x float>`. But it looks as
if that would take a lot of work in isel lowering to make it match any
pattern I could sensibly write in Tablegen, and also I haven't been
able to think of any other case where that pattern might be generated
in IR, so there wouldn't be any extra code generation win from doing
it that way.

Therefore, I've just used another target-specific intrinsic. We can
always change it to the other way later if anyone thinks of a good
reason.

(In order to put the intrinsic definition near similar things in
`IntrinsicsARM.td`, I've also lifted the definition of the
`MVEMXPredicated` multiclass higher up the file, without changing it.)

Reviewers: MarkMurrayARM, dmgreen, miyuki, ostannard

Reviewed By: miyuki

Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

4 years ago[ARM,MVE] Correct MC operands in VCVT.F32.F16. (NFC)
Simon Tatham [Mon, 2 Mar 2020 09:05:48 +0000 (09:05 +0000)]
[ARM,MVE] Correct MC operands in VCVT.F32.F16. (NFC)

Summary:
The two MVE instructions that convert between v4f32 and v8f16 were
implemented as instances of the same class, with the same MC operand
list.

But that's not really appropriate, because the narrowing conversion
only partially overwrites its output register (it only has 4 f16
values to write into a vector of 8), so even when unpredicated, it
needs a $Qd_src input, a constraint tying that to the $Qd output, and
a vpred_n.

The widening conversion is better represented like any other
instruction that completely replaces its output when unpredicated: it
should have no $Qd_src operand, and instead, a vpred_r containing a
$inactive parameter. That's a better match to other similar
instructions, such as its integer analogue, the VMOVL instruction that
makes a v4i32 by sign- or zero-extending every other lane of a v8i16.

This commit brings the widening VCVT.F32.F16 into line with the other
instructions that behave like it. That means you can write isel
patterns that use it unpredicated, without having to add a pointless
undefined $QdSrc operand.

No existing code generation uses that instruction yet, so there should
be no functional change from this fix.

Reviewers: MarkMurrayARM, dmgreen, miyuki, ostannard

Reviewed By: dmgreen

Subscribers: kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[ARM,MVE] Add ACLE intrinsics for VQMOV[U]N family.
Simon Tatham [Mon, 2 Mar 2020 09:05:35 +0000 (09:05 +0000)]
[ARM,MVE] Add ACLE intrinsics for VQMOV[U]N family.

Summary:
These instructions work like VMOVN (narrowing a vector of wide values
to half size, and overwriting every other lane of an output register
with the result), except that the narrowing conversion is saturating.
They come in three signedness flavours: signed to signed, unsigned to
unsigned, and signed to unsigned. All are represented in IR by a
target-specific intrinsic that takes two separate 'unsigned' flags.

Reviewers: MarkMurrayARM, dmgreen, miyuki, ostannard

Reviewed By: dmgreen

Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

4 years ago[lld] Fix test failure from d978656fd06
Pavel Labath [Mon, 2 Mar 2020 10:28:48 +0000 (11:28 +0100)]
[lld] Fix test failure from d978656fd06

Tweak the test to account for the slightly different wording of the
error message.

4 years ago[DWARF] Use DWARFDataExtractor::getInitialLength to parse debug_names
Pavel Labath [Tue, 25 Feb 2020 14:40:49 +0000 (15:40 +0100)]
[DWARF] Use DWARFDataExtractor::getInitialLength to parse debug_names

Summary:
In this patch I've done a slightly bigger rewrite to also remove the
hardcoded header lengths.

Reviewers: jhenderson, dblaikie, ikudrin

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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