Commit Graph

392715 Commits

Author SHA1 Message Date
LLVM GN Syncbot 94ff00f988 [gn build] Port 99f00635d7 2021-07-02 17:03:49 +00:00
Joachim Meyer 75e941b05c [NFC][OpenMP][CUDA] Add test for using `-x cuda -fopenmp`
This adds a very basic test in `cuda_with_openmp.cu` that just checks whether the CUDA & OpenMP integrated headers do compile, when a CUDA file is compiled with OpenMP (CPU) enabled.
Thus this basically adds the missing test for https://reviews.llvm.org/D90415.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D105322
2021-07-02 19:03:15 +02:00
Jacob Hegna 99f00635d7 Unpack the CostEstimate feature in ML inlining models.
This change yields an additional 2% size reduction on an internal search
binary, and an additional 0.5% size reduction on fuchsia.

Differential Revision: https://reviews.llvm.org/D104751
2021-07-02 16:57:16 +00:00
Siva Chandra Reddy dba74c6817 [libc] Make ULP error reflect the bit distance more closely.
Reviewed By: lntue

Differential Revision: https://reviews.llvm.org/D105334
2021-07-02 16:56:01 +00:00
Marco Vanotti c5d725172d Revert "Refactor mutation strategies into a standalone library"
This reverts commit 361f742f16.
2021-07-02 09:45:11 -07:00
Nicolas Vasilache db188adfb1 [mlir][Vector] NFC - Compress vector to outerproduct lowering.
The implementation has become too unwieldy and cognitive overhead wins.
Instead compress the implementation in preparation for additional lowering paths.

Differential Revision: https://reviews.llvm.org/D105359
2021-07-02 16:41:51 +00:00
Atmn Patel 21e92612c0 [Libomptarget] Experimental Remote Plugin Fixes
D97883 introduced a compile-time error in the experimental remote offloading
libomptarget plugin, this patch fixes it and resolves a number of
inconsistencies in the plugin as well:

1. Non-functional Asynchronous API
2. Unnecessarily verbose debug printing
3. Misc. code clean ups

This is not intended to make any functional changes to the plugin.

Differential Revision: https://reviews.llvm.org/D105325
2021-07-02 12:38:34 -04:00
Tobias Gysi f239026f89 [mlir][linalg][python] Add min operation in OpDSL.
Add the min operation to OpDSL and introduce a min pooling operation to test the implementation. The patch is a sibling of the max operation patch https://reviews.llvm.org/D105203 and the min operation is again lowered to a compare and select pair.

Differential Revision: https://reviews.llvm.org/D105345
2021-07-02 16:27:30 +00:00
Geoffrey Martin-Noble 7c5d654f64 [Bazel] Fix build for c0a6318d96
This adds explicit deps to satisfy layering_check

Differential Revision: https://reviews.llvm.org/D105356
2021-07-02 09:22:33 -07:00
Aaron Green 361f742f16 Refactor mutation strategies into a standalone library
This change introduces libMutagen/libclang_rt.mutagen.a as a subset of libFuzzer/libclang_rt.fuzzer.a. This library contains only the fuzzing strategies used by libFuzzer to produce new test inputs from provided inputs, dictionaries, and SanitizerCoverage feedback.

Most of this change is simply moving sections of code to one side or the other of the library boundary. The only meaningful new code is:

* The Mutagen.h interface and its implementation in Mutagen.cpp.
* The following methods in MutagenDispatcher.cpp:
  * UseCmp
  * UseMemmem
  * SetCustomMutator
  * SetCustomCrossOver
  * LateInitialize (similar to the MutationDispatcher's original constructor)
  * Mutate_AddWordFromTORC (uses callbacks instead of accessing TPC directly)
  * StartMutationSequence
  * MutationSequence
  * DictionaryEntrySequence
  * RecommendDictionary
  * RecommendDictionaryEntry
* FuzzerMutate.cpp (which now justs sets callbacks and handles printing)
* MutagenUnittest.cpp (which adds tests of Mutagen.h)

A note on performance: This change was tested with a 100 passes of test/fuzzer/LargeTest.cpp with 1000 runs per pass, both with and without the change. The running time distribution was qualitatively similar both with and without the change, and the average difference was within 30 microseconds (2.240 ms/run vs 2.212 ms/run, respectively). Both times were much higher than observed with the fully optimized system clang (~0.38 ms/run), most likely due to the combination of CMake "dev mode" settings (e.g. CMAKE_BUILD_TYPE="Debug", LLVM_ENABLE_LTO=OFF, etc.). The difference between the two versions built similarly seems to be "in the noise" and suggests no meaningful performance degradation.

Reviewed By: morehouse

Differential Revision: https://reviews.llvm.org/D102447
2021-07-02 09:20:23 -07:00
LLVM GN Syncbot 25473d7b08 [gn build] Port bf64210fd8 2021-07-02 16:12:54 +00:00
Jinsong Ji 03e9dcfd41 [AIX] Use AsmParser to do inline asm parsing
Add a flag so that target can choose to use AsmParser for parsing inline asm.
And set the flag by default for AIX.

-no-intergrated-as will override this default if specified explicitly.

Reviewed By: #powerpc, shchenz

Differential Revision: https://reviews.llvm.org/D105314
2021-07-02 16:12:21 +00:00
Jinsong Ji bf64210fd8 [AIX] Add dummy XCOFF MCAsmParserExtension
Implement XCOFFMCAsmParser so that we can use MC to parse inline asm.

The directives and storage mapping classes will be added later
iteratively.

Reviewed By: xgupta

Differential Revision: https://reviews.llvm.org/D105259
2021-07-02 16:12:21 +00:00
David Green 78309ebef4 [AArch64] Neon saturated truncate tests. NFC 2021-07-02 17:03:49 +01:00
Gus Smith 4569c14ac3 Refactor TensorExp parameters into a union
To make TensorExp clearer, this change refactors the e0/e1 fields into a union: e0/e1 for a binary op tensor expression, and tensor_num for a tensor-kinded tensor expression.

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D105303
2021-07-02 14:45:56 +00:00
Sam McCall e42bb5e35a Reapply [clangd] Fix possible assertion fail in TUScheduler
This reverts commit fff966b685.

Seems I managed to delete a critical ! after running the tests :-\
2021-07-02 16:32:13 +02:00
Roman Lebedev 13e35ac124
[NFC][InstCombine] visitUnreachableInst(): enhance comments somewhat 2021-07-02 17:30:01 +03:00
Sam McCall 33ff8078ff Revert "[clangd] Unbreak mac build differently 0c96a92d8666b8"
This reverts commit 2f79acb7b7.

Should no longer be needed after 26e1553a10
2021-07-02 16:29:48 +02:00
Nicolas Vasilache ad0050c607 [mlir][Linalg] Add comprehensive bufferization support for TiledLoopOp (14/n)
Differential Revision: https://reviews.llvm.org/D105335
2021-07-02 14:21:08 +00:00
Roman Lebedev dadedc99e9
[InstCombine] visitUnreachableInst(): iteratively erase instructions leading to unreachable
In the original review D87149 it was mentioned that this approach was tried,
and it lead to infinite combine loops, but i'm not seeing anything like that now,
neither in the `check-llvm`, nor on some codebases i tried.

This is a recommit of d9d65527c2,
which i immediately reverted because i have messed up something
during branch switch, and 597ccc92ce
accidentally ended up being pushed, which was very much not the intention.

Reviewed By: spatel

Differential Revision: https://reviews.llvm.org/D105339
2021-07-02 17:20:21 +03:00
Roman Lebedev 24d271bb18
Revert "https://godbolt.org/z/5vhv4K5b8"
This reverts commit 597ccc92ce.
2021-07-02 17:17:55 +03:00
Roman Lebedev 93a1642763
Revert "[NFCI][InstCombine] visitUnreachableInst(): iteratively erase instructions leading to unreachable"
This reverts commit d9d65527c2.
2021-07-02 17:17:47 +03:00
Roman Lebedev d9d65527c2
[NFCI][InstCombine] visitUnreachableInst(): iteratively erase instructions leading to unreachable
In the original review D87149 it was mentioned that this approach was tried,
and it lead to infinite combine loops, but i'm not seeing anything like that now,
neither in the `check-llvm`, nor on some codebases i tried.

Reviewed By: spatel

Differential Revision: https://reviews.llvm.org/D105339
2021-07-02 17:17:03 +03:00
Roman Lebedev 597ccc92ce
https://godbolt.org/z/5vhv4K5b8 2021-07-02 17:16:19 +03:00
Sam McCall fff966b685 Revert "[clangd] Fix possible assertion fail in TUScheduler"
This reverts commit 50566947e9.
2021-07-02 16:07:11 +02:00
Sam McCall 50566947e9 [clangd] Fix possible assertion fail in TUScheduler
BlockUntilIdle is supposed to return false if it fails.
If an intermediate step fails to clear the queue, we shouldn't
charge ahead and assert on the state of the queue.
2021-07-02 15:57:39 +02:00
Nico Weber 7a2c1acd5f [llvm-dwarfdump] Add comment saying where DumpDebugFrame comes from 2021-07-02 09:56:21 -04:00
Simon Pilgrim e5fdff1cf8 [X86][SLM] Keep similar scheduler costs types together. NFCI.
The SLM model is inconsistent about where it kept its 'unsupported' schedule classes - better to keep them close to similar classes.

I'm not sure why some ymm classes are defined and others are unsupported though (but I haven't altered them) - the only SLM-like CPU supporting any ymm is KNL and that currently uses the HSW model.
2021-07-02 14:50:24 +01:00
Simon Pilgrim d867634fbd [CostModel][X86] Update comment describing source of costs - we now use llvm-mca more than IACA 2021-07-02 14:29:32 +01:00
Simon Pilgrim d181fd918d [CostModel][X86] Drop some hard coded fp<->int scalarization costs
Scalarization costs handling is a lot better now, and the hard coded costs were higher than the worse case numbers from the script in D103695
2021-07-02 14:29:32 +01:00
LLVM GN Syncbot 5df556ac8b [gn build] Port a92964779c 2021-07-02 13:05:44 +00:00
Nico Weber a92964779c Revert "[InstrProfiling] Use external weak reference for bias variable"
This reverts commit 33a7b4d9d8.
Breaks check-profile on macOS, see comments on https://reviews.llvm.org/D105176
2021-07-02 09:05:12 -04:00
Florian Hahn a3ca578eb9
[Matrix] Fix crash during fusion if the same load is re-used.
This patch fixes a crash when the same load is used for both operands of
a fuseable multiply.
2021-07-02 14:00:17 +01:00
Simon Pilgrim 2aecffcd40 [CostModel][X86] Find AVX conversion costs using legalized types if custom types didn't match
Building on rG2a1ef8784ad9a, fallback to attempting to match against legalized types like we do for SSE targets.
2021-07-02 13:49:31 +01:00
Michał Górny 02ef0f5ab4 [lldb] [gdb-remote client] Refactor SetCurrentThread*()
Refactor SetCurrentThread() and SetCurrentThreadForRun() to reduce code
duplication and simplify it.  Both methods now call common
SendSetCurrentThreadPacket() that implements the common protocol
exchange part (the only variable is sending `Hg` vs `Hc`) and returns
the selected TID.  The logic is rewritten to use a StreamString
instead of snprintf().

A side effect of the change is that thread-id sent is now zero-padded.
However, this should not have practical impact on the server as both
forms are equivalent.

Differential Revision: https://reviews.llvm.org/D100459
2021-07-02 14:36:17 +02:00
Simon Pilgrim cdca1785d3 [CostModel][X86] Adjust uitofp(vXi64) SSE/AVX legalized costs based on llvm-mca reports.
Update v4i64 -> v4f32/v4f64 uitofp costs based on the worst case costs from the script in D103695.

Fixes a few regressions before we start adding AVX costs for legalized types.
2021-07-02 13:09:00 +01:00
Alexey Bataev 28ac873bcb [SLP]Fix gathering of the scalars by not ignoring UndefValues.
The compiler should not ignore UndefValue when gathering the scalars,
otherwise the resulting code may be less defined than the original one.
Also, grouped scalars to insert them at first to reduce the analysis in
further passes.

Differential Revision: https://reviews.llvm.org/D105275
2021-07-02 04:46:48 -07:00
Alexandru Octavian Butiu e90c6f5596 [MachineCopyPropagation] Fix differences in code gen when compiling with -g
Fixes bugs [[ https://bugs.llvm.org/show_bug.cgi?id=50580 | 50580 ]] and [[ https://bugs.llvm.org/show_bug.cgi?id=49446 | 49446  ]]

When compiling with -g "DBG_VALUE <reg>"  instructions are added in the MIR, if such a instruction is inserted between instructions that use <reg> then MachineCopyPropagation invalidates <reg> , this causes some copies  to not be propagated and causes differences in code generation (ex bugs 50580 and 49446 ).  DBG_VALUE instructions should be ignored  since they don't actually modify the register.

Reviewed By: lkail

Differential Revision: https://reviews.llvm.org/D104394
2021-07-02 19:27:06 +08:00
Alex Richardson c142c06c19 Place the BlockAddress type in the address space of the containing function
While this should not matter for most architectures (where the program
address space is 0), it is important for CHERI (and therefore Arm Morello).
We use address space 200 for all of our code pointers and without this
change we assert in the SelectionDAG handling of BlockAddress nodes.

It is also useful for AVR: previously programs targeting
AVR that attempt to read their own machine code
via a pointer to a label would instead read from RAM
using a pointer relative to the the start of program flash.

Reviewed By: dylanmckay, theraven
Differential Revision: https://reviews.llvm.org/D48803
2021-07-02 12:17:55 +01:00
Adrian Kuegel 791ddb79f1 Add LogOp to Complex dialect.
Differential Revision: https://reviews.llvm.org/D105337
2021-07-02 13:15:47 +02:00
Sven van Haastregt b77b2201dc [NFC] Fix typo in comment
Reported-by: Marco Cali <marco.cali@arm.com>
2021-07-02 11:39:17 +01:00
Florian Hahn 1a248233a5
[AArch64] Use custom lowering for fp16 vector copysign.
The custom copysign lowering already supports fp16. Use it.

Reviewed By: dmgreen

Differential Revision: https://reviews.llvm.org/D105277
2021-07-02 11:15:30 +01:00
Roman Lebedev 48db080383
[NFC][SimplifyCFG] Autogenerate checklines in trapping-load-unreachable.ll test 2021-07-02 12:59:14 +03:00
Michał Górny 4d2503cd54 [lldb] [test] Add missing category to test_detach_current 2021-07-02 11:44:41 +02:00
Florian Hahn 7655061cc6
[Matrix] Hoist address computation before multiply to enable fusion.
If the store address does not dominate the matrix multiply, try to hoist
address computation instructions without side-effects and/or memory
reads before the multiply, to allow fusion.

Reviewed By: thegameg

Differential Revision: https://reviews.llvm.org/D105193
2021-07-02 09:52:11 +01:00
Roman Lebedev c2c0d3ea89
Revert "[WebAssembly] Implementation of global.get/set for reftypes in LLVM IR"
This reverts commit 4facbf213c.

```
********************
FAIL: LLVM :: CodeGen/WebAssembly/funcref-call.ll (44466 of 44468)
******************** TEST 'LLVM :: CodeGen/WebAssembly/funcref-call.ll' FAILED ********************
Script:
--
: 'RUN: at line 1';   /builddirs/llvm-project/build-Clang12/bin/llc < /repositories/llvm-project/llvm/test/CodeGen/WebAssembly/funcref-call.ll --mtriple=wasm32-unknown-unknown -asm-verbose=false -mattr=+reference-types | /builddirs/llvm-project/build-Clang12/bin/FileCheck /repositories/llvm-project/llvm/test/CodeGen/WebAssembly/funcref-call.ll
--
Exit Code: 2

Command Output (stderr):
--
llc: /repositories/llvm-project/llvm/include/llvm/Support/LowLevelTypeImpl.h:44: static llvm::LLT llvm::LLT::scalar(unsigned int): Assertion `SizeInBits > 0 && "invalid scalar size"' failed.

```
2021-07-02 11:49:51 +03:00
Michał Górny b7c140335b [lldb] [gdb-remote server] Support selecting process via Hg
Support using the extended thread-id syntax with Hg packet to select
a subprocess.  This makes it possible to start providing support for
running some of the debugger packets against another subprocesses.

Differential Revision: https://reviews.llvm.org/D100261
2021-07-02 10:23:11 +02:00
Balázs Kéri a27a17f883 [clang][AST] Add support for BindingDecl to ASTImporter.
Reviewed By: martong

Differential Revision: https://reviews.llvm.org/D102492
2021-07-02 10:14:50 +02:00
Sam McCall 26e1553a10 [clangd] CMake: express -Iclangd/ at top level and inherit
For files directly under clangd/, -Iclang-tools-extra/clangd (and the
equivalent for generated files) are not required, as CMake/the compiler puts
these directories on the include path by default.

However this means each subdirectory needs to
include_directories(.. ${CMAKE_CURRENT_BINARY_DIR}/..) etc, and this
proved annoying and error-prone to maintain and debug.

Since include_directories is inherited by subdirectories, we just
configure this explicitly at the top level instead.
2021-07-02 09:52:36 +02:00
Paulo Matos 4facbf213c [WebAssembly] Implementation of global.get/set for reftypes in LLVM IR
Reland of 31859f896.

This change implements new DAG notes GLOBAL_GET/GLOBAL_SET, and
lowering methods for load and stores of reference types from IR
globals. Once the lowering creates the new nodes, tablegen pattern
matches those and converts them to Wasm global.get/set.

Differential Revision: https://reviews.llvm.org/D104797
2021-07-02 09:46:28 +02:00