Commit Graph

362637 Commits

Author SHA1 Message Date
Sam Parker f2675ab45f [ARM][CostModel] Implement getCFInstrCost
As with other targets, set the throughput cost of control-flow
instructions to free so that we don't miss out of vectorization
opportunities.

Differential Revision: https://reviews.llvm.org/D85283
2020-08-05 12:44:51 +01:00
Simon Pilgrim 7b993903e0 DWARFVerifier.h - remove unnecessary forward declarations and includes. NFCI. 2020-08-05 12:42:44 +01:00
Alex Zinenko bdb9295664 [mlir] Fix convert-to-llvmir.mlir test broken due to syntax change
The syntax of the LLVM dialect types changed between the time the code
was written and it was submitted, leading to a test failure. Update the
syntax.
2020-08-05 13:29:35 +02:00
Xing GUO bd7f3f8a3e [obj2yaml] Add support for dumping the .debug_aranges section.
This patch adds support for dumping DWARF sections to obj2yaml. The
.debug_aranges section is used to illustrate the basic idea.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D85094
2020-08-05 19:19:05 +08:00
Alex Cameron a44161692a Support member expressions in bugprone-bool-pointer-implicit-conversion.
This addresses PR45189.
2020-08-05 07:14:28 -04:00
Simon Pilgrim 315e1daf7f GISelWorkList.h - remove unnecessary includes. NFCI. 2020-08-05 12:00:28 +01:00
Simon Pilgrim e3d3657b9b CallLowering.h - remove unnecessary CCState forward declaration. NFCI.
Already defined in CallingConvLower.h
2020-08-05 12:00:28 +01:00
Simon Pilgrim 300899b9c4 [X86][AVX] Add test showing unnecessary duplicate HADD instructions
Taken from internal fuzz test
2020-08-05 12:00:27 +01:00
Hans Wennborg 3ab01550b6 Revert "[CMake] Simplify CMake handling for zlib"
This quietly disabled use of zlib on Windows even when building with
-DLLVM_ENABLE_ZLIB=FORCE_ON.

> Rather than handling zlib handling manually, use find_package from CMake
> to find zlib properly. Use this to normalize the LLVM_ENABLE_ZLIB,
> HAVE_ZLIB, HAVE_ZLIB_H. Furthermore, require zlib if LLVM_ENABLE_ZLIB is
> set to YES, which requires the distributor to explicitly select whether
> zlib is enabled or not. This simplifies the CMake handling and usage in
> the rest of the tooling.
>
> This is a reland of abb0075 with all followup changes and fixes that
> should address issues that were reported in PR44780.
>
> Differential Revision: https://reviews.llvm.org/D79219

This reverts commit 10b1b4a231 and follow-ups
64d99cc6ab and
f9fec0447e.
2020-08-05 12:31:44 +02:00
Paul Walker 927fc536ca [SVE] Add lowering for fixed length vector and, or & xor operations.
Since there are no ill effects when performing these operations
with undefined elements, they are lowered to the already supported
unpredicated scalable vector equivalents.

Differential Revision: https://reviews.llvm.org/D85117
2020-08-05 11:28:34 +01:00
Simon Pilgrim 4aaf301fb8 [DAG] Fold vector (aext (load x)) -> (zext (truncate (zextload x)))
We currently don't do anything to fold any_extend vector loads as no target has such an instruction.

Instead I've added support for folding to a zextload, SimplifyDemandedBits does a good job of adjusting the zext(truncate(()) stages as required later on.

We still need the custom scalar extload handling instead of using the tryToFoldExtOfLoad helper as it has different legality tests - we can probably tweak that to reduce most of the code duplication.

Fixes the regression I mentioned in rG99a971cadff7

Differential Revision: https://reviews.llvm.org/D85129
2020-08-05 11:22:23 +01:00
Luboš Luňák 188187f062 [lldb] expect TestGuiBasicDebug.py failure on aarch64
http://lab.llvm.org:8011/builders/lldb-aarch64-ubuntu/builds/7287/steps/test/logs/stdio
fails, and the output suggests that gui 'finish' (='thread step-out') is broken
on aarch64.
2020-08-05 12:21:05 +02:00
Arpith C. Jacob fab4b59961 [mlir] Conversion of ViewOp with memory space to LLVM.
Handle the case where the ViewOp takes in a memref that has
an memory space.

Reviewed By: ftynse, bondhugula, nicolasvasilache

Differential Revision: https://reviews.llvm.org/D85048
2020-08-05 12:19:52 +02:00
Alexander Belyaev a3d427d30c [mlir] Lower RankOp to LLVM for unranked memrefs.
Differential Revision: https://reviews.llvm.org/D85273
2020-08-05 12:13:43 +02:00
Georgii Rymar f97019ad6e [llvm-readobj/elf] - Add a testing for --stackmap and refine the implementation.
Currently, we only test the `--stackmap` option here:
https://github.com/llvm/llvm-project/blob/master/llvm/test/Object/stackmap-dump.test
it uses a precompiled MachO binary currently and I've found no tests for this option for ELF.

The implementation also has issues. For example, it might assert on a wrong version
of the .llvm-stackmaps section. Or it might crash on an empty or truncated section.

This patch introduces a new tools/llvm-readobj/ELF test file as well as implements a few
basic checks to catch simple crashes/issues

It also eliminates `unwrapOrError` calls in `printStackMap()`.

Differential revision: https://reviews.llvm.org/D85208
2020-08-05 13:09:04 +03:00
Benjamin Kramer c558c22cab [llvm-symbolizer] Add legacy aliases -demangle=true and -demangle=false.
This is used in the wild, don't break compatibility for no good reason.
https://github.com/google/pprof/blob/master/internal/binutils/addr2liner_llvm.go
2020-08-05 12:07:46 +02:00
Jordan Rupprecht 4963ca4658 [docs] Document pattern of using CHECK-SAME to skip irrelevant lines
This came up during the review for D67656. It's nice but also subtle, so documenting it as an idiom will make tests easier to understand.

Reviewed By: probinson

Differential Revision: https://reviews.llvm.org/D68061
2020-08-05 11:03:56 +01:00
Luboš Luňák 138281904b Revert "[lldb] temporary commit to see why a test is failing only on lldb-aarch64-ubuntu"
This reverts commit 21f142ce1d.
2020-08-05 11:55:02 +02:00
Luboš Luňák 21f142ce1d [lldb] temporary commit to see why a test is failing only on lldb-aarch64-ubuntu 2020-08-05 11:54:14 +02:00
Frederik Gossen 4cd923784e [MLIR][Shape] Expose extent tensor type builder
The extent tensor type is a `tensor<?xindex>` that is used in the shape dialect.
To facilitate the use of this type when working with the shape dialect, we
expose the helper function for its construction.

Differential Revision: https://reviews.llvm.org/D85121
2020-08-05 09:42:57 +00:00
Pierre Gousseau 14948a08f3 [compiler-rt] Normalize some in/out doxygen parameter in interface
headers. NFC.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D84945
2020-08-05 10:17:25 +01:00
Tatyana Krasnukha bc056b3aa7 [lldb] Suppress MSVC warning C4065
MSVC reports "switch statement contains 'default' but no 'case' labels". Suppress,
as this was intended behavior.
2020-08-05 11:59:48 +03:00
Tatyana Krasnukha 75012a8044 [lldb] Use PyUnicode_GetLength instead of PyUnicode_GetSize
PyUnicode_GetSize is deprecated since Python version 3.3.
2020-08-05 11:59:47 +03:00
Tatyana Krasnukha cc68c122cd [lldb/TestingSupport] Manually disable GTEST_HAS_TR1_TUPLE
Gtest 1.8.0 uses tr1::tuple which is deprecated on MSVC. We have to force it off
to avoid the compiler warnings, which will become errors after switching on C++17
(https://devblogs.microsoft.com/cppblog/c17-feature-removals-and-deprecations).
2020-08-05 11:59:46 +03:00
David Turner ba0e71432a Do not map read-only data memory sections with EXECUTE flags.
The code in SectionMemoryManager.cpp unnecessarily maps
read-only data sections with the READ+EXECUTE flags. This is
undesirable from a security stand-point.

Moreover, on the Fuchsia platform, which is now very strict
about mapping pages with the EXECUTE permission, this simply
fails, because the section's pages were initially allocated
with only the READ+WRITE flags.

A more detailed description of the issue can be found in this
public SwiftShader bug:

  https://issuetracker.google.com/issues/154586551

This patch just restrict the mapping to the READ flag for ROData
sections. Code sections are still mapped with READ+EXECUTE as
expected.

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D78574
2020-08-05 10:51:48 +02:00
Sander de Smalen f2916636f8 [AArch64][SVE] Disable tail calls if callee does not preserve SVE regs.
This fixes an issue triggered by the following code, where emitEpilogue
got confused when trying to restore the SVE registers after the call,
whereas the call to bar() is implemented as a TCReturn:

  int non_sve();
  int sve(svint32_t x) { return non_sve(); }

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D84869
2020-08-05 09:38:54 +01:00
George Mitenkov 159806704b [MLIR][SPIRVToLLVM] Updated LLVM types in the documentation
Updated the documentation with new MLIR LLVM types for
vectors, pointers, arrays and structs. Also, changed remaining
tabs to spaces.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D85277
2020-08-05 11:18:52 +03:00
Jay Foad 8cbf4a17ac [AMDGPU] Propagate fast math flags in frem lowering
Differential Revision: https://reviews.llvm.org/D84518
2020-08-05 09:09:38 +01:00
Jay Foad 1bb07e1b91 [AMDGPU] Precommit tests for D84518 Propagate fast math flags in frem lowering 2020-08-05 09:09:02 +01:00
Jay Foad 04cf4a5a65 [AMDGPU] Lower frem f16
Without this it would fail to select on subtargets that have 16-bit
instructions.

Differential Revision: https://reviews.llvm.org/D84517
2020-08-05 09:08:40 +01:00
Andrzej Warzynski 621681e3e5 [Flang] Fix multi-config generator builds
Based on https://reviews.llvm.org/D84022 with additional changes to
maintain out-of-tree builds.

Original commit message:
Currently the binaries are output directly into the bin subdirectory of
the build directory. This doesn't work correctly with multi-config
generators which should output the binaries into <CONFIG_NAME>/bin
instead.

The original patch was implemented by David Truby and the additional
changes added here were also proposed by David Truby.

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

Co-authored-by: David Truby <david.truby@arm.com>
2020-08-05 08:59:11 +01:00
Luboš Luňák db828aba55 [lldb][gui] add a test for 'b' (toggle breakpoint)
Differential Revision: https://reviews.llvm.org/D85107
2020-08-05 09:51:13 +02:00
Luboš Luňák c7be982c83 [lldb][gui] move TestGuiBasicDebug.py to lldb/test and update it
Between the time it was created and it was pushed upstream,
99451b4453 has moved the existing
gui gui tests to lldb/test, so move this one too.
And update it to contain TestGuiBasic.py changes since the time
when it was based on that test.

Differential Revision: https://reviews.llvm.org/D85106
2020-08-05 09:51:13 +02:00
Luboš Luňák d6868d9ca1 [lldb][gui] implement breakpoint removal on breakpoint toggling
It says it toggles breakpoints, so if one already exists
on the selected location, remove it instead of adding.

Differential Revision: https://reviews.llvm.org/D85098
2020-08-05 09:51:12 +02:00
Luboš Luňák 7a63dc534e [lldb][gui] implement shift+tab for going back in views
Also simplify the code for going forward.

Differential Revision: https://reviews.llvm.org/D85089
2020-08-05 09:51:12 +02:00
Luboš Luňák 2f1b24b70c [lldb][gui] implement TerminalSizeChanged()
Differential Revision: https://reviews.llvm.org/D85088
2020-08-05 09:51:12 +02:00
Luboš Luňák c952ec15d3 [lldb] fix building with panel.h being in /usr/include/ncurses/
My openSUSE 15.2 has /usr/include/curses.h as a symlink to
/usr/include/ncurses/curses.h , but there's no such symlink
for panel.h . Prefer using /usr/include/ncurses for the includes
if they are found there by the CMake check.

Differential Revision: https://reviews.llvm.org/D85219
2020-08-05 09:51:12 +02:00
Eduardo Caldas c5cdc3e801 [SyntaxTree] Add test coverage for `->*` operator
This was the last binary operator that we supported but didn't have any
test coverage. The recent fix in a crash in member pointers allowed us
to add this test.

Differential Revision: https://reviews.llvm.org/D85185
2020-08-05 07:36:39 +00:00
George Mitenkov e739648cfa [MLIR][SPIRVToLLVM] Conversion pattern for loop op
This patch introduces a conversion of `spv.loop` to LLVM dialect.
Similarly to `spv.selection`, op's control attributes are not mapped
to LLVM yet and therefore the conversion fails if the loop control is
not `None`. Also, all blocks within the loop should be reachable in
order for conversion to succeed.

Reviewed By: mravishankar

Differential Revision: https://reviews.llvm.org/D84245
2020-08-05 10:33:54 +03:00
Yevgeny Rouban bc10888dcd DomTree: Make PostDomTree indifferent to block successors swap
Fixed the commit c35585e209.

This is a fix for the bug 46098 where PostDominatorTree
is unexpectedly changed by InstCombine's branch swapping
transformation.
This patch fixes PostDomTree builder. While looking for
the furthest away node in a reverse unreachable subgraph
this patch runs DFS with successors in their function order.
This order is indifferent to the order of successors, so is
the furthest away node.

Reviewers: kuhar, nikic, lebedev.ri
Differential Revision: https://reviews.llvm.org/D84763
2020-08-05 14:26:32 +07:00
George Mitenkov 521c0b2659 [MLIR][SPIRVToLLVM] Updated documentation for SPIR-V to LLVM conversion
Updated the documentation for SPIR-V to LLVM conversion, particularly:
- Added a section on control flow
- Added a section on memory ops
- Added a section on GLSL ops

Also, moved `spv.FunctionCall` to control flow section. Added a new section
that will be used to describe the modelling of runtime-related ops.

Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D84734
2020-08-05 09:38:45 +03:00
Martin Storsjö b989fcbae6 [llvm-rc] Allow string table values split into multiple string literals
This can practically easily be a product of combining strings with
macros in resource files.

This fixes https://github.com/mstorsjo/llvm-mingw/issues/140.

As string literals within llvm-rc are handled as StringRefs, each
referencing an uninterpreted slice of the input file, with actual
interpretation of the input string (codepage handling, unescaping etc)
done only right before writing them out to disk, it's hard to
concatenate them other than just bundling them up in a vector,
without rearchitecting a large part of llvm-rc.

This matches how the same already is supported in VersionInfoValue,
with a std::vector<IntOrString> Values.

MS rc.exe only supports concatenated string literals in version info
values (already supported), string tables (implemented in this patch)
and user data resources (easily implemented in a separate patch, but
hasn't been requested by any end user yet), while GNU windres supports
string immediates split into multiple strings anywhere (e.g. like
(100 ICON "myicon" ".ico"). Not sure if concatenation in other
statements actually is used in the wild though, in resource files
normally built by GNU windres.

Differential Revision: https://reviews.llvm.org/D85183
2020-08-05 08:59:32 +03:00
Juneyoung Lee e0d99e9aaf [JumpThreading] Consider freeze as a zero-cost instruction
This is a simple patch that makes freeze as a zero-cost instruction, as bitcast already is.

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D85023
2020-08-05 14:42:36 +09:00
Juneyoung Lee 3401f9706b [JumpThreading] Add a test for D85023; NFC 2020-08-05 13:40:14 +09:00
Mehdi Amini 1366d66a22 Revert "DomTree: Make PostDomTree immune to block successors swap"
This reverts commit c35585e209.

The MLIR is broken with this patch, reproduce by adding
-DLLVM_ENABLE_PROJECTS=mlir to the cmake configuration and
build `ninja tools/mlir/lib/IR/CMakeFiles/obj.MLIRIR.dir/Dominance.cpp.o`
2020-08-05 04:32:44 +00:00
Evgeniy Brevnov 02a629daad [BPI][NFC] Unify handling of normal and SCC based loops
This is one more NFC part extracted from D79485. Normal and SCC based loops have very different representation and have to be handled separatly each time we deal with loops. D79485 is going to introduce much more extensive use of loops what will be problematic with out this change.

Reviewed By: davidxl

Differential Revision: https://reviews.llvm.org/D84838
2020-08-05 11:19:24 +07:00
Yevgeny Rouban c35585e209 DomTree: Make PostDomTree immune to block successors swap
This is another fix for the bug 46098 where PostDominatorTree
is unexpectedly changed by InstCombine's branch swapping
transformation.
This patch fixes PostDomTree builder. While looking for
the furthest away node in a reverse unreachable subgraph
this patch runs DFS with successors in their function order.
This order is indifferent to the order of successors, so is
the furthest away node.

Reviewers: kuhar, nikic, lebedev.ri
Differential Revision: https://reviews.llvm.org/D84763
2020-08-05 11:06:54 +07:00
Matt Arsenault 93cebb190a GlobalISel: Use buildAnyExtOrTrunc 2020-08-04 22:04:04 -04:00
Matt Arsenault 1ea182ce79 GlobalISel: Simplify code
This cannot be a vector of pointers, so using getScalarSizeInBits just
added a bit extra noise.
2020-08-04 22:03:59 -04:00
Matt Arsenault 8f65c933c4 GlobalISel: Fix redundant variable and shadowing 2020-08-04 22:03:55 -04:00