Commit Graph

356922 Commits

Author SHA1 Message Date
Daniel Sanders f743975e0a Support other llc-like tools in update_llc_test_checks.py
Summary:
If you have downstream tools that are llc-like (e.g, llc with different
defaults), it's convenient to still be able to use
`update_llc_test_checks` with them. Refactor slightly to allow such tools
to be supported by adding them to LLC_LIKE_TOOLS

Reviewers: bogner

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D80960
2020-06-10 17:30:07 -07:00
Rahul Joshi a0dd5e876f [MLIR] Print function name when ReturnOp verification fails
Summary:
- Print function name when ReturnOp verification fails
- This helps easily finding the invalid ReturnOp in an IR dump.

Differential Revision: https://reviews.llvm.org/D81513
2020-06-10 17:22:49 -07:00
Rob Suderman 3d56f166bd [mlir][StandardOps] Updated IndexCastOp to support tensor<index> cast
Summary:
We now support index casting for tensor<index> to tensor<int>. This
better supports compatibility with the Shape dialect.

Differential Revision: https://reviews.llvm.org/D81611
2020-06-10 17:19:08 -07:00
River Riddle 51114686d5 [mlir][NFC] Split Parser into several different files.
Summary: At this point Parser has grown to be over 5000 lines and can be very difficult to navigate/update/etc. This commit splits Parser.cpp into several sub files focused on parsing specific types of entities; e.g., Attributes, Types, etc.

Differential Revision: https://reviews.llvm.org/D81299
2020-06-10 17:17:13 -07:00
Craig Topper 94b1404587 [InstCombine] Remove some repeated calls to getOperand. NFCI
We had alread loaded operand 1 and 2 of the select as TV and FV
using the more the readable getTrueValue/getFalseValue.
2020-06-10 16:54:50 -07:00
HazemAbdelhafez 4b7aa6c8c1 [mlir][spirv] Enhance structure type member decoration handling
Modify structure type in SPIR-V dialect to support:
1) Multiple decorations per structure member
2) Key-value based decorations (e.g., MatrixStride)

This commit kept the Offset decoration separate from members'
decorations container for easier implementation and logical clarity.
As such, all references to Structure layoutinfo are now offsetinfo,
and any member layout defining decoration (e.g., RowMajor for Matrix)
will be add to the members' decorations container along with its
value if any.

Differential Revision: https://reviews.llvm.org/D81426
2020-06-10 19:25:03 -04:00
George Mitenkov d93d8fcdec [MLIR][SPIRVToLLVM] Implemented conversion for arithmetic ops and 3 bitwise ops.
Following the previous revision `D81100`, this commit implements a templated class
that would provide conversion patterns for “straightforward” SPIR-V ops into
LLVM dialect. Templating allows to abstract away from concrete implementation
for each specific op. Those are mainly binary operations. Currently supported
and tested ops are:
- Arithmetic ops: `IAdd`, `ISub`, `IMul`, `FAdd`, `FSub`, `FMul`, `FDiv`,  `FNegate`,
  `SDiv`, `SRem` and  `UDiv`
- Bitwise ops: `BitwiseAnd`, `BitwiseOr`, `BitwiseXor`

The implementation relies on `SPIRVToLLVMConversion` class that makes use of
`OpConversionPattern`.

Differential Revision: https://reviews.llvm.org/D81305
2020-06-10 19:10:31 -04:00
Hongtao Yu 2638aafe12 [LLD][ThinLTO] Add --thinlto-single-module to allow compiling partial modules.
This change introduces an LLD switch --thinlto-single-module to allow compiling only a part of the input modules. This is specifically enables:

  1. Fast investigating/debugging modules of interest without spending time on compiling unrelated modules.
  2. Compiler debug dump with -mllvm -debug-only= for specific modules.

It will be useful for large applications which has 1K+ input modules for thinLTO.

The switch can be combined with `--lto-obj-path=` or `--lto-emit-asm` to obtain intermediate object files or assembly files. So far the module name matching is implemented as a fuzzy name lookup where the modules with name containing the switch value are compiled.

E.g,
Command:
     ld.lld main.o thin.a --thinlto-single-module=thin.a --lto-obj-path=single.o
log:
     [ThinLTO] Selecting thin.a(thin1.o at 168) to compile
     [ThinLTO] Selecting thin.a(thin2.o at 228) to compile
Command:
     ld.lld main.o thin.a --thinlto-single-module=thin1.o --lto-obj-path=single.o
log:
     [ThinLTO] Selecting thin.a(thin1.o at 168) to compile

Differential Revision: https://reviews.llvm.org/D80406
2020-06-10 15:32:30 -07:00
Scott Constable 7e06cf0011 [X86] Add an Unoptimized Load Value Injection (LVI) Load Hardening Pass
@nikic raised an issue on D75936 that the added complexity to the O0 pipeline was causing noticeable slowdowns for `-O0` builds. This patch addresses the issue by adding a pass with equal security properties, but without any optimizations (and more importantly, without the need for expensive analysis dependencies).

Reviewers: nikic, craig.topper, mattdr

Reviewed By: craig.topper, mattdr

Differential Revision: https://reviews.llvm.org/D80964
2020-06-10 15:31:47 -07:00
Siva Chandra Reddy b622a255a3 [libc][Obvious] Use full path with cmake's if(EXISTS ...).
That if(EXISTS ...) works only with full paths was missed in couple of
places a in recent cleanup.
2020-06-10 15:08:00 -07:00
Jonas Devlieghere 351823fbf1 [lldb/Test] Add 'std-module' category and skip them with reproducers
These tests are flaky on the reproducer bot. I suspect it has something
to do with the module cache. Skipping the whole category while I
investigate the issue.
2020-06-10 14:59:05 -07:00
Alexander Belyaev 0f8d40f0d6 [mlir][linalg] Add a builder for `linalg.(indexed_)generic`.
Differential Revision: https://reviews.llvm.org/D81610
2020-06-10 23:52:41 +02:00
Craig Topper 1c3dd7bf37 [X86] Call LowerADDRSPACECAST directly from ReplaceNodeResults to avoid repeating identical code. NFC 2020-06-10 14:39:02 -07:00
Craig Topper 530fbbdbc4 [X86] Add a 32-bit version of mixed-ptr-sizes.ll to make sure we get code coverage on the ADDRSPACECAST handling in ReplaceNodeResults. NFC 2020-06-10 14:38:34 -07:00
Akira Hatanaka f466f0beda Disallow trivial_abi on a class if all copy and move constructors are
deleted

Instead of forcing the class to be passed in registers, which was what
r350920 did, issue a warning and inform the user that the attribute
cannot be used.

For more background, see this discussion:
http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20190128/259907.html

This fixes PR39683.

rdar://problem/47308221

Differential Revision: https://reviews.llvm.org/D57626
2020-06-10 14:12:13 -07:00
Adrian Prantl 661fcfcd8a debugserver: Enable -DLLDB_ENERGY when compiling against an internal SDK
This brings over functionality from the xcodeproject that went missing during the CMake transition.

rdar://problem/63840635

Differential Revision: https://reviews.llvm.org/D81300
2020-06-10 14:10:27 -07:00
Casey Carter 24836f8cd0 [libcxx][test] MSVC's __is_trivially_copyable is fixed in VS 16.7
... so we can disable `TEST_WORKAROUND_C1XX_BROKEN_IS_TRIVIALLY_COPYABLE`.
2020-06-10 13:55:33 -07:00
Leonard Chan 7201272d4c Revert "[clang] Frontend components for the relative vtables ABI"
This reverts commit 2e009dbcb3.

Reverting since there were some test failures on buildbots that used the
new pass manager. ASan and MSan are also finding some bugs in this that
I'll need to address.
2020-06-10 13:50:05 -07:00
Michael Spencer 1727c6aab3 [clang] Use IsVolatile=true and RequiresNullTerminator=false for PCMs
This change got missed while upstreaming
https://reviews.llvm.org/D77772. This is the part of that change that
actually passes the correct arguments when opening a PCM.

The test didn't catch this because it starts at the
`MemoryBuffer::getOpenFile` level. It's not really possible to test
`ModuleManager::addModule` itself to verify how the file was opened.
2020-06-10 14:37:30 -06:00
Louis Dionne 4e813bbdf3 [libc++] Make sure tests are run in a unique directory
This will allow simplifying executors by always just copying the whole
%T, and assuming that all file dependencies are contained in it.

Superseeds https://reviews.llvm.org/D78245, which tried to make %T unique
in Lit, but which encountered push back.
2020-06-10 16:19:10 -04:00
Stanislav Mekhanoshin 09d325b20c AMDGPU/GlobalISel: cmp/select method for insert element
Differential Revision: https://reviews.llvm.org/D80754
2020-06-10 13:12:54 -07:00
Mehdi Amini 51a822724d Register printer and context CL options with the toyc example
The tutorial refers to invoking toyc with '-mlir-print-debuginfo' but
it wasn't registered anymore.

Differential Revision: https://reviews.llvm.org/D81604
2020-06-10 19:59:40 +00:00
Leonard Chan 2e009dbcb3 [clang] Frontend components for the relative vtables ABI
This patch contains all of the clang changes from D72959.

- Generalize the relative vtables ABI such that it can be used by other targets.
- Add an enum VTableComponentLayout which controls whether components in the
  vtable should be pointers to other structs or relative offsets to those structs.
  Other ABIs can change this enum to restructure how components in the vtable
  are laid out/accessed.
- Add methods to ConstantInitBuilder for inserting relative offsets to a
  specified position in the aggregate being constructed.

See D72959 for background info.

Differential Revision: https://reviews.llvm.org/D77592
2020-06-10 12:48:10 -07:00
Craig Topper c5bbdea9e1 [X86] Enable masked GPR broadcasts to be formed even if the broadcast has more than one use.
This is a cheap instruction. It's better to repeat it than to do
two separate operations.

There are probably more cases like this, but this one was reported
as a regression in our internal benchmarking.
2020-06-10 12:42:44 -07:00
romanova-ekaterina 252892fea7 Fixed false ThinLTO cache misses problem (PR 45819).
We relied on the fact that the iterators walks through the elements of a
DenseSet in a deterministic order (which is not true). This caused
ThinLTO cache misses. This patch addresses this problem.
See PR 45819 for additional information
https://bugs.llvm.org/show_bug.cgi?id=45819

Differential Revision: https://reviews.llvm.org/D79772
2020-06-10 12:41:41 -07:00
serge-sans-paille 60fe25cb0c Fix dynamic probing scheme
If we probe *after* each static stack allocation, we need to probe *before* each
dynamic stack allocation. Provide a scheme to describe the possible scenario.

Thanks a lot to @jonpa for motivating this fix.

Differential Revision: https://reviews.llvm.org/D81067
2020-06-10 21:37:09 +02:00
Matt Arsenault 0671a4c508 RegAllocFast: Avoid unused method warning in release builds 2020-06-10 15:23:56 -04:00
Leonard Chan 2f6bb2a692 [clang][Attribute] Fix noderef attribute false-negatives
`noderef` was failing to trigger warnings in some cases related to c++ style
casting. This patch addresses them.

Differential Revision: https://reviews.llvm.org/D77836
2020-06-10 12:20:54 -07:00
Arthur Eubanks bf124017a2 [NFC] Rename variable to workaround old gcc bug
Summary:
gcc 5.1 is still supported according to
https://releases.llvm.org/10.0.0/docs/GettingStarted.html

We're hitting the following bug due to a variable created in the loop header being the same as a variable used in the loop header:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54430

Reviewers: hctim, pcc

Subscribers: #sanitizers

Tags: #sanitizers

Differential Revision: https://reviews.llvm.org/D81594
2020-06-10 12:14:53 -07:00
Michael Liao 6dd0580832 [hip] Fix the failed test case due to the additional backend phase. 2020-06-10 15:06:06 -04:00
Ayke van Laethem 1ba7809793
[AVR] Implement disassembly support for I/O instructions
The in, out, and sbi/cbi family of instructions seem to require a custom
decoder. I'm not exactly sure why and would prefer to convince TableGen
to provide the correct decoders for these, but I can't seem to convince
it to do so. They simply disassemble without any operands.

Differential Revision: https://reviews.llvm.org/D74049
2020-06-10 20:55:47 +02:00
Stanislav Mekhanoshin 6e1eee6034 [AMDGPU] Fixed promote alloca with ptr/int casts
There is an invalid cast produced when a pointee is a pointer
and the alloca type is cast to a pointer to int.

Differential Revision: https://reviews.llvm.org/D81606
2020-06-10 11:46:57 -07:00
Leonard Chan 6adc664b9d [llvm][ELF][AArch64] Handle R_AARCH64_PLT32 relocation
This patch allows for usage of the @PLT modifier in AArch64 assembly which
lowers to an R_AARCH64_PLT32 relocation. See D81184 for handling this
relocation in lld.

Differential Revision: https://reviews.llvm.org/D81446
2020-06-10 11:34:16 -07:00
Marco Elver 52cae05e08 [ASan][Test] Fix expected strings for globals test
The expected strings would previously not catch bugs when redzones were
added when they were not actually expected. Fix by adding "global "
before the type.
2020-06-10 20:26:24 +02:00
Siva Chandra 1f567b2c6f [libc] Add a simple linux aarch64 config.
Summary:
With this change, "ninja check-libc" on linux/aarch64 succeeds.

However, all entrypoints with machine dependent implementations
have been skipped. A good number of these skipped entrypoints can
be enabled once we have aarch64 syscall support available.

Reviewers: abrachet, asteinhauser

Differential Revision: https://reviews.llvm.org/D81533
2020-06-10 11:19:52 -07:00
Craig Topper 324e13668e [X86] Split imm handling out of selectMOV64Imm32 and add a separate isel pattern.
This makes the pattern available to global isel.
2020-06-10 11:12:36 -07:00
Siva Chandra c76a1d0fc0 [libc][NFC] Make cpu feature check tolerate non-x86 architectures.
The feature check should probably be enhanced for non-x86 architectures,
but this change shields them from x86 specific pieces until then.

This patch has been split out from https://reviews.llvm.org/D81533.
2020-06-10 11:11:04 -07:00
Michael Liao 8b6821a584 [hip] Fix device-only relocatable code compilation.
Summary:
- In HIP, just as the regular device-only compilation, the device-only
  relocatable code compilation should not involve offload bundle.
- In addition, that device-only relocatable code compilation should have
  the similar 3 steps, namely preprocessor, compile, and backend, to the
  regular code generation with `-emit-llvm`.

Reviewers: yaxunl, tra

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D81427
2020-06-10 14:10:41 -04:00
Saiyedul Islam 4022bc2a6c [OpenMP][AMDGCN] Support OpenMP offloading for AMDGCN architecture - Part 2
Summary:
New file include to support platform dependent grid constants. It will be
used by clang, libomptarget plugins, and deviceRTLs to access constant
values consistently and with fast access in the deviceRTLs.

Originally authored by Greg Rodgers (@gregrodgers).

Reviewers: arsenm, sameerds, jdoerfert, yaxunl, b-sumner, scchan, JonChesterfield

Reviewed By: arsenm

Subscribers: llvm-commits, pdhaliwal, jholewinski, jvesely, wdng, nhaehnle, guansong, kerbowa, sstefan1, cfe-commits, ronlieb, gregrodgers

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D80917
2020-06-10 18:09:59 +00:00
Marco Elver 0f04f10453 [ASan][Test] Split out global alias test
Some platforms do not support aliases. Split the test, and pass explicit
triple to avoid test failure.

Reviewed By: thakis

Tags: #clang

Differential Revision: https://reviews.llvm.org/D81591
2020-06-10 19:58:50 +02:00
Matt Arsenault 721f8f7530 AMDGPU: Stop using getSelectCC in division lowering
This was promoting booleans to i32 to perform a comparison against
them to feed to a select condition. Just use the booleans
directly. This produces the same final code, since the combiner is
unable to undo the mess this creates. I untangled this logic when I
ported this code to GlobalISel, so port the cleanups back.
2020-06-10 13:56:53 -04:00
Matt Arsenault 601b8a0dc9 GlobalISel: Move LegalizerHelper members around
MIRBuilder was in the middle of of a bunch of methods and not group
with the other member variables, which made it harder to see what
state this carries around. Move these to the top as is the usual
convention.
2020-06-10 13:56:53 -04:00
Heejin Ahn a5099ad918 [WebAssembly] Fix a warning for an unused variable
`ErasedUncondBr` is used only in an `assert`, so it triggers a warning
on builds without assertions. Fixed.
2020-06-10 10:06:28 -07:00
Christopher Tetreault 9044027e45 [SVE] Eliminate calls to default-false VectorType::get() from X86
Reviewers: efriedma, craig.topper, RKSimon, samparker, kmclaughlin, david-arm

Reviewed By: david-arm

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

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D81520
2020-06-10 09:56:00 -07:00
David Green 61ef2d27c4 [ARM] Update fp16-insert-extract.ll test checks. NFC 2020-06-10 17:50:27 +01:00
Zequan Wu e408cba84f [AST] Mangle LambdaContextDecl for top level decl
Summary:

Bug filed here: https://bugs.llvm.org/show_bug.cgi?id=45213

To resolve it, we let the checks for mangling LambdaContextDecl to be analogous to ItaniumMangle strategy: https://github.com/llvm/llvm-project/blob/master/clang/lib/AST/ItaniumMangle.cpp#L1829

Differential Revision: https://reviews.llvm.org/D80153
2020-06-10 09:44:09 -07:00
Joel E. Denny d9a42ec98a [libc++] Work around gcc/Power9 bug in `include/thread`
This fixes PR39696, which breaks the libcxx build with gcc (I tested
7.5.0) on Power9.  This fix was suggested at

https://bugs.llvm.org/show_bug.cgi?id=39696#c38

but never applied.  It just reverts 0583d9ea8d, which reverses
components of the original fix in 3bf63cf3b3, which is correct.

Fixes https://llvm.org/PR39696

Reviewed By: ldionne

Differential Revision: https://reviews.llvm.org/D81438
2020-06-10 12:40:43 -04:00
Joel E. Denny 4b1b09fcc0 [FileCheck] Add missing %ProtectFileCheckOutput to FileCheck tests
This is a continuation of D65121 (committed at f471eb8e99).
2020-06-10 12:40:35 -04:00
Eric Schweitz 8bba0bca72 [flang] Add the complex expression helper class.
The complex expression helper class can be used to generate small,
short-lived instances of a "helper" that can be used to aid the
construction of complex expressions in FIR. The helper class bundles
together these functionally related operations.

Included in this diff is the header for the FIR builder. The
implementation has other dependences and will follow.

Differential Revision: https://reviews.llvm.org/D81287
2020-06-10 09:05:20 -07:00
Mehdi Amini 83d920c72a Fix MLIR test: -dump-input-on-failure is no longer a valid option 2020-06-10 15:58:58 +00:00