Jonas Devlieghere [Fri, 8 Jan 2021 04:54:30 +0000 (20:54 -0800)]
[lldb] Make DoReadMemory a protected method.
DoReadMemory is LLDB's internal implementation and shouldn't be called
directly.
Differential revision: https://reviews.llvm.org/D94284
Jonas Devlieghere [Fri, 8 Jan 2021 04:12:01 +0000 (20:12 -0800)]
[lldb] Access the ModuleList through iterators where possible (NFC)
Replace uses of GetModuleAtIndexUnlocked and
GetModulePointerAtIndexUnlocked with the ModuleIterable and
ModuleIterableNoLocking where applicable.
Differential revision: https://reviews.llvm.org/D94271
Kazu Hirata [Fri, 8 Jan 2021 04:29:35 +0000 (20:29 -0800)]
[Target] Use llvm::find_if (NFC)
Kazu Hirata [Fri, 8 Jan 2021 04:29:34 +0000 (20:29 -0800)]
[llvm] Use *Set::contains (NFC)
Kazu Hirata [Fri, 8 Jan 2021 04:29:32 +0000 (20:29 -0800)]
[CodeGen] Remove unused function isCallerPreservedOrConstPhysReg (NFC)
The last use of the function was removed on Oct 20, 2018 in commit
8d6ff4c0af843e1a61b76d89812aed91e358de34.
LLVM GN Syncbot [Fri, 8 Jan 2021 04:23:02 +0000 (04:23 +0000)]
[gn build] Port
6b0ee02747e
Artem Dergachev [Fri, 8 Jan 2021 03:23:43 +0000 (19:23 -0800)]
Revert "Revert "Revert "Revert "[analyzer] NFC: Move path diagnostic consumer implementations to libAnalysis.""""
This reverts commit
b12f26733a4259c90e5f387aceb9f23c35e003b8.
Fix dead include that looked like another missed circular dependency.
David Blaikie [Fri, 8 Jan 2021 04:04:22 +0000 (20:04 -0800)]
lldb subprogram_ranges.test - remove dependence on temp file name
David Blaikie [Fri, 8 Jan 2021 03:57:14 +0000 (19:57 -0800)]
Fix print-dot-ddg.ll so it doesn't try to write to the source tree (& uses the test temp paths instead)
David Blaikie [Fri, 8 Jan 2021 03:52:48 +0000 (19:52 -0800)]
Fix subprogram_ranges.test by explicitly using lld
Seems consistent with the way other tests in this directory do linking
Alexandre Ganea [Fri, 8 Jan 2021 03:36:59 +0000 (22:36 -0500)]
[LLD][COFF] Simplify function. NFC.
Mehdi Amini [Fri, 8 Jan 2021 02:44:33 +0000 (02:44 +0000)]
Fix MLIR DRR matching when attributes are interleaved with operands
The ODSOperand indexing should ignore the attributes.
Differential Revision: https://reviews.llvm.org/D94281
Nico Weber [Fri, 8 Jan 2021 03:02:00 +0000 (22:02 -0500)]
[gn build] (manually) merge a whole bunch of libc++ header files
I noticed __availability was missing, so I manually diffed the
file lists and put all recently(ish) added headers:
* __availability from
2eadbc86142ba
* concepts from
601f7631827ae
* execution from
0a06eb911b830
* numbers from
4f6c4b473c4a5
Also remove libcxx_install_support_headers like the CMake build did in
6706342f48bea, and unconditionally copy
support/win32/{limits_msvc_win32.h,locale_win32.h} like the CMake
build always did as far as I can tell.
LLVM GN Syncbot [Fri, 8 Jan 2021 02:19:24 +0000 (02:19 +0000)]
[gn build] Port
b12f26733a4
David Blaikie [Fri, 8 Jan 2021 01:01:17 +0000 (17:01 -0800)]
Revert "Revert "Revert "[analyzer] NFC: Move path diagnostic consumer implementations to libAnalysis."""
This reverts commit
d2ddc694ff94743d9735aaf07edcaf6db8aaca04.
This still contains a circular dependency between Analysis and CrossTU:
$ grep -r include.*Analysis clang/include/clang/CrossTU
clang/include/clang/CrossTU/CrossTranslationUnit.h:
#include "clang/Analysis/CrossTUAnalysisHelper.h"
$ grep -r include.*CrossTU clang/lib/Analysis
clang/lib/Analysis/PlistHTMLPathDiagnosticConsumer.cpp:
#include "clang/CrossTU/CrossTranslationUnit.h"
clang/lib/Analysis/PlistPathDiagnosticConsumer.cpp:
#include "clang/Analysis/CrossTUAnalysisHelper.h"
Ryan Prichard [Fri, 8 Jan 2021 01:49:29 +0000 (17:49 -0800)]
[builtins] Add COMPILER_RT_BUILTINS_HIDE_SYMBOLS
On Android, when the builtins are linked into a binary, they are
typically linked using -Wl,--exclude-libs so that the symbols aren't
reexported. For the NDK, compiler-rt's default behavior (build the
builtins archive with -fvisibility=hidden) is better so that builtins
are hidden even without -Wl,--exclude-libs.
Android needs the builtins with non-hidden symbols only for a special
case: for backwards compatibility with old binaries, the libc.so and
libm.so DSOs in the platform need to export some builtins for arm32 and
32-bit x86. See D56977.
Control the behavior with a new flag,
`COMPILER_RT_BUILTINS_HIDE_SYMBOLS`, that behaves similarly to the
`*_HERMETIC_STATIC_LIBRARY` in libunwind/libcxx/libcxxabi, so that
Android can build a special builtins variant for libc.so/libm.so.
Unlike the hermetic flags for other projects, this new flag is enabled
by default.
Reviewed By: compnerd, MaskRay
Differential Revision: https://reviews.llvm.org/D93431
clementval [Fri, 8 Jan 2021 01:07:53 +0000 (20:07 -0500)]
[clang] Add powerpc64le-none-linux-gnu to gnu toolchain for PPC64
While trying to compile clang and openmp with a freshly built clang with the gcc/7.4.0
toolchain on the Summit supercomputer I face some error because of the triple under which
the GCC toolchain is installed was not present in for PPC64LE triples.
This patch add the powerpc64le-none-linux-gnu used on system like Summit and Ascent.
Reviewed By: jdenny
Differential Revision: https://reviews.llvm.org/D94261
Ruiling Song [Thu, 17 Dec 2020 00:03:20 +0000 (08:03 +0800)]
[Cloning] Copy metadata of global declarations
We have modules with metadata on declarations, and out-of-tree passes
use that metadata, and we need to clone those modules. We really expect
such metadata is kept during the clone operation.
Reviewed by: arsenm, aprantl
Differential Revision: https://reviews.llvm.org/D93451
Alexandre Ganea [Thu, 7 Jan 2021 23:51:51 +0000 (18:51 -0500)]
Fix build after
eaadb41db6233cf1c9e882d74a31c1f9d6e211ff when the MSVC libs are not in PATH.
Evandro Menezes [Wed, 23 Dec 2020 06:43:15 +0000 (00:43 -0600)]
[RISCV] Define the vfsqrt RVV intrinsics
Define the `vfsqrt` IR intrinsics for the respective V instructions.
Authored-by: Roger Ferrer Ibanez <rofirrim@gmail.com>
Co-Authored-by: Evandro Menezes <evandro.menezes@sifive.com>
Differential Revision: https://reviews.llvm.org/D93745
Roman Lebedev [Thu, 7 Jan 2021 22:12:30 +0000 (01:12 +0300)]
[SimplifyCFG] markAliveBlocks(): switch to non-permissive DomTree updates
No actual changes needed, invoke can't have the same block as an unwind
destination and a normal destination.
Roman Lebedev [Thu, 7 Jan 2021 22:08:23 +0000 (01:08 +0300)]
[SimplifyCFG] removeUnwindEdge(): switch to non-permissive DomTree updates
No actual changes needed, Catchswitch cannot unwind to one of its catchpads.
Roman Lebedev [Thu, 7 Jan 2021 21:58:49 +0000 (00:58 +0300)]
[SimplifyCFG] changeToCall(): switch to non-permissive DomTree updates
No actual changes needed, normal and unwind destinations of an invoke
can never be identical.
Roman Lebedev [Thu, 7 Jan 2021 21:52:20 +0000 (00:52 +0300)]
[SimplifyCFG] DeleteDeadBlocks(): switch to non-permissive DomTree updates
No actual changes needed, DetatchDeadBlocks() was already doing the right thing.
Roman Lebedev [Thu, 7 Jan 2021 21:51:29 +0000 (00:51 +0300)]
[SimplifyCFG] MergeBlockIntoPredecessor(): switch to non-permissive DomTree updates
... which requires not deleting edges that were just deleted already,
by not processing the same successor more than once.
Roman Lebedev [Thu, 7 Jan 2021 20:55:21 +0000 (23:55 +0300)]
[SimplifyCFG] changeToUnreachable(): switch to non-permissive DomTree updates
... which requires not deleting edges that were just deleted already,
by not processing the same predecessor more than once.
Roman Lebedev [Thu, 7 Jan 2021 21:10:50 +0000 (00:10 +0300)]
[NFC][SimplifyCFG] Add a test with an undef cond branch to identical destinations
Roman Lebedev [Thu, 7 Jan 2021 20:32:30 +0000 (23:32 +0300)]
[SimplifyCFG] removeUnreachableBlocks(): switch to non-permissive DomTree updates
... which requires not deleting edges that were just deleted already,
by not processing the same predecessor more than once.
Roman Lebedev [Thu, 7 Jan 2021 20:23:36 +0000 (23:23 +0300)]
[NFC][SimplifyCFG] Add test with an unreachable block with two identical successors
Roman Lebedev [Thu, 7 Jan 2021 20:10:43 +0000 (23:10 +0300)]
[SimplifyCFG] TryToSimplifyUncondBranchFromEmptyBlock(): switch to non-permissive DomTree updates
... which requires not deleting edges that were just deleted already,
by not processing the same predecessor more than once.
Roman Lebedev [Thu, 7 Jan 2021 19:32:04 +0000 (22:32 +0300)]
[SimplifyCFG] ConstantFoldTerminator(): switch to non-permissive DomTree updates in `indirectbr` handling
... which requires not deleting edges that were just deleted already.
Roman Lebedev [Thu, 7 Jan 2021 19:21:50 +0000 (22:21 +0300)]
[NFC][SimlifyCFG] Add some indirectbr-of-blockaddress tests
Roman Lebedev [Thu, 7 Jan 2021 18:51:19 +0000 (21:51 +0300)]
[SimplifyCFG] ConstantFoldTerminator(): switch to non-permissive DomTree updates in `SwitchInst` handling
... which requires not deleting edges that will still be present.
Roman Lebedev [Thu, 7 Jan 2021 18:18:50 +0000 (21:18 +0300)]
[SimplifyCFG] ConstantFoldTerminator(): handle matching destinations of condbr earlier
We need to handle this case before dealing with the case of constant
branch condition, because if the destinations match, latter fold
would try to remove the DomTree edge that would still be present.
This allows to make that particular DomTree update non-permissive
Roman Lebedev [Thu, 7 Jan 2021 18:16:48 +0000 (21:16 +0300)]
[NFC][SimplifyCFG] Add a test with cond br on constant w/ identical destinations
Arthur Eubanks [Wed, 30 Dec 2020 04:48:27 +0000 (20:48 -0800)]
[NewPM][NVPTX] Port NVPTX opt passes
There are only two used in the IR optimization pipeline.
Port these and add them to the default pipeline.
Similar to https://reviews.llvm.org/D93863.
I added -mtriple to some tests since under the new PM, the passes are
only available when the TargetMachine is specified.
Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D93930
Arthur O'Dwyer [Thu, 7 Jan 2021 23:04:41 +0000 (18:04 -0500)]
[libc++] Alphabetize generate_feature_test_macro_components.py. NFCI.
For ease of comparing our list with the official SD-6 list, which is alphabetized.
https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations#library-feature-test-macros
This also alphabetizes the lists of headers in which the macros are
defined, which harmlessly alters many comments in <version>.
Also drive-by-fix some trivial flake8 warnings.
Arthur Eubanks [Wed, 30 Dec 2020 03:54:32 +0000 (19:54 -0800)]
[NewPM][Hexagon] Fix HexagonVectorLoopCarriedReusePass position in pipeline
In https://reviews.llvm.org/D88138 this was incorrectly added with
registerOptimizerLastEPCallback(), when it should be
registerLoopOptimizerEndEPCallback(), matching the legacy PM's
EP_LoopOptimizerEnd.
Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D93929
Luís Marques [Thu, 7 Jan 2021 23:01:27 +0000 (23:01 +0000)]
[LLDB][RISCV] Add RISC-V ArchSpec and rv32/rv64 variant detection
Adds the RISC-V ArchSpec bits contributed by @simoncook as part of D62732,
plus logic to distinguish between riscv32 and riscv64 based on ELF class.
The patch follows the implementation approach previously used for MIPS.
It defines RISC-V architecture subtypes and inspects the ELF header,
namely the ELF class, to detect the right subtype.
Differential Revision: https://reviews.llvm.org/D86292
Joseph Huber [Thu, 7 Jan 2021 21:43:01 +0000 (16:43 -0500)]
[OpenMP] Always print error messages in libomptarget CUDA plugin
Summary:
Currently error messages from the CUDA plugins are only printed to the user if they have debugging enabled. Change this behaviour to always print the messages that result in offloading failure. This improves the error messages by indidcating what happened when the error occurs in the plugin library, such as a segmentation fault on the device.
Reviewed by: jdoerfert
Differential Revision: https://reviews.llvm.org/D94263
Michael Liao [Thu, 7 Jan 2021 10:24:12 +0000 (05:24 -0500)]
[hip] Enable HIP compilation with `<complex`> on MSVC.
- MSVC has different `<complex>` implementation which calls into functions
declared in `<ymath.h>`. Provide their device-side implementation to enable
`<complex>` compilation on HIP Windows.
Differential Revision: https://reviews.llvm.org/D93638
Matt Arsenault [Wed, 6 Jan 2021 04:25:18 +0000 (23:25 -0500)]
GlobalISel: Fail legalization on narrowing extload below memory size
Louis Dionne [Thu, 7 Jan 2021 22:37:09 +0000 (17:37 -0500)]
[libc++] Fix typo in run-buildbot
The installation directory was never meant to contain a brace.
David Blaikie [Tue, 5 Jan 2021 06:44:59 +0000 (22:44 -0800)]
lldb: Add support for DW_AT_ranges on DW_TAG_subprograms
gcc already produces debug info with this form
-freorder-block-and-partition
clang produces this sort of thing with -fbasic-block-sections and with a
coming-soon tweak to use ranges in DWARFv5 where they can allow greater
reuse of debug_addr than the low/high_pc forms.
This fixes the case of breaking on a function name, but leaves broken
printing a variable - a follow-up commit will add that and improve the
test case to match.
Differential Revision: https://reviews.llvm.org/D94063
Alexandre Ganea [Thu, 7 Jan 2021 21:32:47 +0000 (16:32 -0500)]
[LLD][COFF] When using PCH.OBJ, ensure func_id records indices are remapped under /DEBUG:GHASH
Before this patch, when using LLD with /DEBUG:GHASH and MSVC precomp.OBJ files, we had a bunch of:
lld-link: warning: S_[GL]PROC32ID record in blabla.obj refers to PDB item index 0x206ED1 which is not a LF[M]FUNC_ID record
This was caused by LF_FUNC_ID and LF_MFUNC_ID which didn't have correct mapping to the corresponding TPI records. The root issue was that the indexMapStorage was improperly re-assembled in UsePrecompSource::remapTpiWithGHashes.
After this patch, /DEBUG and /DEBUG:GHASH produce exactly the same debug infos in the PDB.
Differential Revision: https://reviews.llvm.org/D93732
Craig Topper [Thu, 7 Jan 2021 22:15:03 +0000 (14:15 -0800)]
[TableGen] Make CodeGenDAGPatterns::getSDNodeNamed take a StringRef instead of const std::string &.
All callers use a string literal and the getDef method the string
is passed to already takes a StringRef.
David Blaikie [Thu, 7 Jan 2021 22:17:24 +0000 (14:17 -0800)]
Fixup Asserts+!AbiBreakingChecks fallout from
db33f85c7124
Arthur Eubanks [Thu, 7 Jan 2021 20:45:23 +0000 (12:45 -0800)]
[CoroSplit][NewPM] Don't call LazyCallGraph functions to split when no clones
Apparently there can be no clones, as happens in
coro-retcon-unreachable.ll.
The alternative is to allow no split functions in
addSplitRefRecursiveFunctions(), but it seems better to have the caller
make sure it's not accidentally splitting no functions out.
Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D94258
Arthur Eubanks [Thu, 7 Jan 2021 20:33:10 +0000 (12:33 -0800)]
[test] Move coro-retcon-unreachable.ll into llvm/test
Reviewed By: rjmccall
Differential Revision: https://reviews.llvm.org/D94257
Fangrui Song [Thu, 7 Jan 2021 22:05:46 +0000 (14:05 -0800)]
[libc++abi] Simplify __gxx_personality_v0
In three cases we call `scan_eh_tab` to parse LSDA:
* `actions & _UA_SEARCH_PHASE`
* `actions & _UA_CLEANUP_PHASE && actions & _UA_HANDLER_FRAME && !native_exception`
* `actions & _UA_CLEANUP_PHASE && !(actions & _UA_HANDLER_FRAME)`
Check
`actions & _UA_CLEANUP_PHASE && actions & _UA_HANDLER_FRAME && native_exception` first,
then we can move three `scan_eh_tab` into one place.
Another simplification is that we can check whether the result of `scan_eh_tab`
is `_UA_CONTINUE_UNWIND` or `_UA_FATAL_PHASE1_ERROR` first. Then many of the
original checks will be dead and can thus be deleted.
Reviewed By: #libc_abi, ldionne
Differential Revision: https://reviews.llvm.org/D93186
Jeroen Dobbelaere [Thu, 7 Jan 2021 21:39:02 +0000 (16:39 -0500)]
[NFC] clang/test/openMP/target_codegen.cpp should not depend on ssa name
This makes the test more robust to other changes.
Reviewed By: tianshilei1992
Differential Revision: https://reviews.llvm.org/D93038
Matt Arsenault [Wed, 6 Jan 2021 23:45:12 +0000 (18:45 -0500)]
GlobalISel: Add combine for G_UREM by power of 2
Really I want this in the legalizer, but this is a start.
Mehdi Amini [Thu, 7 Jan 2021 21:30:39 +0000 (21:30 +0000)]
Fix check-gdb-mlir-support build after MLIR API changed to take Context as first argument
Mehdi Amini [Thu, 7 Jan 2021 21:25:59 +0000 (21:25 +0000)]
Fix include path for check-gdb-mlir-support to include the MLIR binary dir
This fixes a build failure:
fatal error: 'mlir/IR/BuiltinTypes.h.inc' file not found
Johannes Doerfert [Thu, 7 Jan 2021 20:48:50 +0000 (14:48 -0600)]
[OpenMP][FIX] Avoid string literal comparison, use `StringRef::equal`
Eric Schweitz [Thu, 7 Jan 2021 20:50:20 +0000 (12:50 -0800)]
[mlir] Adds argument attributes for using LLVM's sret and byval attributes
to the conversion of LLVM IR dialect. These attributes are used in FIR to
support the lowering of Fortran using target-specific calling conventions.
Add roundtrip tests.
Add changes per review comments/concerns.
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D94052
Alexandre Ganea [Thu, 7 Jan 2021 20:41:47 +0000 (15:41 -0500)]
[llvm-pdbutil] Don't crash when printing unknown CodeView type records
Differential Revision: https://reviews.llvm.org/D93720
Johannes Doerfert [Wed, 6 Jan 2021 19:16:25 +0000 (13:16 -0600)]
[OpenMP][Docs] Mark finished features as done
Reviewed By: ABataev
Differential Revision: https://reviews.llvm.org/D94185
Jeffrey T Mott [Thu, 7 Jan 2021 19:56:32 +0000 (11:56 -0800)]
[clang] Change builtin object size when subobject is invalid
Motivating example:
```
struct { int v[10]; } t[10];
__builtin_object_size(
&t[0].v[11], // access past end of subobject
1 // request remaining bytes of closest surrounding
// subobject
);
```
In GCC, this returns 0. https://godbolt.org/z/7TeGs7
In current clang, however, this returns 356, the number of bytes
remaining in the whole variable, as if the `type` was 0 instead of 1.
https://godbolt.org/z/6Kffox
This patch checks for the specific case where we're requesting a
subobject's size (type 1) but the subobject is invalid.
Differential Revision: https://reviews.llvm.org/D92892
Johannes Doerfert [Thu, 24 Dec 2020 00:16:57 +0000 (18:16 -0600)]
[OpenMP][FIX] Ensure the isa trait is evaluated last
Since isa can cause diagnostics we want it to be evaluated last to avoid
the "unknown isa" warning if the rest of the selector wouldn't match
anyway. That allows us to guard isa with arch properly.
Reviewed By: jhuber6
Differential Revision: https://reviews.llvm.org/D93785
Johannes Doerfert [Wed, 23 Dec 2020 23:58:07 +0000 (17:58 -0600)]
[OpenMP][Fix] Make the arch selector for x86_64 work
The triple uses a bar "x86-64" instead of an underscore. Since we
have troubles accepting x86-64 as an identifier, we stick with
x86_64 in the frontend and translate it explicitly.
Reviewed By: tianshilei1992
Differential Revision: https://reviews.llvm.org/D93786
Johannes Doerfert [Wed, 23 Dec 2020 23:55:03 +0000 (17:55 -0600)]
[OpenMP][Docs] Add remarks intro section
Reviewed By: jhuber6
Differential Revision: https://reviews.llvm.org/D93735
Alexandre Ganea [Thu, 7 Jan 2021 19:45:40 +0000 (14:45 -0500)]
[Clang][Driver] Fix read-after-free when using /clang:
Fixes PR42501.
Differential Revision: https://reviews.llvm.org/D93772
Mehdi Amini [Thu, 7 Jan 2021 19:59:37 +0000 (19:59 +0000)]
Fix gcc5 build failure (NFC)
The loop index was shadowing the container name.
It seems that we can just not use a for-range loop here since there is
an induction variable anyway.
Differential Revision: https://reviews.llvm.org/D94254
Joseph Huber [Thu, 7 Jan 2021 18:41:49 +0000 (13:41 -0500)]
[OpenMP] Add example in Libomptarget Information docs
Add an example to the OpenMP Documentation on the LIBOMPTARGET_INFO environment variable
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D94246
dfukalov [Fri, 25 Dec 2020 15:52:14 +0000 (18:52 +0300)]
[NFC][AMDGPU] Reduce include files dependency.
Reviewed By: rampitec
Differential Revision: https://reviews.llvm.org/D93813
Reid Kleckner [Thu, 7 Jan 2021 18:21:44 +0000 (10:21 -0800)]
Simplify vectorcall argument classification of HVAs, NFC
This reduces the number of `WinX86_64ABIInfo::classify` call sites from
3 to 1. The call sites were similar, but passed different values for
FreeSSERegs. Use variables instead of `if`s to manage that argument.
Sanjay Patel [Thu, 7 Jan 2021 19:06:10 +0000 (14:06 -0500)]
[SLP] remove opcode identifier for reduction; NFC
Another step towards allowing intrinsics in reduction matching.
Alex Zinenko [Thu, 7 Jan 2021 10:29:17 +0000 (11:29 +0100)]
[mlir] don't match the text produced only in debug mode in Python tests
Some Python bindings tests were using FileCheck to match parts of the
error description produced only in the debug compilation mode. Remove
these parts (but keep the main message) to ensure tests also pass when
running them in the release compilation mode.
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D94221
Alex Zinenko [Wed, 6 Jan 2021 15:19:04 +0000 (16:19 +0100)]
[mlir] replace LLVMIntegerType with built-in integer type
The LLVM dialect type system has been closed until now, i.e. did not support
types from other dialects inside containers. While this has had obvious
benefits of deriving from a common base class, it has led to some simple types
being almost identical with the built-in types, namely integer and floating
point types. This in turn has led to a lot of larger-scale complexity: simple
types must still be converted, numerous operations that correspond to LLVM IR
intrinsics are replicated to produce versions operating on either LLVM dialect
or built-in types leading to quasi-duplicate dialects, lowering to the LLVM
dialect is essentially required to be one-shot because of type conversion, etc.
In this light, it is reasonable to trade off some local complexity in the
internal implementation of LLVM dialect types for removing larger-scale system
complexity. Previous commits to the LLVM dialect type system have adapted the
API to support types from other dialects.
Replace LLVMIntegerType with the built-in IntegerType plus additional checks
that such types are signless (these are isolated in a utility function that
replaced `isa<LLVMType>` and in the parser). Temporarily keep the possibility
to parse `!llvm.i32` as a synonym for `i32`, but add a deprecation notice.
Reviewed By: mehdi_amini, silvas, antiagainst
Differential Revision: https://reviews.llvm.org/D94178
Wouter van Oortmerssen [Wed, 6 Jan 2021 00:58:21 +0000 (16:58 -0800)]
[WebAssembly] Fixed byval args missing DWARF DW_AT_LOCATION
A struct in C passed by value did not get debug information. Such values are currently
lowered to a Wasm local even in -O0 (not to an alloca like on other archs), which becomes
a Target Index operand (TI_LOCAL). The DWARF writing code was not emitting locations
in for TI's specifically if the location is a single range (not a list).
In addition, the ExplicitLocals pass which removes the ARGUMENT pseudo instructions did
not update the associated DBG_VALUEs, and couldn't even find these values since the code
assumed such instructions are adjacent, which is not the case here.
Also fixed asm printing of TIs needed by a test.
Differential Revision: https://reviews.llvm.org/D94140
Matt Arsenault [Fri, 22 Feb 2019 18:15:39 +0000 (13:15 -0500)]
CodeGen: Refactor regallocator command line and target selection
Make the sequence of passes to select and rewrite instructions to
physical registers be a target callback. This is to prepare to allow
targets to split register allocation into multiple phases.
Hiroshi Yamauchi [Wed, 6 Jan 2021 22:42:26 +0000 (14:42 -0800)]
[PGO][PGSO] Let unroll hints take precedence over PGSO.
Differential Revision: https://reviews.llvm.org/D94199
Alexandre Ganea [Sun, 27 Dec 2020 19:15:50 +0000 (14:15 -0500)]
Silence warning: comparison of integers of different signs: 'const unsigned int' and 'const long' [-Wsign-compare]
(off_t being a signed type)
Mircea Trofin [Thu, 7 Jan 2021 16:26:45 +0000 (08:26 -0800)]
[NFC] Removed unused prefixes from CodeGen/AMDGPU
Last bulk batch.
Differential Revision: https://reviews.llvm.org/D94236
Mehdi Amini [Thu, 7 Jan 2021 17:42:55 +0000 (17:42 +0000)]
Fix GCC5 build, require explicit this->... in this call inside a lambda (NFC)
Error was:
mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp:2247:36: error: cannot call member function 'mlir::LLVM::FastmathFlags mlir::LLVM::FMFAttr::getFlags() const' without object
return bitEnumContains(getFlags(), flag);
^
Eric Schweitz [Thu, 7 Jan 2021 17:38:21 +0000 (09:38 -0800)]
Alan Phipps [Wed, 6 Jan 2021 23:40:32 +0000 (17:40 -0600)]
[Coverage] Refactor three tests from commit rG9f2967bcfe2f
Refactor three tests to not depend on other test files as input but to instead
refer to "Inputs" subdirectory.
Erich Keane [Thu, 17 Dec 2020 20:09:11 +0000 (12:09 -0800)]
Add element-type to the Vector TypeLoc types.
As shown by bug 48540, GCC vector types would cause a crash when the
declaration hada ParenType. This was because the walking of the
declaration would try to expand the 'inner' type, but there was no
ability to get it from the vector type. This patch adds that element
type access to the vector type loc objects.
Differential Revision: https://reviews.llvm.org/D93483
Thomas Preud'homme [Tue, 1 Dec 2020 18:08:31 +0000 (18:08 +0000)]
[AST][NFC] Silence GCC warning about multiline comments
Remove continuation line in code snippet to prevent GCC warning about
multiline comments (-Wcomment) when building a project using libclang
with GCC.
Reviewed By: rjmccall
Differential Revision: https://reviews.llvm.org/D92409
Kazuaki Ishizaki [Thu, 7 Jan 2021 17:09:48 +0000 (02:09 +0900)]
[mlir] NFC: fix trivial typos
fix typo under include and lib directories
Reviewed By: antiagainst
Differential Revision: https://reviews.llvm.org/D94220
Jeroen Dobbelaere [Thu, 7 Jan 2021 17:03:56 +0000 (17:03 +0000)]
[NFC] make clang/test/CodeGen/arm_neon_intrinsics.c resistent to function attribute id changes
When introducing support for @llvm.experimental.noalias.scope.decl, this tests started failing because it checks
(for no good reason) for a function attribute id of '#8' which now becomes '#9'
Reviewed By: pratlucas
Differential Revision: https://reviews.llvm.org/D94233
Eric Schweitz [Tue, 5 Jan 2021 00:32:48 +0000 (16:32 -0800)]
Adds argument attributes for using LLVM's sret and byval attributes to
the conversion of LLVM IR dialect. These attributes are used in FIR to
support the lowering of Fortran using target-specific calling
conventions.
Add roundtrip tests. Add changes per review comments/concerns.
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D94052
Varun Gandhi [Thu, 17 Dec 2020 01:01:12 +0000 (17:01 -0800)]
[IR] Use LLVM_ENABLE_ABI_BREAKING_CHECKS to guard ABI changes.
Incorrect usage of NDEBUG to guard ABI changes can prevent clients
from enabling assertions for their C++ code while having assertions in
LLVM turned off. So we use LLVM_ENABLE_ABI_BREAKING_CHECKS instead, as
described in llvm/docs/ProgrammersManual.rst. Most types already use this
macro, however, there were a couple of stragglers in ValueHandle.h, which
are fixed by this revision.
Reviewed By: dblaikie, dexonsmith
Differential Revision: https://reviews.llvm.org/D93433
Mircea Trofin [Wed, 6 Jan 2021 18:34:21 +0000 (10:34 -0800)]
[NFC] Removed unused prefixes in CodeGen/AMDGPU
This covers tests starting with s.
Differential Revision: https://reviews.llvm.org/D94184
Cameron McInally [Thu, 7 Jan 2021 15:47:50 +0000 (09:47 -0600)]
[SVE] Add unpacked scalable floating point ZIP/UZP/TRN patterns
Differential Revision: https://reviews.llvm.org/D94193
Bardia Mahjour [Thu, 7 Jan 2021 15:51:14 +0000 (10:51 -0500)]
[DDG] Data Dependence Graph - DOT printer tests
Adds some tests to check the formatting of the dot
file produced when using -dot-ddg.
Reviewed By: Meinersbur
Differential Revision: https://reviews.llvm.org/D93949
Matt Arsenault [Tue, 7 Jul 2020 21:49:52 +0000 (17:49 -0400)]
AMDGPU/GlobalISel: Start cleaning up calling convention lowering
There are various hacks working around limitations in
handleAssignments, and the logical split between different parts isn't
correct. Start separating the type legalization to satisfy going
through the DAG infrastructure from the code required to split into
register types. The type splitting should be moved to generic code.
Bardia Mahjour [Thu, 7 Jan 2021 15:31:11 +0000 (10:31 -0500)]
[DDG] Fix duplicate edge removal during pi-block formation
When creating pi-blocks we try to avoid creating duplicate edges
between outside nodes and the pi-block when an edge is of the
same kind and direction as another one that has already been
created. We do this by keeping track of the edges in an
enumerated array called EdgeAlreadyCreated. The problem is that
this array is declared local to the loop that iterates over the
nodes in the pi-block, so the information gets lost every time a
new inside-node is iterated over. The fix is to move the
declaration to the outer loop.
Reviewed By: Meinersbur
Differential Revision: https://reviews.llvm.org/D94094
Roman Lebedev [Thu, 7 Jan 2021 15:04:37 +0000 (18:04 +0300)]
[SimplifyCFG] FoldValueComparisonIntoPredecessors(): drop reachable errneous assert
I have added it in d15d81c because it *seemed* correct, was holding
for all the tests so far, and was validating the fix added in the same
commit, but as David Major is pointing out (with a reproducer),
the assertion isn't really correct after all. So remove it.
Note that the d15d81c still fine.
Roman Lebedev [Thu, 7 Jan 2021 14:28:25 +0000 (17:28 +0300)]
[llvm-reduce] ReduceGlobalVarInitializers delta pass: fix handling of globals w/ comdat/non-external linkage
Much like with ReduceFunctionBodies delta pass,
we need to remove comdat and set linkage to external,
else verifier will complain, and our deltas are invalid.
Sidharth Baveja [Thu, 7 Jan 2021 14:49:23 +0000 (14:49 +0000)]
[SplitEdge] Add new parameter to SplitEdge to name the newly created basic block
Summary:
Currently SplitEdge does not support passing in parameter which allows you to
name the newly created BasicBlock.
This patch updates the function such that the name of the block can be passed
in, if users of this utility decide to do so.
Reviewed By: Whitney, bmahjour, asbirlea, jamieschmeiser
Differential Revision: https://reviews.llvm.org/D94176
Paul C. Anagnostopoulos [Thu, 31 Dec 2020 19:50:51 +0000 (14:50 -0500)]
[TableGen] Add field kind to the RecordVal class.
Differential Revision: https://reviews.llvm.org/D93969
Valentin Clement [Thu, 7 Jan 2021 14:25:00 +0000 (09:25 -0500)]
[flang][openacc] Enforce delcare directive restriction
Add semantic check for most of the restrictions for the declare directive.
Reviewed By: kiranktp
Differential Revision: https://reviews.llvm.org/D92741
Simon Pilgrim [Thu, 7 Jan 2021 14:21:29 +0000 (14:21 +0000)]
[AArch64] SVEIntrinsicOpts - use range loop and cast<> instead of dyn_cast<> for dereferenced pointer. NFCI.
Don't directly dereference a dyn_cast<> - use cast<> so we assert for the correct type.
Also, simplify the for loop to a range loop.
Fixes clang static analyzer warning.
Simon Pilgrim [Thu, 7 Jan 2021 13:58:13 +0000 (13:58 +0000)]
[Analysis] MemoryDepChecker::couldPreventStoreLoadForward - remove dead store. NFCI.
As we're breaking from the loop when clamping MaxVF, clang static analyzer was warning that the VF iterator was being updated and never used.
Andrzej Warzynski [Thu, 7 Jan 2021 14:03:39 +0000 (14:03 +0000)]
[flang][driver] Rename driver tests (nfc)
As per [1]:
```
File names should use dashes, not underscores.
```
This patch updates the names of Flang driver tests accordingly.
[1] https://github.com/llvm/llvm-project/blob/main/flang/docs/C%2B%2Bstyle.md
Caroline Concatto [Thu, 7 Jan 2021 09:07:06 +0000 (09:07 +0000)]
[AArch64][CostModel]Fix gather scatter cost model
This patch fixes a bug introduced in the patch:
https://reviews.llvm.org/D93030
This patch pulls the test for scalable vector to be the first instruction
to be checked. This avoids the Gather and Scatter cost model for AArch64 to
compute the number of vector elements for something that is not a vector and
therefore crashing.
Jan Svoboda [Wed, 6 Jan 2021 14:18:43 +0000 (15:18 +0100)]
[clang][cli] NFC: Make parsing macro reusable
This is necessary for a future patch, where we start using this macro in another function.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D93702
Alex Zinenko [Thu, 7 Jan 2021 13:19:30 +0000 (14:19 +0100)]
[mlir] remove a use of deprecated OpState::setAttr