Commit Graph

368523 Commits

Author SHA1 Message Date
Jay Foad 1dfbc2ea14 [AMDGPU] Only enable mad/mac legacy f32 patterns if denormals may be flushed
Following on from D88890, this makes the newly added patterns
conditional on NoFP32Denormals. mad/mac f32 instructions always flush
denormals regardless of the MODE register setting, and I believe the
legacy variants do the same.

Differential Revision: https://reviews.llvm.org/D89123
2020-10-09 17:08:38 +01:00
Tres Popp 46dd827232 [mlir] Forward listeners when utilizing scf::IfOp::get*BodyBuilder.
Without this PatternRewriting infrastructure does not know of modifications and
cannot properly legalize nor rollback changes.

Differential Revision: https://reviews.llvm.org/D89129
2020-10-09 18:03:01 +02:00
Simon Pilgrim 8a836daaa9 [InstCombine] Support lshr(trunc(lshr(x,c1)), c2) -> trunc(lshr(lshr(x,c1),c2)) uniform vector tests
FoldShiftByConstant is hardcoded for scalar/uniform outer shift amounts atm so that needs to be fixed first to support non-uniform cases
2020-10-09 16:54:46 +01:00
Simon Pilgrim af1f016436 [InstCombine] Add lshr(trunc(lshr(x,c1)), c2) -> trunc(lshr(lshr(x,c1),c2)) vector tests 2020-10-09 16:54:46 +01:00
Eugene Zhulenev 4e69a52952 [MLIR] Add async token/value arguments to async.execute op
Async execute operation can take async arguments as dependencies.

Change `async.execute` custom parser/printer format to use `%value as %unwrapped: !async.value<!type>` sytax.

Reviewed By: mehdi_amini, herhut

Differential Revision: https://reviews.llvm.org/D88601
2020-10-09 08:52:27 -07:00
Andrzej Warzynski dcd9be43e5 [mlir] Fix shared libs build
Reverts one breaking change introduced in
https://reviews.llvm.org/D88846.

Differential Revision: https://reviews.llvm.org/D89111
2020-10-09 16:38:42 +01:00
David Green 4c3515cd62 [ARM] Add MVE vecreduce costmodel tests. NFC
There were some existing tests that were not super useful. New ones are
added for testing MVE specific patterns.
2020-10-09 16:25:25 +01:00
Scott Linder 4a98cf7867 [NFC] Reformat MILexer.cpp:getIdentifierKind
Reformat to avoid unrelated changes in diff of future patch.
Committed as obvious.
2020-10-09 15:21:24 +00:00
Simon Pilgrim 1c040a3e56 [InstCombine] commonShiftTransforms - add support for pow2 nonuniform constant vectors in srem fold
Note: we already fold srem to undef if any denominator vector element is undef.
2020-10-09 15:59:33 +01:00
Krzysztof Parzyszek 99cafe0094 [Hexagon] Return 1 instead of 0 from getMaxInterleaveFactor 2020-10-09 09:46:18 -05:00
Sanjay Patel 080e6bc205 [InstCombine] allow vector splats for add+and with high-mask
There might be a better way to specify the pre-conditions,
but this is hopefully clearer than the way it was written:
https://rise4fun.com/Alive/Jhk3

  Pre: C2 < 0 && isShiftedMask(C2) && (C1 == C1 & C2)
  %a = and %x, C2
  %r = add %a, C1
  =>
  %a2 = add %x, C1
  %r = and %a2, C2
2020-10-09 10:39:11 -04:00
Simon Pilgrim ccf1260792 [InstCombine] Add tests for X shift (A srem B) -> X shift (A and B-1) pow2 nonuniform constant vectors 2020-10-09 15:33:06 +01:00
Anastasia Stulova 71d3b7ec7b [OpenCL] Add new compilation mode for OpenCL 3.0.
Extended -cl-std/std flag with CL3.0 and added predefined version macros.

Patch by Anton Zabaznov (azabaznov)!

Tags: #clang

Differential Revision: https://reviews.llvm.org/D88300
2020-10-09 15:28:38 +01:00
Louis Dionne ddb2baf9fb [libc++] Make sure we don't cache DSL functions too aggressively
To make sure we don't store a mutable object (which could be modified by
outside code without us noticing) as the cache key, we pickle the cache
key to get a byte stream. If two keys are unequal, we know for sure they
will not have the same pickling. And if they are equal, there's a large
chance they will have the same pickling. If they don't, we might end up
not reusing a cached entry when we could have, but at least the behavior
we'll have is semantically correct.
2020-10-09 10:22:46 -04:00
Irina Dobrescu 63ca276dc6 [mlir][openmp][NFC]Remove unnecessary brackets and rephrase ParallelOp description in mlir definition
Differential Revision: https://reviews.llvm.org/D88740
2020-10-09 15:21:44 +01:00
Sam McCall 41d2987c75 [clangd] Stop logging in fromJSON, report instead. 2020-10-09 16:15:45 +02:00
Fanbo Meng d91234b21c [SystemZ][z/OS] Update target specific __attribute__((aligned)) value for test
z/OS defaults to 16 bytes for  __attribute__((aligned)), modify the test to differentiate between z/OS and Linux on s390x.

Reviewed By: abhina.sreeskantharajan

Differential Revision: https://reviews.llvm.org/D89127
2020-10-09 10:14:44 -04:00
Louis Dionne 86d61365d8 [libc++] More consistency with declaring int main(int, char**) 2020-10-09 10:09:57 -04:00
Tres Popp fa200dc359 [mlir] Use PatternRewriter infrastructure for shape.assuming bufferization
Without this, legalization might not recursively handle child ops properly.
Additionally, this is required for pattern rewriting to properly rollback conversions.

Differential Revision: https://reviews.llvm.org/D89122
2020-10-09 16:01:02 +02:00
LLVM GN Syncbot 5e65d384a2 [gn build] Port 0741a2c9ca 2020-10-09 13:54:24 +00:00
Stefan Pintilie 0741a2c9ca [Clang][unittests][NFC] Break up test in Callbacks.cpp
The Callbacks.cpp test was taking a long time to compile on some build bots
causing timeouts. This patch splits up that test into five separate cpp
files and a header file.

Reviewed By: gribozavr2

Differential Revision: https://reviews.llvm.org/D88886
2020-10-09 08:53:50 -05:00
Florian Hahn 8f56e382f7 [SCEV] Do not apply info from loop guards in AddRecs.
We cannot guarantee that the replacement expression is loop-invariant in
all AddRecs in the source expression. Use a rewriter that skips
AddRecExpr for now.

Fixes PR47776.
2020-10-09 14:47:26 +01:00
Simon Pilgrim 9e796d5e71 [InstCombine] foldShiftOfShiftedLogic - add support for nonuniform constant vectors 2020-10-09 14:25:12 +01:00
Alexander Kornienko fe4715c47f Remove old create(MainFile)?IncludeInsertion overloads
Reviewed By: hokein

Differential Revision: https://reviews.llvm.org/D89117
2020-10-09 15:24:57 +02:00
Simon Pilgrim 556316cf72 [InstCombine] foldShiftOfShiftedLogic - replace cast<BinaryOperator> with m_BinOp matcher. NFCI.
Allows us to drop the !isa<ConstantExpr> check.
2020-10-09 14:10:12 +01:00
Stephan Herhut 366d8435b4 [mlir][gpu] Fix bug in kernel outlining
The updated version of kernel outlining did not handle cases correctly
where an operand of a candidate for sinking itself was defined by an operation
that is a sinking candidate. In such cases, it could happen that sunk
operations were inserted in the wrong order, breaking ssa properties.

Differential Revision: https://reviews.llvm.org/D89112
2020-10-09 15:03:14 +02:00
Simon Pilgrim 2efcb6438a [InstCombine] Add nonuniform/undef vector tests for shift(binop(shift(x,c1),y),c2) patterns 2020-10-09 13:42:11 +01:00
Martin Storsjö 1dbfd87319 [LLD] [ELF] Fix the help listing for the wrap option. NFC.
This option just takes a single symbol name per invocation of the
option.

Differential Revision: https://reviews.llvm.org/D89007
2020-10-09 15:32:00 +03:00
Konstantin Zhuravlyov b581c5a42f Regenerate ClangCommandLineReference.rst
Differential Revision: https://reviews.llvm.org/D89091
2020-10-09 08:29:53 -04:00
Ben Dunbobbin bb148ad426 [windows-itanium] make dllimport/export handling closer to MS behavior
Differential Revision: https://reviews.llvm.org/D86828
2020-10-09 13:24:07 +01:00
Ben Dunbobbin a9f1bb92bf Revert "first upstream review"
Pushed by accident :(

This reverts commit 4eb627ed96.
2020-10-09 13:22:46 +01:00
Ben Dunbobbin 4eb627ed96 first upstream review 2020-10-09 13:21:03 +01:00
Sam McCall 7530b254e9 [clangd] Make the tweak filter a parameter to enumerateTweaks. NFC
(Required for CodeActionContext.only)

Differential Revision: https://reviews.llvm.org/D88724
2020-10-09 14:11:19 +02:00
Roman Lebedev 027e7a7721
Reland "[NFC][SCEV] Improve tests for ptrtoint modelling (D88806)"
I messed up runlines in the original commit.
2020-10-09 14:50:05 +03:00
Jonas Toth e517e5cfec [clang] improve accuracy of ExprMutAnalyzer
This patch extracts the ExprMutAnalyzer changes from https://reviews.llvm.org/D54943
into its own revision for simpler review and more atomic changes.

The analysis results are improved. Nested expressions (e.g. conditional
operators) are now detected properly. Some edge cases, especially
template induced imprecisions are improved upon.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D88088
2020-10-09 13:45:32 +02:00
Nithin Vadukkumchery Rajendrakumar 0b4fe8086f [Analyzer] Fix for dereferece of smart pointer after branching on unknown inner pointer
Summary: Enabling warning after dereferece of smart pointer after branching on unknown inner pointer.

Reviewers: NoQ, Szelethus, vsavchenko, xazax.hun
Reviewed By: NoQ
Subscribers: martong, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D87043
2020-10-09 13:42:25 +02:00
Max Kazantsev 225df71951 [NFC] Add option to disable IV widening if needed
IV widening is sometimes a strictly harmful transform (some examples
of this are shown in tests 11, 12 in widen-loop-comp.ll). One of the
reasons of this is that sometimes SCEV fails to prove some facts after
part of guards has been widened.

Though each single such case looks like a bug that can be addressed,
it seems that disabling of IV widening may be profitable in some cases.
We want to have an option to do so. By default, existing behavior is
preserved and IV widening is on.
2020-10-09 18:32:03 +07:00
James Molloy 8bdbe29519 [mlir] Fix bug in computing operation order
When attempting to compute a differential orderIndex we were calculating the
bailout condition correctly, but then an errant "+ 1" meant the orderIndex we
created was invalid.

Added test.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D89115
2020-10-09 12:18:52 +01:00
Roman Lebedev 2aeae1617c
Revert "[NFC][SCEV] Improve tests for ptrtoint modelling (D88806)"
Buildbots aren't happy, need to investigate.
This reverts commit 32cc8f7998.
2020-10-09 14:10:43 +03:00
Jonas Paulsson d851495f2f [SystemZ] Use LA instead of AGR in eliminateFrameIndex().
Since AGR clobbers CC it should not be used here.

Fixes https://bugs.llvm.org/show_bug.cgi?id=47736.

Review: Ulrich Weigand
Differential Revision: https://reviews.llvm.org/D89034
2020-10-09 13:06:33 +02:00
Dávid Bolvanský caf28b0a12 [Diagnostics] Diagnose -Wsizeof-array-div for array of pointers
Differential Revision: https://reviews.llvm.org/D87990
2020-10-09 12:56:06 +02:00
Roman Lebedev 32cc8f7998
[NFC][SCEV] Improve tests for ptrtoint modelling (D88806) 2020-10-09 13:50:30 +03:00
Christian Sigg 701fbe8725 [mlir] NFC: small improvement to how we print a gpu.launch op.
Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D89033
2020-10-09 12:45:41 +02:00
Luís Marques 32f2f0d78a [NFC] Fix banner 2020-10-09 10:00:11 +01:00
Esme-Yi e9fd8823ba [DAGCombiner] Add decomposition patterns for Mul-by-Imm.
Summary: This patch is derived from D87384.
In this patch we expand the existing decomposition of mul-by-constant to be more general by implementing 2 patterns:
```
  mul x, (2^N + 2^M) --> (add (shl x, N), (shl x, M))
  mul x, (2^N - 2^M) --> (sub (shl x, N), (shl x, M))
```
The conversion will be trigged if the multiplier is a big constant that the target can't use a single multiplication instruction to handle. This is controlled by the hook `decomposeMulByConstant`.
More over, the conversion benefits from an ILP improvement since the instructions are independent. A case with the sequence like following also gets benefit since a shift instruction is saved.

```
*res1 = a * 0x8800;
*res2 = a * 0x8080;
```

Reviewed By: spatel

Differential Revision: https://reviews.llvm.org/D88201
2020-10-09 08:51:40 +00:00
Georgii Rymar 73d964646c [llvm-readelf/obj][test] - Stop using precompiled binary in mips-plt.test
This removes the precompiled binary and rewrites test to use YAML.

After this change we'll have no more precompiled inputs in `llvm-readobj/ELF/Inputs`.

Differential revision: https://reviews.llvm.org/D89097
2020-10-09 11:48:49 +03:00
Pavel Labath 0610a25a85 [lldb] Delete copy operations on PluginInterface class
This is a polymorphic class, copying it is a bad idea.

This was not a problem because most classes inheriting from it were
deleting their copy operations themselves. However, this enables us to
delete those explicit deletions, and ensure noone forgets to add them in
the future.
2020-10-09 10:37:09 +02:00
Bevin Hansson dd3014f3dc [Fixed Point] Add floating point methods to APFixedPoint.
This adds methods to APFixedPoint for converting to and from
floating point values.

Differential Revision: https://reviews.llvm.org/D85961
2020-10-09 10:27:42 +02:00
Bevin Hansson 9c26eb8b91 Refactor fixed point conversion test.
Differential Revision: https://reviews.llvm.org/D88648
2020-10-09 10:27:42 +02:00
Bevin Hansson 14a217534b [IR] Add Type::getFloatingPointTy.
It is possible to get a fltSemantics of a particular Type,
but there is no way to produce a Type based on a
fltSemantics.

This adds the function Type::getFloatingPointTy, which
will return the appropriate floating point Type for a given
fltSemantics.

ConstantFP is modified to use this function instead of
implementing it itself. Also some minor refactors to use
Type::getFltSemantics instead of a hand-rolled version.

Differential Revision: https://reviews.llvm.org/D87512
2020-10-09 10:27:41 +02:00