Florian Hahn [Tue, 15 Sep 2020 12:50:11 +0000 (13:50 +0100)]
[ConstraintSolver] Add isConditionImplied helper.
This patch adds a isConditionImplied function that
takes a constraint and returns true if the constraint
is implied by the current constraints in the system.
Reviewed By: spatel
Differential Revision: https://reviews.llvm.org/D84545
Felix Berger [Tue, 15 Sep 2020 12:44:13 +0000 (08:44 -0400)]
Restrict UnnecessaryCopyInitialization check to variables initialized from free functions without arguments
This restriction avoids cases where an alias is returned to an argument and
which could lead to to a false positive change.
Louis Dionne [Tue, 15 Sep 2020 12:43:08 +0000 (08:43 -0400)]
[libc++] Allow building without threads in standalone builds
Setting _LIBCPP_HAS_NO_THREADS is needed when building libcxxabi without
threads in standalone mode. This is useful when target WASM. Otherwise,
you get an error like "No thread API" when building libcxxabi.
It would be better to link against a properly-configured libc++ headers
CMake target when building libc++abi instead, but we don't generate such
targets yet.
Thanks to Matthew Bauer for the patch.
Differential Revision: https://reviews.llvm.org/D60743
Simon Pilgrim [Tue, 15 Sep 2020 12:34:19 +0000 (13:34 +0100)]
LoopCacheAnalysis.h - remove unnecessary includes. NFCI.
More remaining dependencies down to LoopCacheAnalysis.cpp
Simon Pilgrim [Tue, 15 Sep 2020 12:09:03 +0000 (13:09 +0100)]
ProvenanceAnalysis.h - remove unnecessary AliasAnalysis.h include. NFCI.
Forward declare AAResults instead of the (old) AliasAnalysis type.
Simon Pilgrim [Tue, 15 Sep 2020 11:59:00 +0000 (12:59 +0100)]
AliasSetTracker.cpp - remove unnecessary includes. NFCI.
These are all directly included in AliasSetTracker.h
Sjoerd Meijer [Tue, 15 Sep 2020 12:10:30 +0000 (13:10 +0100)]
[ARM][MVE] Tail-predication: use unsigned SCEV ranges for tripcount
Loop tripcount expressions have a positive range, so use unsigned SCEV ranges
for them.
Differential Revision: https://reviews.llvm.org/D87608
Bjorn Pettersson [Mon, 14 Sep 2020 20:53:54 +0000 (22:53 +0200)]
[Scalarizer] Avoid changing name of non-instructions
The "takeName" logic in ScalarizerVisitor::gather did not consider
that the value vector could refer to non-instructions, such as
global variables. This patch make sure that we avoid changing the
name of a value if it isn't an instruction.
Reviewed By: lebedev.ri
Differential Revision: https://reviews.llvm.org/D87685
Pavel Labath [Tue, 15 Sep 2020 11:20:09 +0000 (13:20 +0200)]
[lldb] Improve qemu interop for aarch64
qemu calls the "fp" and "lr" registers via their generic names
(x29/x30). This mismatch manifested itself as not being able to unwind
or display values of some local variables.
Pavel Labath [Fri, 28 Aug 2020 10:31:16 +0000 (12:31 +0200)]
[lldb/cmake] Fix testing support library dependencies
lldbUtilityHelpers does not depend on lldbSymbolHelpers. Remove that
dependency, and add direct lldbSymbolHelpers dependencies where needed.
Hans Wennborg [Tue, 15 Sep 2020 08:47:02 +0000 (10:47 +0200)]
Revert "RegAllocFast: Record internal state based on register units"
This seems to have caused incorrect register allocation in some cases,
breaking tests in the Zig standard library (PR47278).
As discussed on the bug, revert back to green for now.
> Record internal state based on register units. This is often more
> efficient as there are typically fewer register units to update
> compared to iterating over all the aliases of a register.
>
> Original patch by Matthias Braun, but I've been rebasing and fixing it
> for almost 2 years and fixed a few bugs causing intermediate failures
> to make this patch independent of the changes in
> https://reviews.llvm.org/D52010.
This reverts commit
66251f7e1de79a7c1620659b7f58352b8c8e892e, and
follow-ups
931a68f26b9a3de853807ffad7b2cd0a2dd30922
and
0671a4c5087d40450603d9d26cf239f1a8b1367e. It also adjust some
test expectations.
Simon Pilgrim [Tue, 15 Sep 2020 11:18:06 +0000 (12:18 +0100)]
SpillPlacement.cpp - remove unnecessary includes. NFCI.
These are all directly included in SpillPlacement.h
Simon Pilgrim [Tue, 15 Sep 2020 11:00:21 +0000 (12:00 +0100)]
StatepointLowering.cpp - remove unnecessary includes. NFCI.
These are all directly included in StatepointLowering.h
Simon Pilgrim [Tue, 15 Sep 2020 10:44:47 +0000 (11:44 +0100)]
SelectionDAGBuilder.h - remove unnecessary includes. NFCI.
Reduce to forward declarations and move implicit dependencies down to the cpp files.
Florian Hahn [Tue, 15 Sep 2020 09:28:25 +0000 (10:28 +0100)]
Recommit "[ConstraintSystem] Add helpers to deal with linear constraints."
This patch recommits "[ConstraintSystem] Add helpers to deal with linear constraints."
(it reverts the revert commit
8da6ae4ce1b686c5c13698e4c5ee937811fda6f7).
The reason for the revert was using __builtin_multiply_overflow, which
is not available for all compilers. The patch has been updated to use
MulOverflow from MathExtras.h
Alex Zinenko [Mon, 14 Sep 2020 11:47:27 +0000 (13:47 +0200)]
[mlir] check for failures when packing function sigunatures in std->llvm conversion
When packing function results into a structure during the standard-to-llvm
dialect conversion, do not assume the conversion was successful and propagate
nullptr as error state.
Fixes PR45184.
Reviewed By: nicolasvasilache
Differential Revision: https://reviews.llvm.org/D87605
Jakub Lichman [Tue, 15 Sep 2020 10:07:29 +0000 (10:07 +0000)]
[mlir][integration_test] Linalg Conv folder renamed to CPU
Changing directory name to reflect naming convention discussed here:
https://llvm.discourse.group/t/vectorops-rfc-add-suite-of-integration-tests-for-vector-dialect-operations/1213
Differential Revision: https://reviews.llvm.org/D87678
Benjamin Kramer [Tue, 15 Sep 2020 10:22:47 +0000 (12:22 +0200)]
Revert "[InstCombine] Simplify select operand based on equality condition"
This reverts commit
cfff88c03cf9e9b72906a41fd11e06721d54f293. Sends
instcombine into an infinite loop.
```
define i1 @foo(i32 %arg, i32 %arg1) {
bb:
%tmp = udiv i32 %arg, %arg1
%tmp2 = mul nsw i32 %tmp, %arg1
%tmp3 = icmp eq i32 %tmp2, %arg
%tmp4 = select i1 %tmp3, i32 %tmp, i32 undef
%tmp5 = icmp sgt i32 %tmp4, 255
ret i1 %tmp5
}
```
Simon Pilgrim [Tue, 15 Sep 2020 10:18:44 +0000 (11:18 +0100)]
[X86] Update SSE/AVX integer MINMAX intrinsics to emit llvm.smax.* etc. (PR46851)
We're now getting close to having the necessary analysis/combines etc. for the new generic llvm smax/smin/umax/umin intrinsics.
This patch updates the SSE/AVX integer MINMAX intrinsics to emit the generic equivalents instead of the icmp+select code pattern.
Differential Revision: https://reviews.llvm.org/D87603
Meera Nakrani [Tue, 15 Sep 2020 10:14:30 +0000 (10:14 +0000)]
[ARM] Corrected condition in isSaturatingConditional
Fixed a small error in an if condition to prevent usat/ssat being generated if (upper constant + 1) is not a
power of 2.
Qiu Chaofan [Tue, 15 Sep 2020 09:59:10 +0000 (17:59 +0800)]
[SelectionDAG] Remove unused FP constant in getNegatedExpression
960cbc53 immediately removes nodes that won't be used to avoid
compilation time explosion. This patch adds the removal to constants to
fix PR47517.
Reviewed By: RKSimon, steven.zhang
Differential Revision: https://reviews.llvm.org/D87614
Simon Pilgrim [Tue, 15 Sep 2020 09:37:25 +0000 (10:37 +0100)]
[Transforms][Coroutines] Add missing header path to CMakeLists.txt
Helps Visual Studio check include dependencies.
Sjoerd Meijer [Tue, 15 Sep 2020 09:04:02 +0000 (10:04 +0100)]
[MVE] fix typo in llvm debug message. NFC.
Simon Pilgrim [Tue, 15 Sep 2020 09:06:35 +0000 (10:06 +0100)]
[X86] detectAVGPattern - accept non-pow2 vectors by padding.
Drop the pow2 vector limitation for AVG generation by padding the vector to the next pow2, creating the PAVG nodes and then extracting the final subvector.
Fixes some poor codegen that has been annoying me for years.....
Georgii Rymar [Sat, 5 Sep 2020 16:13:50 +0000 (19:13 +0300)]
[llvm-readobj/elf] - Simplify and refine the implementation which dumps .stack_sizes
Our implementation of stack sizes section dumping heavily uses `ELFObjectFile<ELFT>`,
while the rest of the code uses `ELFFile<ELFT>`.
That APIs are very different. `ELFObjectFile<ELFT>` is very generic
and has `SectionRef`, `RelocationRef`, `SymbolRef` and other generic concepts.
The `ELFFile<ELFT>` class works directly with `Elf_Shdr`, `Elf_Rel[a]`, `Elf_Sym` etc,
what is probably much cleaner for ELF dumper.
Also, `ELFObjectFile<ELFT>` API does not always provide a way to check
for possible errors. E.g. the implementation of `symbol_end()` does not verify the `sh_size`:
```
template <class ELFT>
basic_symbol_iterator ELFObjectFile<ELFT>::symbol_end() const {
const Elf_Shdr *SymTab = DotSymtabSec;
if (!SymTab)
return symbol_begin();
DataRefImpl Sym = toDRI(SymTab, SymTab->sh_size / sizeof(Elf_Sym));
return basic_symbol_iterator(SymbolRef(Sym, this));
}
```
There are many other examples which makes me thing we might win from
switching to `ELFFile<ELFT>` API, where we heavily validate an input data already.
This patch is the first step in this direction. I've converted the large portion of the code
to use `ELFFile<ELFT>`.
Differential revision: https://reviews.llvm.org/D87362
Petr Hosek [Tue, 15 Sep 2020 08:46:58 +0000 (01:46 -0700)]
[NFC][DebugInfo] Use consistent regex group spelling
This is a follow up to
c1f2fb5184ca.
Georgii Rymar [Wed, 9 Sep 2020 14:03:53 +0000 (17:03 +0300)]
[lib/Object] - Refine interface of ELFFile<ELFT>. NFCI.
`ELFFile<ELFT>` has many methods that take pointers,
though they assume that arguments are never null and
hence could take references instead.
This patch performs such clean-up.
Differential revision: https://reviews.llvm.org/D87385
Petar Avramovic [Tue, 15 Sep 2020 08:25:38 +0000 (10:25 +0200)]
GlobalISel/IRTranslator resetTargetOptions based on function attributes
Update TargetMachine.Options with function attributes before we start
to generate MIR instructions. This allows access to correct function
attributes via TargetMachine.Options (it used to access attributes of
the function that was translated first).
This affects some existing tests with "no-nans-fp-math" attribute.
Follow-up on D87456.
Differential Revision: https://reviews.llvm.org/D87511
Sjoerd Meijer [Tue, 15 Sep 2020 08:09:59 +0000 (09:09 +0100)]
[MVE] Rename of tests making them consistent with tail-predication tests. NFC.
Hans Wennborg [Thu, 10 Sep 2020 17:32:45 +0000 (19:32 +0200)]
[Support] Make building with snmalloc work
Differential revision: https://reviews.llvm.org/D87471
Petr Hosek [Tue, 15 Sep 2020 07:48:12 +0000 (00:48 -0700)]
[DebugInfo] Support both forward and backward slashes in tests
This addresses test failure revealed by
042c23506869.
Han Seoul-Oh [Tue, 15 Sep 2020 04:15:16 +0000 (21:15 -0700)]
[doc] Fix broken link
David Sherwood [Mon, 7 Sep 2020 08:17:10 +0000 (09:17 +0100)]
[SVE] Fix isLoadInvariantInLoop for scalable vectors
I've amended the isLoadInvariantInLoop function to bail out for
scalable vectors for now since the invariant.start intrinsic is only
ever generated by the clang frontend for thread locals or struct
and class constructors, neither of which support sizeless types.
In addition, the intrinsic itself does not currently support the
concept of a scaled size, which makes it impossible to compare
the sizes of different scalable objects, e.g. <vscale x 32 x i8>
and <vscale x 16 x i8>.
Added new tests here:
Transforms/LICM/AArch64/sve-load-hoist.ll
Transforms/LICM/hoisting.ll
Differential Revision: https://reviews.llvm.org/D87227
Vitaly Buka [Tue, 15 Sep 2020 07:22:10 +0000 (00:22 -0700)]
[NFC][Asan] Remove chunk pointer from metadata
kAllocBegMagic should be enough.
kAllocBegMagic is already set for the Secondary allocations.
kAllocBegMagic is good enough for the Primary, but it's even safer for
the Secondary allocator as all allocated block are from mmap.
Depends on D87646.
Reviewed By: morehouse
Differential Revision: https://reviews.llvm.org/D87647
Chris Hamilton [Tue, 15 Sep 2020 07:19:02 +0000 (02:19 -0500)]
[NFC] Test commit
Vitaly Buka [Tue, 15 Sep 2020 07:16:55 +0000 (00:16 -0700)]
[NFC][Asan] Return uptr as before D87646
Vitaly Buka [Tue, 15 Sep 2020 07:12:02 +0000 (00:12 -0700)]
[Asan] Cleanup kAllocBegMagic setup
Make it atomic.
Wrap it into class.
Set it late after chunk is initialized.
Reset it soon when the chunk is still valid.
Depends on D87645.
Reviewed By: morehouse
Differential Revision: https://reviews.llvm.org/D87646
Vitaly Buka [Tue, 15 Sep 2020 07:07:56 +0000 (00:07 -0700)]
[NFC][Asan] Reorder bitfields
Depends on D87644.
Reviewed By: morehouse
Differential Revision: https://reviews.llvm.org/D87645
Chris Hamilton [Tue, 15 Sep 2020 06:54:41 +0000 (01:54 -0500)]
Revert "[Sema] Address-space sensitive index check for unbounded arrays"
This reverts commit
da55e9ba1273284f1af61bceeaeb25e487838034.
Build bots uncovered coverage gap in testing. Change not ready.
Vitaly Buka [Tue, 15 Sep 2020 06:54:48 +0000 (23:54 -0700)]
[NFC][Asan] Remove from_memalign and rz_log
Before D87643 they where used to optimize UsedSize(). Which was
called frequently from leak scanner.
It was also used for calls from QuarantineCallback
but we have heavy get_allocator().Deallocate call there anyway.
Depends on D87643.
Reviewed By: morehouse
Differential Revision: https://reviews.llvm.org/D87644
Vitaly Buka [Tue, 15 Sep 2020 06:53:58 +0000 (23:53 -0700)]
[NFC][Asan] Don't use MetaData for size
Now we have enough space in the ChunkHeader.
45 bit is enough for kMaxAllowedMallocSize.
Depends on D87642.
Reviewed By: morehouse
Differential Revision: https://reviews.llvm.org/D87643
Craig Topper [Tue, 15 Sep 2020 05:41:39 +0000 (22:41 -0700)]
[X86] Pre-commit test cases for D87593
The memory operand for these is incorrect.
Vitaly Buka [Tue, 15 Sep 2020 02:44:27 +0000 (19:44 -0700)]
[NFC][lsan][fuzzer] Relax fuzzer-leak.test
With lsan we can't guarantee to catch leak on the same iteration.
Mateusz Mikuła [Tue, 15 Sep 2020 06:12:02 +0000 (09:12 +0300)]
[Windows][Polly] Disable LLVMPolly module for all compilers on Windows
Before this patch, the cmake disabled loadable modules when compiling
with Visual Studio. However, the reason for this is a limitation of the
Windows DLLs, thus this restriction should apply to any compiler for the
Windows platform, such as MinGW, Cygwin, icc, etc.
Differential Revision: https://reviews.llvm.org/D87524
Mateusz Mikuła [Tue, 15 Sep 2020 05:39:15 +0000 (08:39 +0300)]
[LLD] Allow configuring default ld.lld backend
The motivation for this is ld.lld --help targeting MinGW which
currently prints help for the ELF backend unless -m i386pe{,p} is
added. This confuses build systems that grep through linker help to
find supported flags.
This matches LD from Binutils which always prints help for MinGW
when configured to target it.
After this change, the backend can still be overridden to any
supported ELF/MinGW target by using correct -m <arch>.
Differential Revision: https://reviews.llvm.org/D87418
Martin Storsjö [Fri, 4 Sep 2020 20:42:22 +0000 (23:42 +0300)]
[llvm-readobj] [ARMWinEH] Print ARM64 packed unwind info
In addition to printing the individual fields, synthesize and
print the corresponding prolog for the unwind info (in reverse
order, to match how it's printed for non-packed unwind info).
Differential Revision: https://reviews.llvm.org/D87370
Davide Italiano [Tue, 15 Sep 2020 05:29:53 +0000 (22:29 -0700)]
[BinaryFormat/MachO] Add a missing constant.
Reference:
https://opensource.apple.com/source/cctools/cctools-949.0.1/include/mach-o/loader.h.auto.html
Igor Kudrin [Tue, 15 Sep 2020 04:32:08 +0000 (11:32 +0700)]
[DebugInfo] Make offsets of dwarf units 64-bit (19/19).
In the case of LTO, several DWARF units can be emitted in one section.
For an extremely large application, they may exceed the limit of 4GiB
for 32-bit offsets. As it is now possible to emit 64-bit debugging info,
the patch enables storing the larger offsets.
Differential Revision: https://reviews.llvm.org/D87026
Igor Kudrin [Tue, 15 Sep 2020 04:32:01 +0000 (11:32 +0700)]
[DebugInfo] Make the offset of string pool entries 64-bit (18/19).
The string pool is shared among several units in the case of LTO,
and it potentially can exceed the limit of 4GiB for an extremely
large application. As it is now possible to emit 64-bit debugging
info, the limitation can be removed.
Differential Revision: https://reviews.llvm.org/D87025
Igor Kudrin [Tue, 15 Sep 2020 04:31:55 +0000 (11:31 +0700)]
[DebugInfo] Fix emitting DWARF64 .debug_macro[.dwo] sections (17/19).
The patch fixes emitting flags and the debug_line_offset field in
the header, as well as the reference to the macro string for
a pre-standard GNU .debug_macro extension.
Differential Revision: https://reviews.llvm.org/D87024
Igor Kudrin [Tue, 15 Sep 2020 04:31:49 +0000 (11:31 +0700)]
[DebugInfo] Fix emitting DWARF64 .debug_names sections (16/19).
The patch fixes emitting the unit length field in the header of
the table and offsets to the entry pool. Note that while the patch
changes the common method to emit offsets, in fact, nothing is changed
for Apple accelerator tables, because we do not yet support DWARF64 for
those targets.
Differential Revision: https://reviews.llvm.org/D87023
Igor Kudrin [Tue, 15 Sep 2020 04:31:41 +0000 (11:31 +0700)]
[DebugInfo] Fix emitting DWARF64 .debug_addr sections (15/19).
The patch fixes emitting the header of the table. The content is
independent of the DWARF format.
Differential Revision: https://reviews.llvm.org/D87022
Igor Kudrin [Tue, 15 Sep 2020 04:31:34 +0000 (11:31 +0700)]
[DebugInfo] Fix emitting DWARF64 .debug_loclists sections (14/19).
The size of the offsets in the table depends on the DWARF format.
Differential Revision: https://reviews.llvm.org/D87020
Igor Kudrin [Tue, 15 Sep 2020 04:31:28 +0000 (11:31 +0700)]
[DebugInfo] Fix emitting DWARF64 .debug_rnglists sections (13/19).
The size of the offsets in the table depends on the DWARF format.
Differential Revision: https://reviews.llvm.org/D87019
Igor Kudrin [Tue, 15 Sep 2020 04:31:20 +0000 (11:31 +0700)]
[DebugInfo] Fix emitting pre-v5 name lookup tables in the DWARF64 format (12/19).
The transition is done by using methods of AsmPrinter which
automatically emit values in compliance with the selected DWARF format.
Differential Revision: https://reviews.llvm.org/D87013
Igor Kudrin [Tue, 15 Sep 2020 04:31:14 +0000 (11:31 +0700)]
[DebugInfo] Fix emitting DWARF64 .debug_aranges sections (11/19).
The patch fixes calculating the size of the table and emitting
the fields which depend on the DWARF format by using methods that
choose appropriate sizes automatically.
Differential Revision: https://reviews.llvm.org/D87012
Igor Kudrin [Tue, 15 Sep 2020 04:31:07 +0000 (11:31 +0700)]
[DebugInfo] Fix emitting DWARF64 type units (10/19).
The patch fixes emitting the offset to the type DIE. All other fields
are already fixed in previous patches.
Differential Revision: https://reviews.llvm.org/D87021
Igor Kudrin [Tue, 15 Sep 2020 04:31:00 +0000 (11:31 +0700)]
[DebugInfo] Fix emitting DWARF64 DWO compilation units and string offset tables (9/19).
These two fixes are better to go together because llvm-dwarfdump is
unable to dump a table when another one is malformed.
Differential Revision: https://reviews.llvm.org/D87018
Igor Kudrin [Tue, 15 Sep 2020 04:30:53 +0000 (11:30 +0700)]
[DebugInfo] Fix emitting DWARF64 .debug_str_offsets sections (8/19).
The patch fixes calculating the size of the table and emitting the unit
length field.
Differential Revision: https://reviews.llvm.org/D87017
Igor Kudrin [Tue, 15 Sep 2020 04:30:46 +0000 (11:30 +0700)]
[DebugInfo] Fix emitting the DW_AT_location attribute for 64-bit DWARFv3 (7/19).
The patch uses a common method to determine the appropriate form for
the value of the attribute.
Differential Revision: https://reviews.llvm.org/D87016
Igor Kudrin [Tue, 15 Sep 2020 04:30:38 +0000 (11:30 +0700)]
[DebugInfo] Use a common method to determine a suitable form for section offsts (6/19).
This is mostly an NFC patch because the involved methods are used when
emitting DWO files, which is incompatible with DWARFv3, or for platforms
where DWARF64 is not supported yet.
Differential Revision: https://reviews.llvm.org/D87015
Igor Kudrin [Tue, 15 Sep 2020 04:30:30 +0000 (11:30 +0700)]
[DebugInfo] Fix emitting DWARF64 compilation units (5/19).
The patch also adds a method to choose an appropriate DWARF form
to represent section offsets according to the version and the format
of producing debug info.
Differential Revision: https://reviews.llvm.org/D87014
Igor Kudrin [Tue, 15 Sep 2020 04:30:18 +0000 (11:30 +0700)]
[DebugInfo] Add the -dwarf64 switch to llc and other internal tools (4/19).
The patch adds a switch to enable emitting debug info in the 64-bit
DWARF format. Most emitter for sections will be updated in the subsequent
patches, whereas for .debug_line and .debug_frame the emitters are in
the MC library, which is already updated.
For now, the switch is enabled only for 64-bit ELF targets.
Differential Revision: https://reviews.llvm.org/D87011
Igor Kudrin [Tue, 15 Sep 2020 04:30:10 +0000 (11:30 +0700)]
[DebugInfo] Add new emitting methods for values which depend on the DWARF format (3/19).
These methods are going to be used in subsequent patches.
Differential Revision: https://reviews.llvm.org/D87010
Igor Kudrin [Tue, 15 Sep 2020 04:30:02 +0000 (11:30 +0700)]
[DebugInfo] Fix DIE value emitters to be compatible with DWARF64 (2/19).
DW_FORM_sec_offset and DW_FORM_strp imply values of different sizes with
DWARF32 and DWARF64. The patch fixes DIE value classes to use correct
sizes when emitting their values. For DIELocList it ensures that the
requested DWARF form matches the current DWARF format because that class
uses a method that selects the size automatically.
Differential Revision: https://reviews.llvm.org/D87009
Igor Kudrin [Tue, 15 Sep 2020 04:29:48 +0000 (11:29 +0700)]
[DebugInfo] Fix methods of AsmPrinter to emit values corresponding to the DWARF format (1/19).
These methods are used to emit values which are 32-bit in DWARF32 and
64-bit in DWARF64. The patch fixes them so that they choose the length
automatically, depending on the DWARF format set in the Context.
Differential Revision: https://reviews.llvm.org/D87008
Sam Clegg [Tue, 15 Sep 2020 02:20:25 +0000 (19:20 -0700)]
[lld][WebAssembly] Allow globals imports via import_name/import_module
This feature already exists but was limited to function
symbols.
Differential Revision: https://reviews.llvm.org/D87666
Petr Hosek [Tue, 15 Sep 2020 00:44:12 +0000 (17:44 -0700)]
[DebugInfo] Remove dots from getFilenameByIndex return value
When concatenating directory with filename in getFilenameByIndex, we
might end up with a path that contains extra dots. For example, if the
input is /path and ./example, we would return /path/./example. Run
sys::path::remove_dots on the output to eliminate unnecessary dots.
Differential Revision: https://reviews.llvm.org/D87657
Xun Li [Tue, 15 Sep 2020 01:56:31 +0000 (18:56 -0700)]
[Coroutines] Fix a typo in documentation
In the example, the variable that's crossing suspend point was referred wrongly, fix it.
Differential Revision: https://reviews.llvm.org/D83563
Quentin Colombet [Thu, 10 Sep 2020 01:03:00 +0000 (18:03 -0700)]
[GlobalISel] Add a `X, Y = G_UNMERGE(G_ZEXT Z)` -> X = G_ZEXT Z; Y = 0 combine
Add a combiner helper to transform unmerge of zext into one zext and
a constant 0
Differential Revision: https://reviews.llvm.org/D87427
Quentin Colombet [Sat, 5 Sep 2020 00:09:38 +0000 (17:09 -0700)]
[GlobalISel] Add `X,Y<dead> = G_UNMERGE Z` -> X = G_TRUNC Z
Add a combiner helper that replaces G_UNMERGE where all the destination lanes
are dead except the first one with a G_TRUNC.
Differential Revision: https://reviews.llvm.org/D87174
Louis Dionne [Mon, 14 Sep 2020 21:16:46 +0000 (17:16 -0400)]
[libc++abi] Do not declare __cxa_finalize and __cxa_atexit in <cxxabi.h>
These functions are not defined by libc++abi, so they don't belong in <cxxabi.h>.
Differential Revision: https://reviews.llvm.org/D75795
peter klausler [Mon, 14 Sep 2020 23:11:45 +0000 (16:11 -0700)]
[flang] Respect BZ mode in exponent parts, too
The Fortran standard discusses BZ mode (treat blanks as zero digits)
explicitly in its effect on the editing of the digits prior to the
exponent part, but doesn't mention it in description of the
exponent part. Other compilers honor BZ mode in the exponent,
so we should do so too. So "1 e 1 " is 1.E11 in BZ mode.
Differential Revision: https://reviews.llvm.org/D87653
Craig Topper [Mon, 14 Sep 2020 23:33:23 +0000 (16:33 -0700)]
[X86] Place new constant node in topological order in X86DAGToDAGISel::matchBitExtract
Fixes PR47482
Craig Topper [Mon, 14 Sep 2020 23:33:08 +0000 (16:33 -0700)]
Revert "[X86] Place new constant node in topological order in X86DAGToDAGISel::matchBitExtract."
I got the bug number wrong.
This reverts commit
32515938901685bcbc438d5f5bb03cb8a9f4c637.
peter klausler [Mon, 14 Sep 2020 21:09:01 +0000 (14:09 -0700)]
[flang] Allow Fortran comments after #include path
C-style /*comments*/ are removed during preprocessing directive
tokenization, but Fortran !comments need to be specifically
allowed.
Fixes LLVM bugzilla 47466.
Differential Revision: https://reviews.llvm.org/D87638
Philip Reames [Mon, 14 Sep 2020 23:38:48 +0000 (16:38 -0700)]
[AArch64] Statepoint support for AArch64.
Differential Revision: https://reviews.llvm.org/D66012
Patch By: loicottet (with major rebase by me)
Vitaly Buka [Mon, 14 Sep 2020 23:32:25 +0000 (16:32 -0700)]
[Asan] Accept __lsan_ignore_object for redzone pointer
The check that the pointer inside of the user part of the chunk does not
adds any value, but it's the last user of AddrIsInside.
I'd like to simplify AsanChunk in followup patches.
Reviewed By: morehouse
Differential Revision: https://reviews.llvm.org/D87642
Quentin Colombet [Fri, 4 Sep 2020 21:27:42 +0000 (14:27 -0700)]
[GlobalISel] Add G_UNMERGE(Cst) -> Cst1, Cst2, ... combine
Add a combiner helper that replaces G_UNMERGE of big constants into direct
use of smaller constants.
Differential Revision: https://reviews.llvm.org/D87166
Craig Topper [Mon, 14 Sep 2020 23:28:11 +0000 (16:28 -0700)]
[X86] Place new constant node in topological order in X86DAGToDAGISel::matchBitExtract.
Fixes PR47525
Chris Hamilton [Mon, 14 Sep 2020 23:12:12 +0000 (18:12 -0500)]
[Sema] Address-space sensitive index check for unbounded arrays
Check applied to unbounded (incomplete) arrays and pointers
to spot cases where the computed address is beyond the
largest possible addressable extent of the array, based
on the address space in which the array is delcared, or
which the pointer refers to.
Check helps to avoid cases of nonsense pointer math and
array indexing which could lead to linker failures or
runtime exceptions. Of particular interest when building
for embedded systems with small address spaces.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D86796
Krzysztof Parzyszek [Mon, 14 Sep 2020 21:37:41 +0000 (16:37 -0500)]
[Hexagon] Add more detailed testcase for widening truncates
Krzysztof Parzyszek [Mon, 14 Sep 2020 19:04:54 +0000 (14:04 -0500)]
[Hexagon] Widen loads and handle any-/sign-/zero-extensions
Krzysztof Parzyszek [Mon, 14 Sep 2020 21:06:10 +0000 (16:06 -0500)]
[Hexagon] Some HVX DAG combines
1. VINSERTW0 x, undef -> x
2. VROR (VROR x, a), b) -> VROR x, a+b
Arthur Eubanks [Tue, 1 Sep 2020 01:36:11 +0000 (18:36 -0700)]
Reland [docs][NewPM] Add docs for writing NPM passes
As to not conflict with the legacy PM example passes under
llvm/lib/Transforms/Hello, this is under HelloNew. This makes the
CMakeLists.txt and general directory structure less confusing for people
following the example.
Much of the doc structure was taken from WritinAnLLVMPass.rst.
This adds a HelloWorld pass which simply prints out each function name.
More will follow after this, e.g. passes over different units of IR, analyses.
https://llvm.org/docs/WritingAnLLVMPass.html contains a lot more.
Relanded with missing "Support" dependency in LLVMBuild.txt.
Reviewed By: ychen, asbirlea
Differential Revision: https://reviews.llvm.org/D86979
Aditya Nandakumar [Mon, 14 Sep 2020 22:43:52 +0000 (15:43 -0700)]
[GISel]: Add combine for G_FABS to G_FABS
https://reviews.llvm.org/D87554
Patch adds one new GICombinerRule for G_FABS. The combine rule folds G_FABS(G_FABS(X)) to G_FABS(X).
Patch additionally adds new combiner tests for the AArch64 target to test this new combiner rule.
Patch by mkitzan.
Arthur Eubanks [Mon, 14 Sep 2020 22:55:17 +0000 (15:55 -0700)]
Revert "[docs][NewPM] Add docs for writing NPM passes"
This reverts commit
c2590de30df23ef0db39b496cdec62a83a61fbfa.
Breaks shared libs build
Quentin Colombet [Thu, 3 Sep 2020 23:06:14 +0000 (16:06 -0700)]
[GlobalISel] Add G_UNMERGE_VALUES(G_MERGE_VALUES) combine
Add the matching and applying function to the combiner helper for
G_UNMERGE_VALUES(G_MERGE_VALUES).
This combine also supports any merge-like input nodes, like G_BUILD_VECTORS
and is robust against bitcasts in between int unmerge and merge nodes.
When the input type of the merge node and the output type of the unmerge
node are not the same, but the sizes are, the combine still applies but
creates bitcasts between the sources and the destinations instead of
reusing the destinations directly.
Long term, the artifact combiner should probably reuse that helper, but
as of today, it doesn't use any outside helper, so I kept it this way.
Differential Revision: https://reviews.llvm.org/D87117
Peter Steinfeld [Fri, 11 Sep 2020 18:02:04 +0000 (11:02 -0700)]
[flang] Fix bug for forward referenced type
A type name in an IMPLICIT declaration that was later used in a PARAMETER
statement caused problems because the default symbol scope had not yet been
initialized. I avoided dereferencing in the situation where the default scope
was uninitialized and added a test that triggers the problem.
Also, once I corrected the bad dereference, the compiler was putting out
misleading error messages. The underlying error us due to violating section
7.5.10, paragraph 4, which states:
A structure constructor shall not appear before the referenced type is
defined.
I fixed this by testing to see if a type that is used in a structure
constructor is forward referenced.
Differential Revision: https://reviews.llvm.org/D87535
zoecarver [Mon, 14 Sep 2020 22:11:08 +0000 (18:11 -0400)]
[Take 2] [libc++] Make rotate a constexpr.
This patch makes `std::rotate` a constexpr. In doing so, this patch also
updates the internal `__move` and `__move_backward` funtions to be
constexpr.
This patch was previously reverted in
ed653184ac63 because it was missing
some UNSUPPORTED markup for older compilers. This commit adds it.
Differential Revision: https://reviews.llvm.org/D65721
zoecarver [Mon, 14 Sep 2020 21:47:43 +0000 (14:47 -0700)]
Revert "[libc++] Make rotate a constexpr."
This reverts commit
1ec02efee9b1d01cde89f31ca9ba6a46b7662ac5.
peter klausler [Mon, 14 Sep 2020 20:39:52 +0000 (13:39 -0700)]
[flang] More clean-up of CookedSource API
The std::string holding the content of a CookedSource no longer
needs to be exposed in its API after the recent work that allows
the parsing context to hold multiple instances of a CookedSource.
So clean the API. These changes were extracted from some work in
progress that was made easier by the API changes.
Differential Revision: https://reviews.llvm.org/D87635
Arthur Eubanks [Mon, 14 Sep 2020 19:07:17 +0000 (12:07 -0700)]
[PruneEH][NFC] Use CallGraphUpdater in PruneEH
In preparation for porting the pass to NPM.
Reviewed By: asbirlea
Differential Revision: https://reviews.llvm.org/D87632
Lang Hames [Mon, 14 Sep 2020 21:23:20 +0000 (14:23 -0700)]
[docs] Update OrcV1 removal timeline.
Louis Dionne [Mon, 14 Sep 2020 21:05:49 +0000 (17:05 -0400)]
[libc++][test] Portability fix of std::strstreambuf constructor test
The standard does not require the constructor `strstreambuf(streamsize alsize_arg = 0)`
leave the stream array unallocated when called with parameter `alsize_arg > 0`.
Conformant implementations of this constructor may allocate minimal `alsize_arg`
number of bytes forcing `str()` method to return non-null pointer.
Thanks to Andrey Maksimov for the patch.
Differential Revision: https://reviews.llvm.org/D72465
Mehdi Amini [Mon, 14 Sep 2020 21:02:33 +0000 (21:02 +0000)]
Fix MLIR standalone example to properly handle namespace
ODS TableGen backend now requires to spell out which namespace they have
to be nested in, in an absolute way.
Nicholas-Baron [Mon, 14 Sep 2020 20:37:41 +0000 (16:37 -0400)]
[libc++] Finish implementing P0202R3
cppreference lists the support for this paper as partial.
I found 4 functions which the paper marks as `constexpr`,
but did not use the appropriate macro.
Differential Revision: https://reviews.llvm.org/D84275
zoecarver [Mon, 14 Sep 2020 20:52:42 +0000 (13:52 -0700)]
[libc++] Make rotate a constexpr.
This patch makes `std::rotate` a constexpr. In doing so, this patch also
updates the internal `__move` and `__move_backward` funtions to be
constexpr.
Reviewed By: ldionne
Differential Revision: https://reviews.llvm.org/D65721
Craig Topper [Mon, 14 Sep 2020 20:54:50 +0000 (13:54 -0700)]
[SelectionDAG] Use Align/MaybeAlign in calls to getLoad/getStore/getExtLoad/getTruncStore.
The versions that take 'unsigned' will be removed in the future.
I tried to use getOriginalAlign instead of getAlign in some
places. getAlign factors in the minimum alignment implied by
the offset in the pointer info. Since we're also passing the
pointer info we can use the original alignment.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D87592
Austin Kerbow [Mon, 14 Sep 2020 05:32:48 +0000 (22:32 -0700)]
[AMDGPU] Add XDL resource to scheduling model
Reviewed By: rampitec
Differential Revision: https://reviews.llvm.org/D87621