Commit Graph

386269 Commits

Author SHA1 Message Date
Simon Pilgrim 05953cf615 [X86] Regenerate atomic-eflags-reuse.ll 2021-04-22 14:07:12 +01:00
Simon Pilgrim 41091614d6 [LTO] Caching.h - remove unused <string> include. NFCI. 2021-04-22 14:07:12 +01:00
Dawid Jurczak d944b1e0f2 [InstCombine][NFC] Use --check-globals flag in tests.
This patch adds strings content checking to printf-2.ll via --check-globals flag.

Split off from D100724.

Reviewed By: xbolva00

Differential Revision: https://reviews.llvm.org/D101034
2021-04-22 15:06:42 +02:00
Dawid Jurczak 57f443c348 [SimplifyLibCalls][NFC] Use StringRef::back instead explicit indexing.
Split off from D100724.

Reviewed By: xbolva00

Differential Revision: https://reviews.llvm.org/D101032
2021-04-22 15:02:47 +02:00
Jun Ma 978eb3f168 [DAGCombiner] Allow operand of step_vector to be negative.
It is proper to relax non-negative limitation of step_vector.
Also this patch adds more combines for step_vector:
(sub X, step_vector(C)) -> (add X,  step_vector(-C))

Differential Revision: https://reviews.llvm.org/D100812
2021-04-22 20:58:03 +08:00
Alexander Belyaev 0724911d2a [mlir] Add `tensor.reshape`.
This operation a counterpart of `memref.reshape`.

RFC [Reshape Ops Restructuring](https://llvm.discourse.group/t/rfc-reshape-ops-restructuring/3310)

Differential Revision: https://reviews.llvm.org/D100971
2021-04-22 14:53:23 +02:00
Wang, Pengfei aafb6d81cf [X86][AMX][NFC] Remove assert for comparison between different BBs.
SmallSet may use operator `<` when we insert MIRef elements, so we
cannot limit the comparison between different BBs.

We allow MIRef() to be less that any initialized MIRef object, otherwise,
we always reture false when compare between different BBs.

Differential Revision: https://reviews.llvm.org/D101039
2021-04-22 20:41:59 +08:00
Nico Weber 46991ad266 [gn build] (manually) port aee6c86c4d better
"EmptyNodeIntrospection.inc.in" needs to be a source of the action,
so that ninja knows to rerun this action if that input changes.
2021-04-22 08:41:40 -04:00
Stephen Kelly 6f48d6a9df [AST] Make comment a bit more specific 2021-04-22 13:40:56 +01:00
Nico Weber b13e9d72da [gn build] (manually) port aee6c86c4d 2021-04-22 08:36:19 -04:00
Pavel Labath e5984a3680 [lldb/elf] Avoid side effects in function calls ParseUnwindSymbols
This addresses post-commit feedback to cd64273.
2021-04-22 14:31:00 +02:00
Nathan Sidwell 6ad7e87806 clang: libstdc++ LWM is 4.8.3
Document oldest libstdc++ as 4.8.3, remove a hack for a 4.6 issue.

Differential Revision: https://reviews.llvm.org/D100465
2021-04-22 05:26:07 -07:00
Sander de Smalen e951b045bf [AArch64][SVE] Regression test all ACLE tests with C++
We found issues with a number of intrinsics when building them with
C++, so it makes sense to guard these tests with some extra RUN lines
to build the tests in C++ mode.
2021-04-22 13:24:04 +01:00
Valeriy Savchenko 5780dbeee6 [-Wcalled-once] Do not run analysis on Obj-C++
Objective-C++ is not yet suppoerted.

rdar://76729552

Differential Revision: https://reviews.llvm.org/D100955
2021-04-22 15:20:52 +03:00
Frederik Gossen f0c51cb2d4 [MLIR][Shape] Add canonicalizations for `shape.broadcast`
Eliminate empty shapes from the operands, partially fold all constant shape
operands, and fix normal folding.

Differential Revision: https://reviews.llvm.org/D100634
2021-04-22 14:11:23 +02:00
Raphael Isemann e3dd82ae3c [lldb] Don't leak LineSequence in PDB parsers
`InsertSequence` doesn't take ownership of the pointer so releasing this pointer
is just leaking memory.

Follow up to D100806 that was fixing other leak sanitizer test failures

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D100846
2021-04-22 14:11:01 +02:00
Jan Svoboda 850e01a34d [clang][deps] Check extra args in tests
These flags are being generated by `clang-scan-deps` and it makes sense to ensure it keeps doing so.
2021-04-22 14:10:08 +02:00
Stephen Kelly 5e50f473d9 [AST] Add clarification comment 2021-04-22 12:51:25 +01:00
Raphael Isemann d2223c7a49 [lldb] XFAIL TestStoppedInStaticMemberFunction on Windows
It seems we can't find the symbols of static members on Windows? The bug is not
 relevant to what this test is actually testing so let's just XFAIL it.
2021-04-22 13:46:27 +02:00
Jay Foad 82d34fe2b3 Fix typo "beneficiates" in comments 2021-04-22 12:30:16 +01:00
Stephen Kelly aee6c86c4d [AST] De-duplicate empty node introspection
This way we can add support for other nodes without duplication.

Differential Revision: https://reviews.llvm.org/D98774
2021-04-22 12:30:04 +01:00
Benjamin Kramer edc869cb57 [lldb-vscode] Use a DenseMap to pacify overly aggressive linters
Some linters get rather upset upon seeing
`std::unordered_map<const char*`, because it looks like a map of
strings but isn't. lldb uses interned strings so this is not a problem.
DenseMap is a better data structure for this anyways, so use that
instead.
2021-04-22 13:07:39 +02:00
Stephen Tozer e5d844b587 [Bitcode] Ensure DIArgList in bitcode has no null or forward metadata refs
This patch fixes an issue in which ConstantAsMetadata arguments to a
DIArglist, as well as the Constant values referenced by that metadata,
would not be always be emitted correctly into bitcode. This patch fixes
this issue firstly by searching for ConstantAsMetadata in DIArgLists
(previously we would only search for them when directly wrapped in
MetadataAsValue), and secondly by enumerating all of a DIArgList's
arguments directly prior to enumerating the DIArgList itself.

This patch also adds a number of asserts, and no longer treats the
arguments to a DIArgList as optional fields when reading/writing to
bitcode.

Differential Revision: https://reviews.llvm.org/D100572
2021-04-22 12:03:33 +01:00
Hamza Mahfooz be2277fbf2
[Matrix] Support #pragma clang fp
From https://bugs.llvm.org/show_bug.cgi?id=49739:

Currently, `#pragma clang fp` are ignored for matrix types.

For the code below, the `contract` fast-math flag should be added to the generated call to `llvm.matrix.multiply` and `fadd`

```
typedef float fx2x2_t __attribute__((matrix_type(2, 2)));

void foo(fx2x2_t &A, fx2x2_t &C, fx2x2_t &B) {
  #pragma clang fp contract(fast)
  C = A*B + C;
}
```

Reviewed By: fhahn, mibintc

Differential Revision: https://reviews.llvm.org/D100834
2021-04-22 11:45:34 +01:00
Simon Pilgrim 439366817b MipsSEFrameLowering.h - remove unused headers. NFCI. 2021-04-22 11:32:29 +01:00
Simon Pilgrim e28ae5e530 [X86][AVX] Add PR49971 test case
This is a llvm12 only bug, and is already avoided in trunk, but we should keep track of it.
2021-04-22 11:32:29 +01:00
Nemanja Ivanovic 3bcd0ece43 [PowerPC] Add vec_roundc as alias for vec_rint in altivec.h
For compatibility with XLC, add these overloads.
2021-04-22 05:31:38 -05:00
Stephen Kelly 21ce124e1e [AST] Add NestedNameSpecifierLoc accessors to node introspection
Differential Revision: https://reviews.llvm.org/D100712
2021-04-22 11:27:19 +01:00
Raphael Isemann 034c73d42e [lldb][NFC] Fix unsigned/signed cmp warning in MainLoopTest
The gtest checks compare all against unsigned int constants so this also needs
to be unsigned.
2021-04-22 12:20:32 +02:00
Raphael Isemann 00764c36ed [lldb] Add support for evaluating expressions in static member functions
At the moment the expression parser doesn't support evaluating expressions in
static member functions and just pretends the expression is evaluated within a
non-member function. This causes that all static members are inaccessible when
doing unqualified name lookup.

This patch adds support for evaluating in static member functions. It
essentially just does the same setup as what LLDB is already doing for
non-static member functions (i.e., wrapping the expression in a fake member
function) with the difference that we now mark the wrapping function as static
(to prevent access to non-static members).

Reviewed By: shafik, jarin

Differential Revision: https://reviews.llvm.org/D81550
2021-04-22 12:14:31 +02:00
Nemanja Ivanovic 092619cf6b [PowerPC] Improve codegen for vector fp to int widening conversions
We currently do not utilize instructions that convert single
precision vectors to doubleword integer vectors. These conversions
come up in code occasionally and this improvement allows us to
open code some functions that need to be added to altivec.h.
2021-04-22 05:04:06 -05:00
Thomas Schmeyer 28b6726c4d [mlir] Move memref-tests from standard to memref folder.
Split memref-test from standard test and move them to the folder MemRef.

Differential Revision: https://reviews.llvm.org/D100950
2021-04-22 11:35:25 +02:00
Martin Storsjö 8000e1f578 [AArch64] Fix calling windows varargs with floats in fixed args from non-windows functions
When inspecting the calling convention, for calling windows functions
from a non-windows function, inspect the calling convention of
the called function, not the caller.

Also remove an unnecessary parameter to AArch64CallLowering
OutgoingArgHandler.

Differential Revision: https://reviews.llvm.org/D100890
2021-04-22 12:02:49 +03:00
Jan Svoboda 398f253400 [clang][deps] Include "-cc1" in the arguments
To simplify tools consuming dependency scanning results, prepend the "-cc1" argument by default.

Reviewed By: Bigcheese

Differential Revision: https://reviews.llvm.org/D100942
2021-04-22 10:57:56 +02:00
Tobias Gysi 0e777e4ad7 [mlir][linalg] remove interchange option on linalg to loop lowering.
The interchange option attached to the linalg to loop lowering affects only the loops and does not update the memory accesses generated in to body of the operation. Instead of performing the interchange during the loop lowering use the interchange pattern.

Differential Revision: https://reviews.llvm.org/D100758
2021-04-22 08:55:17 +00:00
Martin Probst fbc6f42dbe clang-format: [JS] do not merge side-effect imports.
The if condition was testing the current element, but
forgot to check the previous element (doh), so it
would fail depending on sort order of the imports.

Differential Revision: https://reviews.llvm.org/D101020
2021-04-22 10:36:47 +02:00
Jay Foad 79cb3ba08f [AMDGPU] SIWholeQuadMode: don't add duplicate implicit $exec operands
STRICT_WWM and STRICT_WQM are already defined with Uses = [EXEC], so
there is no need to add another implicit use of $exec when lowering them
to V_MOV_B32 instructions.

Differential Revision: https://reviews.llvm.org/D100969
2021-04-22 09:19:47 +01:00
Serge Pavlov 740962e5d0 [RISCV] Custom lowering of SET_ROUNDING
Differential Revision: https://reviews.llvm.org/D91242
2021-04-22 15:04:55 +07:00
David Sherwood 5a229a6702 [LoopVectorize] Don't create unnecessary vscale intrinsic calls
In quite a few cases in LoopVectorize.cpp we call createStepForVF
with a step value of 0, which leads to unnecessary generation of
llvm.vscale intrinsic calls. I've optimised IRBuilder::CreateVScale
and createStepForVF to return 0 when attempting to multiply
vscale by 0.

Differential Revision: https://reviews.llvm.org/D100763
2021-04-22 09:01:52 +01:00
Wenlei He dff8315892 [CSSPGO][llvm-profdata] Support trimming cold context when merging profiles
The change adds support for triming and merging cold context when mergine CSSPGO profiles using llvm-profdata. This is similar to the context profile trimming in llvm-profgen, however the flexibility to trim cold context after profile is generated can be useful.

Differential Revision: https://reviews.llvm.org/D100528
2021-04-22 00:42:37 -07:00
Martin Storsjö cfec0a3e9e [libcxx] [test] Fix testing on windows with c++experimental enabled
The straightforward `AddLinkFlag('-lc++experimental')` approach doesn't
work on e.g. MSVC. For linking to libc++ itself, a more convoluted logic
is used (see configure_link_flags_cxx_library).

Differential Revision: https://reviews.llvm.org/D99177
2021-04-22 10:26:00 +03:00
Georgy Komarov 9a930aa5bd
[clang-tidy] Avoid bugprone-macro-parentheses warnings after goto argument
clang-tidy should not generate warnings for the goto argument without
parentheses, because it would be a syntax error.

The only valid case where an argument can be enclosed in parentheses is
"Labels as Values" gcc extension: https://gcc.gnu.org/onlinedocs/gcc/Labels-as-Values.html.
This commit adds support for the label-as-values extension as implemented in clang.

Fixes bugzilla issue 49634.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D99924
2021-04-22 10:14:10 +03:00
Arthur Eubanks 1dfb52a756 [NewPM] Mark some more wrapper passes as ignored
We shouldn't print IR when seeing these passes.
2021-04-21 23:55:02 -07:00
Craig Topper 58c5b4c2c3 [RISCV] Use TargetConstant for condition code of RISCVISD::SELECT_CC.
The value is always an immediate and can never be in a register.
This the kind of thing TargetConstant is for.

Saves a step GenDAGISel to convert a Constant to a TargetConstant.
2021-04-21 23:08:52 -07:00
Max Kazantsev 8fe62b7af1 [GVN] Introduce loop load PRE
This patch allows PRE of the following type of loads:

```
preheader:
  br label %loop

loop:
  br i1 ..., label %merge, label %clobber

clobber:
  call foo() // Clobbers %p
  br label %merge

merge:
  ...
  br i1 ..., label %loop, label %exit

```

Into
```
preheader:
  %x0 = load %p
  br label %loop

loop:
  %x.pre = phi(x0, x2)
  br i1 ..., label %merge, label %clobber

clobber:
  call foo() // Clobbers %p
  %x1 = load %p
  br label %merge

merge:
  x2 = phi(x.pre, x1)
  ...
  br i1 ..., label %loop, label %exit

```

So instead of loading from %p on every iteration, we load only when the actual clobber happens.
The typical pattern which it is trying to address is: hot loop, with all code inlined and
provably having no side effects, and some side-effecting calls on cold path.

The worst overhead from it is, if we always take clobber block, we make 1 more load
overall (in preheader). It only matters if loop has very few iteration. If clobber block is not taken
at least once, the transform is neutral or profitable.

There are several improvements prospect open up:
- We can sometimes be smarter in loop-exiting blocks via split of critical edges;
- If we have block frequency info, we can handle multiple clobbers. The only obstacle now is that
  we don't know if their sum is colder than the header.

Differential Revision: https://reviews.llvm.org/D99926
Reviewed By: reames
2021-04-22 12:50:38 +07:00
Pushpinder Singh 722d4d8e75 [AMDGPU][OpenMP] Add amdgpu-arch tool to list AMD GPUs installed
This patch adds new clang tool named amdgpu-arch which uses
HSA to detect installed AMDGPU and report back latter's march.
This tool is built only if system has HSA installed.

The value printed by amdgpu-arch is used to fill -march when
latter is not explicitly provided in -Xopenmp-target.

Reviewed By: JonChesterfield, gregrodgers

Differential Revision: https://reviews.llvm.org/D99949
2021-04-22 05:20:28 +00:00
Snehasish Kumar 8077d0ff5c [CodeGen] Do not split functions with attr "implicit-section-name".
The #pragma clang section can be used at a coarse granularity to specify
the section used for bss/data/text/rodata for global objects. When split
functions is enabled, the function may be split into two parts violating
user expectations.

Reference:
https://clang.llvm.org/docs/LanguageExtensions.html#specifying-section-names-for-global-objects-pragma-clang-section

Differential Revision: https://reviews.llvm.org/D101004
2021-04-21 21:51:33 -07:00
Peter Collingbourne e4fa0b307f scudo: Obtain tag from pointer instead of loading it from memory. NFCI.
Since we already have a tagged pointer available to us, we can just
extract the tag from it and avoid an LDG instruction.

Differential Revision: https://reviews.llvm.org/D101014
2021-04-21 21:47:49 -07:00
Chen Zheng 26f138eed4 [Debug-Info] implement -gstrict-dwarf
This patch implements -gstrict-dwarf option in clang FE.

Reviewed By: dblaikie, probinson, aprantl

Differential Revision: https://reviews.llvm.org/D100809
2021-04-22 00:41:25 -04:00
Serge Pavlov 6e63dfdae2 [RISCV] Custom lowering of FLT_ROUNDS_
Differential Revision: https://reviews.llvm.org/D90854
2021-04-22 11:39:15 +07:00