Commit Graph

384340 Commits

Author SHA1 Message Date
Pavel Labath 48e3da1351 [lldb] Rewrite TestAutoInstallMainExecutable logic
The test uses debug info from one binary to debug a different one. This
does not work on macos, and its pure luck that it works elsewhere (the
variable that it inspects happens to have the same address in both).

The purpose of this test is to verify that lldb has not overwritten the
target executable. That can be more easily achieved by checking the exit
code of the binary, so change the test to do that.

Also remove the llgs_test decorator, as it's preventing the test from
running on macos. All the test needs is the platform functionality of
lldb-server, which is available everywhere.
2021-04-01 14:20:20 +02:00
Michał Górny fcea4181bb [lldb] [test] Mark lldb-server multiprocess tests as LLGS cat 2021-04-01 14:17:47 +02:00
Dmitry Preobrazhensky cd953434f2 [AMDGPU][MC][GFX10][GFX90A] Corrected _e32/_e64 suffices
Fixed bugs https://bugs.llvm.org//show_bug.cgi?id=49643, https://bugs.llvm.org//show_bug.cgi?id=49644, https://bugs.llvm.org//show_bug.cgi?id=49645.

Differential Revision: https://reviews.llvm.org/D99413
2021-04-01 14:21:00 +03:00
Simon Pilgrim abbe80fa52 [X86][SSE] Fold HOP(HOP(X,X),HOP(Y,Y)) -> HOP(PERMUTE(HOP(X,Y)),PERMUTE(HOP(X,Y))
For slow-hop targets, attempt to merge HADD/SUB pairs used in chains.
2021-04-01 11:54:10 +01:00
Simon Pilgrim 301319840e [X86][SSE] Enable (F)HADD/SUB handling to SimplifyMultipleUseDemandedVectorElts
Attempt to bypass unused horiz-op operands.

This is very similar to the PACKSS/PACKUS handling - we should try to merge these.
2021-04-01 11:54:09 +01:00
Simon Pilgrim f7aeaced65 [X86][SSE] Add isHorizOp helper function. NFCI. 2021-04-01 11:54:09 +01:00
Dmitry Preobrazhensky 0f5ebbcc7f [AMDGPU][MC] Added flag to identify VOP instructions which have a single variant
By convention, VOP1/2/C instructions which can be promoted to VOP3 have _e32 suffix while promoted instructions have _e64 suffix. Instructions which have a single variant should have no _e32/_e64 suffix. Unfortunately there was no simple way to identify single variant instructions - it was implemented by a hack. See bug https://bugs.llvm.org/show_bug.cgi?id=39086.

This fix simplifies handling of single VOP instructions by adding a dedicated flag.

Differential Revision: https://reviews.llvm.org/D99408
2021-04-01 13:53:12 +03:00
Florian Hahn 6be8662c52
[SLP] Add test cases for missing SLP vectorization on AArch64. 2021-04-01 11:48:16 +01:00
Balázs Kéri df4fa53fdd [clang][Checkers] Extend PthreadLockChecker state dump (NFC).
Add printing of map 'DestroyRetVal'.

Reviewed By: steakhal

Differential Revision: https://reviews.llvm.org/D98502
2021-04-01 11:59:00 +02:00
David Sherwood e3a13304fc [NFC] Add tests for scalable vectorization of loops with large stride acesses
This patch just adds tests that we can vectorize loop such as these:

  for (i = 0; i < n; i++)
    dst[i * 7] += 1;

and

  for (i = 0; i < n; i++)
    if (cond[i])
      dst[i * 7] += 1;

using scalable vectors, where we expect to use gathers and scatters in the
vectorized loop. The vector of pointers used for the gather is identical
to those used for the scatter so there should be no memory dependences.

Tests are added here:

  Transforms/LoopVectorize/AArch64/sve-large-strides.ll

Differential Revision: https://reviews.llvm.org/D99192
2021-04-01 10:25:06 +01:00
Vinayaka Bandishti dc537158d5 [MLIR][Affine] Add utility to check if the slice is valid
Fixes a bug in affine fusion pipeline where an incorrect slice is computed.
After the slice computation is done, original domain of the the source is
compared with the new domain that will result if the fusion succeeds. If the
new domain must be a subset of the original domain for the slice to be
valid. If the slice computed is incorrect, fusion based on such a slice is
avoided.

Relevant test cases are added/edited.

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

Differential Revision: https://reviews.llvm.org/D98239
2021-04-01 14:52:22 +05:30
Muhammad Omair Javaid b468f0e165 [LLDB] Fix sync issue in TestVSCode_launch.test_progress_events
This fixes flakiness in TestVSCode_launch.test_progress_events
vscode.progress_events some times failed to populate in time for
follow up iterations.

Adding a minor delay before the the for the loop fixes the issue.

Reviewed By: clayborg

Differential Revision: https://reviews.llvm.org/D99497
2021-04-01 14:16:54 +05:00
Muhammad Omair Javaid dd2a63e1ee Revert "Revert "[LLDB] Arm64/Linux test case for MTE and Pointer Authentication regset""
This reverts commit feb6f2c78f.
2021-04-01 14:10:14 +05:00
Muhammad Omair Javaid 88a5b35d63 Revert "Revert "[LLDB] Arm64/Linux Add MTE and Pointer Authentication registers""
This reverts commit 71b648f715.

There was a typo in the last commit which was causing LLDB AArch64 Linux
buildbot testsuite failures. Now fixed in current version.
2021-04-01 14:07:50 +05:00
Yevgeny Rouban 1ed53d44d8 [LoopFlatten] Do not report CFG analyses as up-to-date
Removes CFGAnalyses from the preserved analyses set
returned by LoopFlattenPass::run().

Reviewed By: Dave Green, Ta-Wei Tu

Differential Revision: https://reviews.llvm.org/D99700
2021-04-01 15:52:36 +07:00
Harald van Dijk 1d463c2a38
[Driver] Fix architecture triplets and search paths for Linux x32
Currently, support for the x32 ABI is handled as a multilib to the
x86_64 target only. However, full self-hosting x32 systems treating it
as a separate architecture with its own architecture triplets as well as
search paths exist as well, in Debian's x32 port and elsewhere.

This adds the missing architecture triplets and search paths so that
clang can work as a native compiler on x32, and updates the tests so
that they pass when using an x32 libdir suffix.

Additionally, we would previously also assume that objects from any
x86_64-linux-gnu GCC installation could be used to target x32. This
changes the logic so that only GCC installations that include x32
support are used when targetting x32, meaning x86_64-linux-gnux32 GCC
installations, and x86_64-linux-gnu and i686-linux-gnu GCC installations
that include x32 multilib support.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D52050
2021-04-01 09:47:56 +01:00
Sam Parker 92e7771483 [WebAssembly] Invert branch condition on xor input
A frequent pattern for floating point conditional branches use an xor
to invert the input for the branch. Instead we can fold away the xor
by swapping the branch target instead.

Differential Revision: https://reviews.llvm.org/D99171
2021-04-01 09:23:28 +01:00
Nicolas Vasilache 335d2df533 [mlir][Python][Linalg] Add missing attributes to linalg ops
This revision tightens up the handling of attributes for both named
and generic linalg ops.
To demonstrate the IR validity, a working e2e Linalg example is added.

Differential Revision: https://reviews.llvm.org/D99430
2021-04-01 08:16:50 +00:00
Pavel Labath e1d4fb1ebf [lldb] Fix build errors from 3bea7306e8
The addition of the dummy constructors requires matching changes in os-
and arch-specific files, which I forgot about.
2021-04-01 09:01:35 +02:00
Pavel Labath 3bea7306e8 [lldb] Fix compilation with gcc-6.5
This fixes (works around) two errors with gcc-6.5.
- in the RegisterContext_x86 files, gcc is unable to synthesize a
  default constructor -- it thinks it needs to initialize the virtual
  base class, even though said classes are abstract. I fix that by
  providing a dummy constructor.
- In ReproducerInstrumentationTest, it is not able to deduce that the
  TestingRegistry class is movable (it contains a map of unique
  pointers). I change the type from Optional<TestingRegistry> to
  unique_ptr<TestingRegistry), so that moving is not required
  (copying/moving a polymorphic type is not a very good idea in any
  case).
2021-04-01 08:44:50 +02:00
Marek Kurdej 5c703f0fd8 [libc++] Build and test with -Wundef warning. NFC.
This will avoid typos like `_LIBCPP_STD_VERS` (<future>) or using `#if TEST_STD_VER > 17` without including "test_macros.h".

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D99515
2021-04-01 08:32:56 +02:00
Max Kazantsev a1d83776bf [NFC] Undo some erroneous renamings
Some vars renamed by mistake during auto-replacements. Undoing them.
2021-04-01 13:10:10 +07:00
Max Kazantsev 630818a850 [NFC] Disambiguate LI in GVN
Name GVN uses name 'LI' for two different unrelated things:
LoadInst and LoopInfo. This patch relates the variables with
former meaning into 'Load' to disambiguate the code.
2021-04-01 12:40:35 +07:00
Jonas Devlieghere d1828937ed [lldb] Remove references to LLDB_CAPTURE_REPRODUCER
Remove the remaining references to LLDB_CAPTURE_REPRODUCER. I removed
the functionality in an earlier commit but forgot that there was a
corresponding test and logic to unset it in our test suite.
2021-03-31 21:42:00 -07:00
Jonas Devlieghere b7e2c2acb8 [lldb-vscode] Use LLVM's ScopeExit to ensure we always terminate the debugger
Make sure we always terminate the debugger by using a RAII object.

Differential revision: https://reviews.llvm.org/D99702
2021-03-31 21:41:59 -07:00
Jonas Devlieghere 54c3c2e828 [lldb-vscode] Consistently use return EXIT_SUCCESS and EXIT_FAILURE (NFC)
Consistently use return with EXIT_SUCCESS or EXIT_FAILURE instead of
mix-and-matching return, exit 0, 1 etc.

Differential revision: https://reviews.llvm.org/D99701
2021-03-31 21:41:59 -07:00
Chen Zheng bfcd21876a [debug-info] support new tuning debugger type DBX for XCOFF DWARF
Based on this debugger type, for now, we plan to:
1: use inline string by default for XCOFF DWARF
2: generate no column info for debug line table.

Reviewed By: aprantl

Differential Revision: https://reviews.llvm.org/D99400
2021-04-01 00:11:30 -04:00
Jonas Devlieghere dfc8da19c5 [lldb] Remove LLDB_CAPTURE_REPRODUCER override
Remove the LLDB_CAPTURE_REPRODUCER as it is inherently dangerous. The
reproducers require careful initialization which cannot be guaranteed by
overwriting the reproducer mode at this level.

If we want to provide this functionality, we should do it in the driver
instead. It was originally added to enable capture in CI, but we now
have a dedicated CI job that captures and replays the test suite.
2021-03-31 21:10:56 -07:00
Yang Fan a8219991d0
[clang][APINotes] Fix -Wunused-function warning (NFC)
GCC warning:
```
/llvm-project/clang/lib/APINotes/APINotesYAMLCompiler.cpp:574:23: warning: ‘void {anonymous}::Module::dump()’ defined but not used [-Wunused-function]
  574 | LLVM_DUMP_METHOD void Module::dump() {
      |                       ^~~~~~
```
2021-04-01 09:52:43 +08:00
KAWASHIMA Takahiro 5fac7c6046 [GVN] Propagate llvm.access.group metadata of loads
Before this change, the `llvm.access.group` metadata was dropped
when moving a load instruction in GVN. This prevents vectorizing
a C/C++ loop with `#pragma clang loop vectorize(assume_safety)`.
This change propagates the metadata as well as other metadata if
it is safe (the move-destination basic block and source basic
block belong to the same loop).

Differential Revision: https://reviews.llvm.org/D93503
2021-04-01 10:00:48 +09:00
KAWASHIMA Takahiro 565b28f57b [GVN][NFC] Pre-commit test for D93503 2021-04-01 10:00:48 +09:00
qixingxue 62b74f7564 [GVN][NFC] Refactor analyzeLoadFromClobberingWrite
This commit adjusts the order of two swappable if statements to
make code cleaner.

Reviewed By: lattner, nikic
Differential Revision: https://reviews.llvm.org/D99648
2021-04-01 08:35:35 +08:00
Nick Desaulniers bf2479c347 Revert "Add support to -Wa,--version in clang"
This reverts commit 3cc3c0f835.

Breaks non-linux platforms.

https://reviews.llvm.org/D99556#2662706
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
2021-03-31 17:02:13 -07:00
Alexander Shaposhnikov f1e4e2fb20 [lld][MachO] Refactor handling of subsections
This diff is a preparation for fixing FunStabs (incorrect size calculation).
std::map<uint32_t, InputSection*> (SubsectionMap) is replaced with
a sorted vector + binary search. If .subsections_via_symbols is set
this vector will contain the list of subsections, otherwise,
the offsets will be used for calculating the symbols sizes.

Test plan: make check-all

Differential revision: https://reviews.llvm.org/D98837
2021-03-31 16:52:53 -07:00
Philip Reames 4af4828a6e [ValueTracking] Handle non-zero ashr/lshr recurrences
If we know we don't shift out bits (e.g. exact), all we need to know is that input is non-zero.
2021-03-31 16:48:32 -07:00
Philip Reames 0f70a17d0a [tests] Add tests for ashr/lshr recurrences in isKnownNonZero 2021-03-31 16:48:32 -07:00
Jian Cai 3cc3c0f835 Add support to -Wa,--version in clang
Clang currently only supports -Wa,--version when -no-integrated-as is
used. This adds support to -Wa,--version with -integrated-as.

Link:
https://github.com/ClangBuiltLinux/linux/issues/1320

Reviewed By: nickdesaulniers, MaskRay

Differential Revision: https://reviews.llvm.org/D99556
2021-03-31 16:29:02 -07:00
Philip Reames 115a42ad1e Add debug printers for KnownBits [nfc] 2021-03-31 15:36:07 -07:00
Simonas Kazlauskas 777a58e05b Support {S,U}REMEqFold before legalization
This allows these optimisations to apply to e.g. `urem i16` directly
before `urem` is promoted to i32 on architectures where i16 operations
are not intrinsically legal (such as on Aarch64). The legalization then
later can happen more directly and generated code gets a chance to avoid
wasting time on computing results in types wider than necessary, in the end.

Seems like mostly an improvement in terms of results at least as far as x86_64 and aarch64 are concerned, with a few regressions here and there. It also helps in preventing regressions in changes like {D87976}.

Reviewed By: lebedev.ri

Differential Revision: https://reviews.llvm.org/D88785
2021-04-01 01:35:41 +03:00
Craig Topper c88ee1a094 [RISCV] Add UnsupportedSchedZfh multiclass to reduce duplicate lines from RISCVSchedRocket.td and RISCVSchedSiFive7.td. NFC 2021-03-31 15:06:14 -07:00
YangKeao 1c268a8ff4 [X86] add dwarf annotation for inline stack probe
While probing stack, the stack register is moved without dwarf
information, which could cause panic if unwind the backtrace.
This commit only add annotation for the inline stack probe case.
Dwarf information for the loop case should be done in another
patch and need further discussion.

Reviewed By: nagisa

Differential Revision: https://reviews.llvm.org/D99579
2021-04-01 00:32:50 +03:00
natashaknk a879a1b034 [mlir][tosa] Add tosa.reciprocal and tosa.sigmoid lowerings
Lowering reciprocal and sigmoid elementwise operations to linalg dialect.

Reviewed By: rsuderman

Differential Revision: https://reviews.llvm.org/D99676
2021-03-31 14:21:03 -07:00
Jianzhou Zhao e4701471d6 [dfsan] Set sigemptyset's return label to be 0
This was not set from when the wrapper was introduced.

Reviewed By: gbalats

Differential Revision: https://reviews.llvm.org/D99678
2021-03-31 21:07:44 +00:00
Thomas Preud'homme e927053a0d [test, InferFunctionAttrs] Fix use of var defined in CHECK-NOT
LLVM test Transforms/InferFunctionAttrs/annotate contains two RUN
invokation (UNKNOWN and NVPTX lines) which involve a CHECK-NOT directive
with a variable not defined by the enabled CHECK prefixes. This commit
fixes that by:

- enabling CHECK prefix for unknown target with specialisation when it
  differs from other targets
- checking for absence of bcmp with any attribute for NVPTX

Reviewed By: tra

Differential Revision: https://reviews.llvm.org/D99589
2021-03-31 22:06:34 +01:00
Roman Lebedev 43ded90094
[NFC][LoopRotation] Count the number of instructions hoisted/cloned into preheader 2021-03-31 23:27:36 +03:00
Philip Reames e8d8754c06 Revert "Make TableGenGlobalISel an object library"
This reverts commit 2c3cf62d4a.

Causes build failures on x86_64, will respond to commit thread with link errors.
2021-03-31 13:27:00 -07:00
Aaron Puchert 2c3cf62d4a Make TableGenGlobalISel an object library
That's how it was originally intended but that wasn't possible because
we still needed to support older CMake versions.

The problem here is that the sources in TableGenGlobalISel are meant to
be linked into both llvm-tblgen and TableGenTests (a unit test), but not
be part of LLVM proper. So they shouldn't be an ordinary LLVM component.
Because they are used in llvm-tblgen, they can't draw in the LLVM dylib
dependency, but then we'd have to do the same thing in TableGenTests to
make sure we don't link both a static Support library and another copy
through the LLVM dylib.

With an object library we're just reusing the object files and don't
have to care about dependencies at all.

Reviewed By: beanz

Differential Revision: https://reviews.llvm.org/D74588
2021-03-31 22:20:56 +02:00
Alexey Bataev a28e835e94 [OPENMP]Fix PR48885: Crash in passing firstprivate args to tasks on Apple M1.
Need to bitcast the function pointer passed as a parameter to the real
type to avoid possible problem with calling conventions.

Differential Revision: https://reviews.llvm.org/D99521
2021-03-31 13:00:58 -07:00
Alexey Bataev 66da4f6fc9 [OPENMP]Fix PR48658: [OpenMP 5.0] Compiler crash when OpenMP atomic sync hints used.
No need to consider hint clause kind as the main atomic clause kind at the
codegen.

Differential Revision: https://reviews.llvm.org/D99611
2021-03-31 12:58:24 -07:00
Philip Reames 98f08e7d81 [tests] Exercise cases where SCEV can use trip counts to refine ashr/lshr recurrences 2021-03-31 12:48:50 -07:00