Commit Graph

392638 Commits

Author SHA1 Message Date
Arnold Schwaighofer 4a361f5209 [coro async] Add support for specifying which parameter is swiftself in
async resume functions

Differential Revision: https://reviews.llvm.org/D104147
2021-07-01 07:33:15 -07:00
Sjoerd Meijer 513ad68315 [AArch64] Add some more tests to CodeGen/AArch64/aarch64-load-ext.ll. NFC. 2021-07-01 15:15:21 +01:00
Sam Tebbs 24d76419d6 [ARM] Transform a floating-point to fixed-point conversion to a VCVT_fix
Much like fixed-point to floating-point conversion, the converse can
also be transformed into a fixed-point VCVT. This patch transforms
multiplications of floating point numbers by 2^n into a VCVT_fix. The
exception is that a float to fixed conversion with 1 fractional bit
ends up being an FADD (FADD(x, x) emulates FMUL(x, 2)) rather than an FMUL so there is a special case for that. This patch also moves the code from https://reviews.llvm.org/D103903 into a separate function as fixed to float and float to fixed are very similar.

Differential Revision: https://reviews.llvm.org/D104793
2021-07-01 15:10:40 +01:00
Louis Dionne c475efe916 [libc++] Fix incorrect shell expansion in macos-ci-setup 2021-07-01 10:09:20 -04:00
Alexey Bataev d93ca4d27e Revert "[OPENMP]Fix PR50640: OpenMP target clause implicitly scaling loop bounds to uint64_t."
This reverts commit 67643f46ee to fix
unexpected diagnostic notes.
2021-07-01 06:40:19 -07:00
David Sherwood 51b4ab26ca [NFC] Add new setDebugLocFromInst that uses the class Builder by default
In lots of places we were calling setDebugLocFromInst and passing
in the same Builder member variable found in InnerLoopVectorizer.
I personally found this confusing so I've changed the interface
to take an Optional<IRBuilder<> *> and we can now pass in None
when we want to use the class member variable.

Differential Revision: https://reviews.llvm.org/D105100
2021-07-01 14:23:34 +01:00
Alexey Bataev 67643f46ee [OPENMP]Fix PR50640: OpenMP target clause implicitly scaling loop bounds to uint64_t.
Need to add some conversions to suppress possible warning messages.

Differential Revision: https://reviews.llvm.org/D105187
2021-07-01 05:59:49 -07:00
Andrzej Warzynski e77191c35e [flang][driver] Extend the `flang` bash script to act as a driver
Until now, `f18` would:
  1. Use Flang to unparse the input files
  2. Call an external Fortran compiler to compile the unparsed source
  files (generated in step 1)

With this patch, `f18` will stop after unparsing the input source files,
i.e. step 1 above. The `flang` bash script will take care of step 2,
i.e. calling an external Fortran compiler driver to compile them. This
way:
  * the functionality of `f18` is reduced - it will only drive Flang (as
  opposed to delegating code-generation to an external tool on top of
  this)
  * we will able to switch between `f18` and `flang-new` for unparsing before
  an external Fortran compiler is called for code-generation

The updated `flang` bash script needs to specify the output file when
using the `-fdebug-unparse` action. Both `f18` and `flang-new` have been
updated accordingly.

These changes were discussed in [1] as a requirement for replacing `f18`
with `flang-new`.

[1] https://lists.llvm.org/pipermail/flang-dev/2021-April/000677.html

Differential Revision: https://reviews.llvm.org/D103177
2021-07-01 13:56:38 +01:00
Florian Hahn b122ff71f3
[AArch64] Add fp16 tests for vector copysign.
Add additional fp16 vector tests for copysign, to show improvements in
follow-up patch.
2021-07-01 13:54:06 +01:00
Haojian Wu 314e456dfe [clang] Fix CallExpr dependence bit may not respect all its arguments.
Before this patch, the dependence of CallExpr was only computed in the
constructor, the dependence bits might not reflect truth -- some arguments might
be not set (nullptr) during this time, e.g. CXXDefaultArgExpr will be set via
the setArg method in the later parsing stage, so we need to recompute the
dependence bits.
2021-07-01 14:40:03 +02:00
Irina Dobrescu cf76569f6a [AArch64] Add test for min/max
Differential Revision: https://reviews.llvm.org/D104447
2021-07-01 13:22:51 +01:00
Jeremy Morse e9641c911e [DebugInfo][InstrRef][2/4] Use subreg substitutions in LiveDebugValues
Added in 47c3fe2a22, we sometimes need to describe a variable value
substitution with a subregister qualifier, to say that "the value is the
lower 32 bits of this 64 bit register def" for example. That then needs
support during LiveDebugValues to interpret the subregister qualifiers,
which is what this patch adds.

Whenever we encounter a DBG_INSTR_REF and find its value by using a
substitution, collect any subregister qualifiers seen. Then, accumulate the
effects of the qualifiers to work out what offset and what size should be
extracted from the defined register. Finally, for the target ValueIDNum,
extract whatever subregister is in the correct position

Currently, describing a subregister field of a larger value that has been
spilt to the stack, is unimplemented.

Differential Revision: https://reviews.llvm.org/D88894
2021-07-01 13:07:16 +01:00
Marcos Horro aa13e4fe7e [llvm-mca] Fix JSON output (PR50922)
Based on the discussion in PR50922, minor changes have been done to properly
output a valid JSON.  Removed "not implemented" keys.

Differential Revision: https://reviews.llvm.org/D105064
2021-07-01 12:53:20 +01:00
Jon Chesterfield db89414da4 [libomptarget][nfc] Move grid size computation
Change getLaunchVals to return the integers used for launch

Reviewed By: pdhaliwal

Differential Revision: https://reviews.llvm.org/D105237
2021-07-01 12:53:04 +01:00
Nicolas Vasilache ed1681ed3a [mlir][Linalg] Add comprehensive bufferization support for ConstantOp (13/n)
ConstantOp are only supported in the ModulePass because they require a GlobalCreator object that must be constructed from a ModuleOp.
If the standlaone FunctionPass encounters a ConstantOp, bufferization fails.

Differential revision: https://reviews.llvm.org/D105156
2021-07-01 11:42:27 +00:00
Nicolas Vasilache 55c274d7d3 [mlir][Linalg] Drop comprehensive-func-bufferize (12/n)
This revision drops the comprehensive bufferization Function pass, which has issues when trying to bufferize constants.
Instead, only support the comprehensive-module-bufferize by default.

Differential Revision: https://reviews.llvm.org/D105228
2021-07-01 11:36:24 +00:00
Hussain Kadhem d21a35ac0a [VP] Implementation of intrinsic and SDNode definitions for VP load, store, gather, scatter.
This patch adds intrinsic definitions and SDNodes for predicated
load/store/gather/scatter, based on the work done in D57504.

Reviewed By: simoll, craig.topper

Differential Revision: https://reviews.llvm.org/D99355
2021-07-01 13:34:44 +02:00
Nicolas Vasilache 231b9dd9de [mlir][Linalg] Add comprehensive bufferization support for linalg::InitTensor and tensor::CastOp (11/n)
Also add an integration test that connects all the dots end to end, including with cast to unranked tensor for external library calls.

Differential Revision: https://reviews.llvm.org/D105106
2021-07-01 11:26:01 +00:00
Bradley Smith 01b846674d [AArch64][SVE] Add support for fixed length MSCATTER/MGATHER
Since gather lowering can now lower to nodes that may need expansion via
the vector legalizer, do MGATHER lowering via vector legalizer.

Additionally, as part of adding passthru support for fixed typed
gathers, fix passthru support for scalable types.

Depends on D104910

Differential Revision: https://reviews.llvm.org/D104217
2021-07-01 12:13:59 +01:00
David Spickett 65722561df [llvm][docs] Bump release number from 12 -> 13
This seems to have been forgotten. The result was the title
of pages like https://llvm.org/docs/ReleaseNotes.html

Was:
<title>LLVM 13.0.0 Release Notes &#8212; LLVM 12 documentation</title>

Reviewed By: tstellar

Differential Revision: https://reviews.llvm.org/D105189
2021-07-01 11:07:03 +00:00
Simon Pilgrim 2a1ef8784a [CostModel][X86] getCastInstrCost - attempt to match custom cast/conversion before legalized types.
Move the (SSE-only) generic, legalized type conversion matching after the specific,custom conversion cases, allowing us to properly provide cost overrides.

The next step will be to clean up some of the weird existing costs and then to enable AVX+ legalized costs, which will let us strip out a lot of the cost tables entries.
2021-07-01 12:06:40 +01:00
Nicolas Vasilache 73bea97a33 [mlir][Linalg] Add support for CallOp bufferization (10/n)
Cross function boundary bufferization support is added.
This is enabled by cross-function boundary alias analysis, for which the bufferization process is extended: it can now modify the BufferizationAliasInfo as new ops are introduced.

A number of simplifying assumptions are made:

1. by default we bufferize to the most dynamic strided memref type, further memref::CastOp canonicalizations are expected to clean up the IR.
2. in the current implementation, the stride information is always erased at function boundaries. A subsequent pass will be required to analyze the meet of all call ops to a function and decide whether more static buffer types can be used. This will potentially clone functions when it is deemed profitable to do so (e.g. when the stride-1 dimension may vary).
3. external function always bufferize to the most dynamic strided memref version. This may require special annotations for specifying that particular operands of top-level functions have contiguous buffer layout.

An alternative to point 3. would be to support tensor layout annotations, which is currently not supported in MLIR.

Differential revision: https://reviews.llvm.org/D104873
2021-07-01 10:33:12 +00:00
Benjamin Kramer ce857d3cfd [mlir][async] Remove unused variable. NFC. 2021-07-01 12:24:55 +02:00
Jeremy Morse 47c3fe2a22 [DebugInfo][InstrRef][1/4] Support transformations that widen values
Very late in compilation, backends like X86 will perform optimisations like
this:

    $cx = MOV16rm $rax, ...
    ->
    $rcx = MOV64rm $rax, ...

Widening the load from 16 bits to 64 bits. SEeing how the lower 16 bits
remain the same, this doesn't affect execution. However, any debug
instruction reference to the defined operand now refers to a 64 bit value,
nto a 16 bit one, which might be unexpected. Elsewhere in codegen, there's
often this pattern:

    CALL64pcrel32 @foo, implicit-def $rax
    %0:gr64 = COPY $rax
    %1:gr32 = COPY %0.sub_32bit

Where we want to refer to the definition of $eax by the call, but don't
want to refer the copies (they don't define values in the way
LiveDebugValues sees it). To solve this, add a subregister field to the
existing "substitutions" facility, so that we can describe a field within
a larger value definition. I would imagine that this would be used most
often when a value is widened, and we need to refer to the original,
narrower definition.

Differential Revision: https://reviews.llvm.org/D88891
2021-07-01 11:19:27 +01:00
Matheus Izvekov 7d2d5a3a6d [clang] Apply P1825 as Defect Report from C++11 up to C++20.
This extends the effects of [[ http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1825r0.html | P1825 ]] to all C++ standards from C++11 up to C++20.

According to Motion 23 from Cologne 2019, P1825R0 was accepted as a Defect Report, so we retroactively apply this all the way back to C++11.

Note that we also remove implicit moves from C++98 as an extension
altogether, since the expanded first overload resolution from P1825
can cause some meaning changes in C++98.
For example it can change which copy constructor is picked when both const
and non-const ones are available.

This also rips out warn_return_std_move since there are no cases where it would be worthwhile to suggest it.

This also fixes a bug with bailing into the second overload resolution
when encountering a non-rvref qualified conversion operator.
This was unnoticed until now, so two new test cases cover these.

Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>

Reviewed By: rsmith

Differential Revision: https://reviews.llvm.org/D104500
2021-07-01 12:10:06 +02:00
Christian Kühnel cd8f979fe4 added some example code for llvm::Expected<T>
Since I had some fun understanding how to properly use llvm::Expected<T> I added some code examples that I would have liked to see when learning to use it.

Reviewed By: sammccall

Differential Revision: https://reviews.llvm.org/D105014
2021-07-01 09:57:20 +00:00
mydeveloperday f9937106b7 [clang-format] PR50727 C# Invoke Lamda Expression indentation incorrect
https://bugs.llvm.org/show_bug.cgi?id=50727

When processing C# Lambda expression in the indentation can goes a little wrong,
resulting the the closing } being at the wrong indentation level and meaning the remaining part of the file is
incorrectly indented.

This can be a fairly common pattern for when C# wants to peform a UI action from a thread,
and it wants to invoke that action on the main thread

Reviewed By: exv, jbcoe

Differential Revision: https://reviews.llvm.org/D104388
2021-07-01 10:46:43 +01:00
Chen Zheng c32186038d [PowerPC] add a testcase for byval parameter; NFC 2021-07-01 09:42:12 +00:00
Florian Hahn dc4299a7f3
[BasicAA] Fix typo ScaleForGDC -> ScaleForGCD. 2021-07-01 09:58:38 +01:00
Balazs Benics 55662b24a4 [analyzer][NFC] Inline ExprEngine::handleLVectorSplat()
It seems like ExprEngine::handleLVectorSplat() was used at only 2
places. It might be better to directly inline them for readability.

It seems like these cases were not covered by tests according to my
coverage measurement, so I'm adding tests as well, demonstrating that no
behavior changed.
Besides that, I'm handling CK_MatrixCast similarly to how the rest of
the unhandled casts are evaluated.

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

Reviewed by: NoQ
2021-07-01 10:54:28 +02:00
Balazs Benics aa454dda2e [analyzer] LValueToRValueBitCasts should evaluate to an r-value
Previously `LValueToRValueBitCast`s were modeled in the same way how
a regular `BitCast` was. However, this should not produce an l-value.
Modeling bitcasts accurately is tricky, so it's probably better to
model this expression by binding a fresh conjured value.

The following code should not result in a diagnostic:
```lang=C++
  __attribute__((always_inline))
  static inline constexpr unsigned int_castf32_u32(float __A) {
    return __builtin_bit_cast(unsigned int, __A); // no-warning
  }
```

Previously, it reported
`Address of stack memory associated with local variable '__A' returned
to caller [core.StackAddressEscape]`.

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

Reviewed by: NoQ, vsavchenko
2021-07-01 10:54:22 +02:00
LLVM GN Syncbot 820ced1362 [gn build] Port 39f64c4c83 2021-07-01 08:31:00 +00:00
Andrzej Warzynski c1f068b8f1 [flang] Revert "PoC for Flang Driver Plugins"
This patch has not been reviewed and was commited by accident.

This reverts commit 788a5d4afe.
2021-07-01 08:27:31 +00:00
Lang Hames 39f64c4c83 [ORC] Add wrapper-function support methods to ExecutorProcessControl.
Adds support for both synchronous and asynchronous calls to wrapper functions
using SPS (Simple Packed Serialization). Also adds support for wrapping
functions on the JIT side in SPS-based wrappers that can be called from the
executor.

These new methods simplify calls between the JIT and Executor, and will be used
in upcoming ORC runtime patches to enable communication between ORC and the
runtime.
2021-07-01 18:21:49 +10:00
Andrzej Warzynski ea3698ded3 [flang][docs] Add documentation for the new Flang driver
Differential Revision: https://reviews.llvm.org/D104229
2021-07-01 08:14:54 +00:00
Stuart Ellis 788a5d4afe PoC for Flang Driver Plugins 2021-07-01 08:10:40 +00:00
Tobias Gysi 226f925c3f [mlir][linalg][python] Update integration of OpDSL doc (NFC).
Move the OpDSL doc to a linalg sub folder and updated the integration in the main linalg documentation.

Differential Revision: https://reviews.llvm.org/D105188
2021-07-01 07:41:32 +00:00
Sam McCall 0e2d4bd4bf [clangd] Fix gRPC build due to missing include path 2021-07-01 09:33:29 +02:00
Fabian Schuiki 8066f22c46
[MLIR] Add argument insertion helpers for FunctionLike
Add helpers to facilitate adding arguments and results to operations
that implement the `FunctionLike` trait. These operations already have a
convenient argument and result *erasure* mechanism, but a corresopnding
utility for insertion is missing. This introduces such a utility.
2021-07-01 09:18:57 +02:00
Jan Kratochvil e825c244b6 [lldb] Fix Recognizer/assert.test with glibc-2.33.9000-31.fc35.x86_64
While on regular Linux system (Fedora 34 GA, not updated):

* thread #1, name = '1', stop reason = hit program assert
    frame #0: 0x00007ffff7e242a2 libc.so.6`raise + 322
    frame #1: 0x00007ffff7e0d8a4 libc.so.6`abort + 278
    frame #2: 0x00007ffff7e0d789 libc.so.6`__assert_fail_base.cold + 15
    frame #3: 0x00007ffff7e1ca16 libc.so.6`__assert_fail + 70
  * frame #4: 0x00000000004011bd 1`main at assert.c:7:3

On Fedora 35 pre-release one gets:

* thread #1, name = '1', stop reason = signal SIGABRT
  * frame #0: 0x00007ffff7e48ee3 libc.so.6`pthread_kill@GLIBC_2.2.5 + 67
    frame #1: 0x00007ffff7dfb986 libc.so.6`raise + 22
    frame #2: 0x00007ffff7de5806 libc.so.6`abort + 230
    frame #3: 0x00007ffff7de571b libc.so.6`__assert_fail_base.cold + 15
    frame #4: 0x00007ffff7df4646 libc.so.6`__assert_fail + 70
    frame #5: 0x00000000004011bd 1`main at assert.c:7:3

I did not write a testcase as one needs the specific glibc. An
artificial test would just copy the changed source.

Reviewed By: mib

Differential Revision: https://reviews.llvm.org/D105133
2021-07-01 09:16:07 +02:00
Roman Lebedev 333d3a3cdf
[NFC][PassBuilder] addVectorPasses(): clarify that 'IsLTO' is actually 'IsFullLTO'
I.e. it will be `false` for thin lto.
2021-07-01 10:09:24 +03:00
Qiu Chaofan 07f0faed11 [NFC][Scheduler] Refactor tryCandidate to return boolean
This patch changes return type of tryCandidate from void to bool:

1. Methods in some targets already follow this convention.
2. This would help if some target wants to re-use generic code.
3. It looks more intuitive if these try-method returns the same type.

We may need to change return type of them from bool to some enum
further, to make it less confusing.

Reviewed By: foad

Differential Revision: https://reviews.llvm.org/D103951
2021-07-01 14:31:47 +08:00
Corentin Jabot b9c24257c7 Add list of LWG papers accepted by WG21 during the June 2021 plenary
Reviewed By: #libc, Quuxplusone, ldionne

Differential Revision: https://reviews.llvm.org/D105103
2021-07-01 04:27:23 +00:00
Jacob Hegna 96f15aa5bb Fail gracefully if no inlining model is available to download.
Differential Revision: https://reviews.llvm.org/D104829
2021-07-01 04:04:11 +00:00
LLVM GN Syncbot 9184090c96 [gn build] Port 28b01c59c9 2021-07-01 04:00:13 +00:00
Brian Cain 28b01c59c9 [hexagon] Add {hvx,}hexagon_{protos,circ_brev...}
Add definitions for Hexagon, Hexagon circular/bit-reverse and HVX
intrinsics.
2021-06-30 22:58:56 -05:00
theidexisted ae7c3959e0 [Compiler-rt] Add delete for noncopyable
Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D105077
2021-06-30 20:53:47 -07:00
LLVM GN Syncbot f16029e3f7 [gn build] Port 662c55442f 2021-07-01 03:45:41 +00:00
Vitaly Buka 00f474e9b1 [GWP_ASAN] Enable ARM tests
Reviewed By: hctim

Differential Revision: https://reviews.llvm.org/D105233
2021-06-30 20:43:33 -07:00
Vitaly Buka b1fd009aab [scudo] GWP_ASAN runs on untagged pointers
It's already covered by multiple tests, but to trigger
this path we need MTE+GWP which disabled.

Reviewed By: hctim, pcc

Differential Revision: https://reviews.llvm.org/D105232
2021-06-30 20:41:30 -07:00