Commit Graph

354591 Commits

Author SHA1 Message Date
Stephen Neuendorffer 802b427f20 [MLIR] Update intrinsic test, because ptrmask changed.
See adda9c0a4f.

Differential Revision: https://reviews.llvm.org/D80036
2020-05-15 14:35:39 -07:00
Hubert Tong e3e0367f9b [CMake][AIX] Add `-bcdtors:mbr` option when building with IBM XL
Summary:
The `-bcdtors:mbr` option causes processing for constructors and
destructors to omit otherwise-unreferenced members of static libraries,
matching the processing done on Linux, where `--whole-archive` is not
the default. Applying this option is desirable for reducing the
footprint of an installation.

Reviewed By: daltenty

Differential Revision: https://reviews.llvm.org/D79749
2020-05-15 17:34:00 -04:00
Hubert Tong 3f5fc73a9d [test][ARM][CMSE] Use clang_cc1 in arm_cmse.h tests
Summary:
The `arm_cmse.h` header includes standard headers, but some tests that
include this header explicitly specify a target. The standard headers
found via the standard include paths need not be compatible with the
explicitly-specified target from the tests. In order to avoid test
failures caused by such incompatibility, this patch uses `%clang_cc1`,
which doesn't pick up the host system headers.

Reviewed By: chill

Differential Revision: https://reviews.llvm.org/D79693
2020-05-15 17:34:00 -04:00
Hubert Tong 15f0f824b3 [tests][Driver] Set `--sysroot=""` to allow `DEFAULT_SYSROOT` build
Summary:
If `DEFAULT_SYSROOT` is configured to some path, some tests would fail.
This patch overrides `sysroot` to be the empty string in the style of
D66834 so that the tests will pass even when the build is configured
with a `DEFAULT_SYSROOT`.

Reviewed By: mstorsjo

Differential Revision: https://reviews.llvm.org/D79694
2020-05-15 17:34:00 -04:00
Stephen Neuendorffer 1cff8e8de7 [MLIR] LinalgToStandard: use LINK_LIBS rather than target_link_libraries.
Also, missing MLIRTransforms as a dependency.  This breaks BUILD_SHARED_LIBS=on

Differential Revision: https://reviews.llvm.org/D80035
2020-05-15 14:25:28 -07:00
Fangrui Song a63eedd049 [CMake] -gen-dag-isel: add -omit-comments if neither Debug nor RelWithDebInfo
Omitting comments can make the output much smaller. Size/time impact on
my machine:

* lib/Target/AArch64/AArch64GenDAGISel.inc, 10MiB (8.89s) -> 5MiB (3.20s)
* lib/Target/X86/X86GenDAGISel.inc, 20MiB (6.48s) -> 8.5MiB (4.18s)

In total, this change decreases lib/Target/*/*GenDAGISel.inc from
71.4MiB to 30.1MiB.

As rnk suggested, we can consider an option next to LLVM_OPTIMIZED_TABLEGEN
once we have more needs like this.

Reviewed By: thakis

Differential Revision: https://reviews.llvm.org/D78884
2020-05-15 14:03:05 -07:00
Vitaly Buka 6512cc7735 [NFC,StackSafety] Rename local function 2020-05-15 13:39:07 -07:00
Nico Weber d5e9b76253 [gn build] Put HAVE_LIBZ and HAVE_ZLIB_H behind llvm_enable_zlib too.
In the CMake build, the HAVE_ vars are set based on system inspection,
and LLVM_ENABLE_ZLIB is set to false if neither's found. The GN build
doesn't do autodetection like this.

With this change, people can set llvm_enable_zlib=true on Windows
and as long as they provide a zlib.lib things should actually work.

(https://reviews.llvm.org/D79219 will remove 2 of the 3 config.h
values, hopefully soon. This change here just makes things a tiny
bit easier until that change is in.)
2020-05-15 16:18:56 -04:00
Med Ismail Bennani 4e9e0488ab [lldb/Commands] Add ability to run shell command on the host.
This patch introduces the `(-h|--host)` option to the `platform shell`
command. It allows the user to run shell commands from the host platform
(always available) without putting lldb in the background.

Since the default behaviour of `platform shell` is to run the command of
the selected platform, having such a choice can be quite handy when
debugging remote targets, for instances.

This patch also introduces a `shell` alias, to improve the command
discoverability and make it more convenient to use for the user.

rdar://62856024

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2020-05-15 22:14:39 +02:00
Med Ismail Bennani 0eba9de71e [lldb/Dataformatter] Add support to CF{Dictionary,Set}Ref types
This patch improves data formatting for CFDictionaryRef and CFSetRef.
It uses the same data-formatter as NSCFDictionaries and NSCFSets introduced
previously but did require some adjustments in Core::ValueObject.

Since the "Ref" types are opaque pointers to the actual CF containers, if the
value object has a synthetic value, lldb will use the opaque pointer's pointee
type to create the new ValueObjectChild needed to dereference the ValueObject.
This allows the "Ref" types to behaves the same as CF containers when used with
the `frame variable` command, the SBAPI or in Xcode's variable inspector.

This patch also adds support for incomplete types in ValueObject.

rdar://53104287

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2020-05-15 22:14:39 +02:00
mydeveloperday e8ea35e63f [clang-format] [PR44345] Long namespace closing comment is duplicated endlessly
Summary:
https://bugs.llvm.org/show_bug.cgi?id=44345

When namespaces get long the namespace end comment wraps onto the next line

```
namespace would:🇮🇹:save::you:🅰️:lot::of::time::if_::i::just::gave:🆙:and_::
    went::mad::now {
void foo();
void bar();
} // namespace
  // would:🇮🇹:save::you:🅰️:lot::of::time::if_::i::just::gave:🆙:and_::went::mad::now
```

If clang-format it applied successively it will duplicate the end comment

```
namespace would:🇮🇹:save::you:🅰️:lot::of::time::if_::i::just::gave:🆙:and_::
    went::mad::now {
void foo();
void bar();
} // namespace
  // would:🇮🇹:save::you:🅰️:lot::of::time::if_::i::just::gave:🆙:and_::went::mad::now
  // would:🇮🇹:save::you:🅰️:lot::of::time::if_::i::just::gave:🆙:and_::went::mad::now
```

This revision checks to ensure the end comment is not on the next line before adding yet another comment

Reviewed By: krasimir

Subscribers: cfe-commits

Tags: #clang, #clang-format

Differential Revision: https://reviews.llvm.org/D79935
2020-05-15 21:00:55 +01:00
Christopher Tetreault 245679b62e [SVE] Remove usages of VectorType::getNumElements() from ARM
Reviewers: efriedma, fpetrogalli, kmclaughlin, grosbach, dmgreen

Reviewed By: dmgreen

Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, dmgreen, danielkiss, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D79816
2020-05-15 12:55:27 -07:00
Siva Chandra Reddy 96d85726b0 [libc] Move implementations of expf and exp2f from the AOR to src/math.
Reviewers: phosek

Differential Revision: https://reviews.llvm.org/D79149
2020-05-15 12:43:03 -07:00
Christopher Tetreault 0d5d5a75e2 [SVE] Remove usages of VectorType::getNumElements() from PowerPC
Reviewers: efriedma, sdesmalen, c-rhodes, hfinkel

Reviewed By: c-rhodes

Subscribers: wuzish, nemanjai, tschuett, hiraditya, kbarton, rkruppe, psnobl, shchenz, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D79821
2020-05-15 12:30:56 -07:00
Mircea Trofin 08e2386dee Revert "Revert "[llvm][NFC] Cleanup uses of std::function in Inlining-related APIs""
This reverts commit 454de99a6f.

The problem was that one of the ctor arguments of CallAnalyzer was left
to be const std::function<>&. A function_ref was passed for it, and then
the ctor stored the value in a function_ref field. So a std::function<>
would be created as a temporary, and not survive past the ctor
invocation, while the field would.

Tested locally by following https://github.com/google/sanitizers/wiki/SanitizerBotReproduceBuild

Original Differential Revision: https://reviews.llvm.org/D79917
2020-05-15 12:29:16 -07:00
Eli Friedman 11aa3707e3 StoreInst should store Align, not MaybeAlign
This is D77454, except for stores.  All the infrastructure work was done
for loads, so the remaining changes necessary are relatively small.

Differential Revision: https://reviews.llvm.org/D79968
2020-05-15 12:26:58 -07:00
Zola Bridges 18a855da43 [clang][slh] Add test for SLH feature checking macro
Summary:
I forgot to include a test in this commit:
https://reviews.llvm.org/rG379e68a763097bed55556c6dc7453e4b732e3d68

Here's the test. It passes after that commit and fails before that commit.

Reviewed By: mattdr

Differential Revision: https://reviews.llvm.org/D79894
2020-05-15 12:23:31 -07:00
Scott Linder 03c44c7584 [NFC] Deduplicate comment in PromoteMemoryToRegister.cpp
This has been duplicated since before
2372a193ba, but that commit has it
appearing twice in the space of 10 lines of the same function body. It
could also be hoisted up to the point just after where the last
special-case is considered, but I want to keep the intent of the
original authors.

Committed as obvious without a review.
2020-05-15 15:18:07 -04:00
Thomas Lively 40af48101b [WebAssembly] Optimize splats of bitcasted vectors
Summary:
This new custom DAG combine fixes a codegen issue with the
wasm_simd128.h intrinsics. Clang lowers the

  return (v128_t)(__f32x4){__a, __a, __a, __a};

body of f32x4_splat to a splat shuffle of a bitcasted vector, as seen
in the new simd-shuffle-bitcast.ll test. The bitcast interfered with
the target-independent DAG combine that combines splat shuffles into
BUILD_VECTOR nodes, so this patch introduces a new custom DAG combine
to hoist the bitcast out of the shuffle, allowing the
target-independent combine to work as intended.

Reviewers: aheejin, dschuff

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

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D80021
2020-05-15 12:12:20 -07:00
Hongtao Yu 90af55d8a9 [LLD][ELF] Use offset in thin archives to disambiguate thinLTO members
This is fixing a thinLTO module collision issue for thin archives. The problem is that we always use a zero offset to name members in a thin archive and that causes the following build error:

    ld.lld: error: Expected at most one ThinLTO module per bitcode file

which happens to a thin archive that has two members with the same object file name (whose paths will be ignored by thinLTO driver)

The fix here is to use real member offset instead as is done for non-thin archives.

Differential Revision: https://reviews.llvm.org/D79880
2020-05-15 12:02:08 -07:00
Eli Friedman a1ce88b4e3 [AArch64][SVE] Implement AArch64ISD::SETCC_PRED
This unifies SETCC operations along the lines of other operations.

Differential Revision: https://reviews.llvm.org/D79975
2020-05-15 11:53:21 -07:00
Christopher Tetreault 015e297a37 [SVE] Restore broken LLVM-C ABI compatability
Reviewers: deadalnix, efriedma, rengolin, jyknight, joerg

Reviewed By: joerg

Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D79915
2020-05-15 11:50:24 -07:00
Matt Arsenault adda9c0a4f IR: Remove extra name mangling from llvm.ptrmask
This should not be allowed to change the address space of the source
and result, so the pointer types should match. The only emitter of
this seems to be a disable clang change, so no tests to update.
2020-05-15 14:49:00 -04:00
Daniel Grumberg 558db27c49 [NFC] Whitespace fix inside OptParserEmitter 2020-05-15 11:27:13 -07:00
Jinsong Ji 853b5cbadc [compiler-rt][CMAKE] Only add cmake link flags in standalone build
Only add CMAKE_EXE_LINKER_FLAGS when in a standalone bulid.
Or else CMAKE_EXE_LINKER_FLAGS contains flags for build compiler of Clang/llvm.
This might not be the same as what the COMPILER_RT_TEST_COMPILER supports.
eg: the build compiler use lld linker and we use it to build clang with
default ld linker then to be tested clang will complain about lld
options like --color-diagnostics.

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D78373
2020-05-15 18:25:39 +00:00
Louis Dionne 16f5ce5a74 [libc++] Remove -ftemplate-depth when running tests
It doesn't appear to be needed anymore with the Clang on our build bots.
2020-05-15 14:21:29 -04:00
Siva Chandra Reddy 4a39a33d44 [libc] Add implementation of fabs and fabsf.
Reviewers: phosek

Differential Revision: https://reviews.llvm.org/D79725
2020-05-15 11:10:43 -07:00
Louis Dionne ddacd370c5 [libc++] Do not set the runtime library path with DYLD_LIBRARY_PATH
We already set it using -rpath when linking test executables, and using
DYLD_LIBRARY_PATH causes problems when running other commands that
shouldn't run against the just-built libc++ (e.g. `ls` in a ShTest).

rdar://63241847
2020-05-15 14:09:40 -04:00
Siva Chandra Reddy 32a22a423c [libc] Consolidate floating point utils into a single utils library.
A new utils library named 'fputil' is added. This library is used in
math tests and the MPFR wrapper. The math implementations will be
modified to use this library in a later round.

Reviewers: phosek

Differential Revision: https://reviews.llvm.org/D79724
2020-05-15 11:08:41 -07:00
Fangrui Song e36223c85c [ELF] Enforce two dashes for Flag options not supported by GNU ld (i.e. no compatibility burden)
Announced on https://lists.llvm.org/pipermail/llvm-dev/2020-May/141416.html

Similar to D79371, but for `multiclass B` (convenience helper for defining --foo and --no-foo)

Some changed options are also used by gold, but I haven't seen their
one-dash use cases outside of lld's testsuite.
2020-05-15 11:07:25 -07:00
aartbik b1c688dbae [mlir] [VectorOps] Implement vector.create_mask lowering to LLVM IR
Summary:
First, compact implementation of lowering to LLVM IR. A bit more
challenging than the constant mask due to the dynamic indices, of course.
I like to hear if there are more efficient ways of doing this in LLVM,
but this for now at least gives us a functional reference implementation.

Reviewers: nicolasvasilache, ftynse, bkramer, reidtatge, andydavis1, mehdi_amini

Reviewed By: nicolasvasilache

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

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D79954
2020-05-15 11:02:30 -07:00
Sourabh Singh Tomar a760553222 Fixed arm build bot failure after 4042ada1c1
This fixes bot failure seen in
http://lab.llvm.org:8011/builders/llvm-clang-win-x-armv7l/builds/7378
by adding `REQUIRES: x86_64-linux` to the test case
2020-05-15 23:30:05 +05:30
Louis Dionne 93e8164546 [libc++] Remove workaround for DYLD_LIBRARY_PATH being passed to the compiler
Since we're using the new testing format, DYLD_LIBRARY_PATH is not passed
to the compiler -- it's only passed to the programs we run as an argument
to the %{exec} substitution.
2020-05-15 13:53:45 -04:00
Thomas Lively c702d4bf41 [WebAssembly] Update latest implemented SIMD instructions
Summary:
Move instructions that have recently been implemented in V8 from the
`unimplemented-simd128` target feature to the `simd128` target
feature. The updated instructions match the update at
https://github.com/WebAssembly/simd/pull/223.

Reviewers: aheejin

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

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D79973
2020-05-15 10:53:02 -07:00
Nicolas Vasilache 8b78c50e82 [mlir] Fix incorrect indexing of subview in DimOp folding.
DimOp folding is using bare accesses to underlying SubViewOp operands.
This is generally incorrect and is fixed in this revision.

Differential Revision: https://reviews.llvm.org/D80017
2020-05-15 13:50:40 -04:00
Wouter van Oortmerssen 62efd1eca2 [WebAssembly] Fixed debugloc in DebugFixup pass
BuildMI requires this debug loc to be from the same sub program as the variable metadata passed in.

Differential Revision:  https://reviews.llvm.org/D80019
2020-05-15 10:50:14 -07:00
Sourabh Singh Tomar 2c81508728 Fixed arm build bot failure after ab699d78a2
This fixes bot failure seen in
http://lab.llvm.org:8011/builders/llvm-clang-win-x-armv7l/builds/7378
by adding `REQUIRES: x86_64-linux` to the test case
2020-05-15 23:14:56 +05:30
Nikita Popov f89f7da999 [IR] Convert null-pointer-is-valid into an enum attribute
The "null-pointer-is-valid" attribute needs to be checked by many
pointer-related combines. To make the check more efficient, convert
it from a string into an enum attribute.

In the future, this attribute may be replaced with data layout
properties.

Differential Revision: https://reviews.llvm.org/D78862
2020-05-15 19:41:07 +02:00
Stephen Neuendorffer 9de4ee3815 [MLIR] Allow unreachable blocks to violate dominance property.
It is possible for optimizations to create SSA code which violates
the dominance property in unreachable blocks.  Equivalently, dominance
computed using normal mechanisms is undefined in unreachable blocks.

See discussion here: https://llvm.discourse.group/t/rfc-allowing-dialects-to-relax-the-ssa-dominance-condition/833/51

This patch only checks the dominance condition inside blocks which are
reachable from the the entry block of their region.  Note that the
dominance conditions of regions contained in an unreachable block are
still checked.

Differential Revision: https://reviews.llvm.org/D79922
2020-05-15 10:31:57 -07:00
Simon Pilgrim 330b7491d5 [X86] Remove some duplicate ConstantSDNode casts. NFC.
Avoid repeated isa<> and cast<> by just performing a dyn_cast<ConstantSDNode>
2020-05-15 18:23:35 +01:00
Jay Foad 91ef7cb508 [IR] Trivial cleanups in Use. NFC.
Remove Use::setPrev. It provided no value because it had the same
accessibility as the underlying field Prev, and there was no
corresponding setNext anyway.

Simplify Use::removeFromList.
2020-05-15 18:14:45 +01:00
Sanjay Patel dfb99e1a28 [x86][CGP] add more tests for PR37426; NFC
This broke when we started canonicalizing more code to funnel shift.
See D79718 and D79827 for related test/transforms.
2020-05-15 13:05:21 -04:00
Louis Dionne 21b0ec2fc6 [libc++] Do not rely on use_system_cxx_lib to specify the path of the library to run against
This is already handled by setting cxx_runtime_root instead -- I don't
see a reason to have two ways of setting the runtime path of the library
we're running against.
2020-05-15 13:01:37 -04:00
Craig Topper e288e24376 [X86] Move expansion of MASKPAIR16LOAD and MASKPAIR16STORE from X86MCInstLower to X86ExpandPseudo.
It makes more sense to turn these into real instructions
a little earlier in the pipeline.

I've made sure to adjust the memoperand so the spill/reload
comments are printed correctly.
2020-05-15 09:51:32 -07:00
Alexey Lapshin da30c3796a [x86][NFC] Apply clang-format to X86ISelLowering.h
Summary:
  Apply clang-format to X86ISelLowering.h

Reviewed by: aeubanks

Differential Revision: https://reviews.llvm.org/D80005
2020-05-15 19:48:16 +03:00
Yonghong Song 072cde03aa [Clang][BPF] implement __builtin_btf_type_id() builtin function
Such a builtin function is mostly useful to preserve btf type id
for non-global data. For example,
   extern void foo(..., void *data, int size);
   int test(...) {
     struct t { int a; int b; int c; } d;
     d.a = ...; d.b = ...; d.c = ...;
     foo(..., &d, sizeof(d));
   }

The function "foo" in the above only see raw data and does not
know what type of the data is. In certain cases, e.g., logging,
the additional type information will help pretty print.

This patch implemented a BPF specific builtin
  u32 btf_type_id = __builtin_btf_type_id(param, flag)
which will return a btf type id for the "param".
flag == 0 will indicate a BTF local relocation,
which means btf type_id only adjusted when bpf program BTF changes.
flag == 1 will indicate a BTF remote relocation,
which means btf type_id is adjusted against linux kernel or
future other entities.

Differential Revision: https://reviews.llvm.org/D74668
2020-05-15 09:44:54 -07:00
Simon Pilgrim 9825d3daa8 [X86] Use getConstantOperandVal helper in a few places. NFC.
Avoid raw cast<ConstantSDNode> calls.
2020-05-15 17:31:27 +01:00
Simon Pilgrim 4580b0f5b6 [X86] getFauxShuffle - remove (unused) ISD::TRUNCATE shuffle decoding. 2020-05-15 17:31:26 +01:00
Louis Dionne 1a68b5f048 [libc++] Fix broken Lit features based on __config_site macros
Because of Python's funny scoping rules with lambdas, we were always
using the value of `macro` as set in the last iteration of the loop.
This problem was introduced by e7bdfba4f0.
2020-05-15 12:25:19 -04:00
Louis Dionne bb7191aa81 [libc++] Segregate back-deployment dylibs into their own subdirectory
Otherwise, specifying (for example) the libc++.dylib from macos10.13
but the libc++abi.dylib from macos10.12 would end up adding library
paths for both the 10.12 and 10.13 dylibs, which would each contain
a copy of both libc++abi.dylib and libc++.dylib. By using a separate
directory for libc++.dylib and libc++abi.dylib, those do not conflict
anymore.

The back-deployment roots were updated to match this change.
2020-05-15 12:16:02 -04:00