Nico Weber [Thu, 17 Sep 2020 10:33:24 +0000 (06:33 -0400)]
[gn build] (manually) port
c9af34027bc
Vincent Zhao [Wed, 16 Sep 2020 15:04:09 +0000 (16:04 +0100)]
[MLIR] Turns swapId into a FlatAffineConstraints member func
`swapId` used to be a static function in `AffineStructures.cpp`. This diff makes it accessible from the external world by turning it into a member function of `FlatAffineConstraints`. This will be very helpful for other projects that need to manipulate the content of `FlatAffineConstraints`.
Differential Revision: https://reviews.llvm.org/D87766
Simon Pilgrim [Wed, 16 Sep 2020 18:02:20 +0000 (19:02 +0100)]
[AsmPrinter] DwarfDebug - use DebugLoc const references where possible. NFC.
Avoid unnecessary copies.
Simon Pilgrim [Wed, 16 Sep 2020 18:01:42 +0000 (19:01 +0100)]
[AMDGPU] Remove orphan SITargetLowering::LowerINT_TO_FP declaration. NFCI.
Method implementation no longer exists.
Simon Pilgrim [Wed, 16 Sep 2020 17:52:28 +0000 (18:52 +0100)]
[AsmPrinter] Remove orphan DwarfUnit::shareAcrossDWOCUs declaration. NFCI.
Method implementation no longer exists.
Jakub Lichman [Thu, 17 Sep 2020 09:26:30 +0000 (09:26 +0000)]
[mlir][Linalg] Convolution tiling added to ConvOp vectorization pass
ConvOp vectorization supports now only convolutions of static shapes with dimensions
of size either 3(vectorized) or 1(not) as underlying vectors have to be of static
shape as well. In this commit we add support for convolutions of any size as well as
dynamic shapes by leveraging existing matmul infrastructure for tiling of both input
and kernel to sizes accepted by the previous version of ConvOp vectorization.
In the future this pass can be extended to take "tiling mask" as a user input which
will enable vectorization of user specified dimensions.
Differential Revision: https://reviews.llvm.org/D87676
Cullen Rhodes [Fri, 11 Sep 2020 15:18:44 +0000 (15:18 +0000)]
[clang][aarch64] ACLE: Support implicit casts between GNU and SVE vectors
This patch adds support for implicit casting between GNU vectors and SVE
vectors when `__ARM_FEATURE_SVE_BITS==N`, as defined by the Arm C
Language Extensions (ACLE, version 00bet5, section 3.7.3.3) for SVE [1].
This behavior makes it possible to use GNU vectors with ACLE functions
that operate on VLAT. For example:
typedef int8_t vec __attribute__((vector_size(32)));
vec f(vec x) { return svasrd_x(svptrue_b8(), x, 1); }
Tests are also added for implicit casting between GNU and fixed-length
SVE vectors created by the 'arm_sve_vector_bits' attribute. This
behavior makes it possible to use VLST with existing interfaces that
operate on GNUT. For example:
typedef int8_t vec1 __attribute__((vector_size(32)));
void f(vec1);
#if __ARM_FEATURE_SVE_BITS==256 && __ARM_FEATURE_SVE_VECTOR_OPERATORS
typedef svint8_t vec2 __attribute__((arm_sve_vector_bits(256)));
void g(vec2 x) { f(x); } // OK
#endif
The `__ARM_FEATURE_SVE_VECTOR_OPERATORS` feature macro indicates
interoperability with the GNU vector extension. This is the first patch
providing support for this feature, which once complete will be enabled
by the `-msve-vector-bits` flag, as the `__ARM_FEATURE_SVE_BITS` feature
currently is.
[1] https://developer.arm.com/documentation/100987/latest
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D87607
David Spickett [Tue, 15 Sep 2020 13:49:48 +0000 (14:49 +0100)]
[lldb] Don't send invalid region addresses to lldb server
Previously when <addr> in "memory region <addr>" didn't
parse correctly, we'd print an error then also ask lldb-server
for a region containing LLDB_INVALID_ADDRESS.
(lldb) memory region not_an_address
error: invalid address argument "not_an_address"...
error: Server returned invalid range
Only send the command to lldb-server if the address
parsed correctly.
(lldb) memory region not_an_address
error: invalid address argument "not_an_address"...
Reviewed By: labath
Differential Revision: https://reviews.llvm.org/D87694
Rainer Orth [Thu, 17 Sep 2020 09:17:11 +0000 (11:17 +0200)]
[X86] Fix stack alignment on 32-bit Solaris/x86
On Solaris/x86, several hundred 32-bit tests `FAIL`, all in the same way:
env ASAN_OPTIONS=halt_on_error=false ./halt_on_error_suppress_equal_pcs.cpp.tmp
Segmentation Fault (core dumped)
They segfault during startup:
Thread 2 received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1 (LWP 1)]
0x080f21f0 in __sanitizer::internal_mmap(void*, unsigned long, int, int, int, unsigned long long) () at /vol/llvm/src/llvm-project/dist/compiler-rt/lib/sanitizer_common/sanitizer_solaris.cpp:65
65 int prot, int flags, int fd, OFF_T offset) {
1: x/i $pc
=> 0x80f21f0 <_ZN11__sanitizer13internal_mmapEPvmiiiy+16>: movaps 0x30(%esp),%xmm0
(gdb) p/x $esp
$3 = 0xfeffd488
The problem is that `movaps` expects 16-byte alignment, while 32-bit Solaris/x86
only guarantees 4-byte alignment following the i386 psABI.
This patch updates `X86Subtarget::initSubtargetFeatures` accordingly,
handles Solaris/x86 in the corresponding testcase, and allows for some
variation in address alignment in
`compiler-rt/test/ubsan/TestCases/TypeCheck/vptr.cpp`.
Tested on `amd64-pc-solaris2.11` and `x86_64-pc-linux-gnu`.
Differential Revision: https://reviews.llvm.org/D87615
Douglas Yung [Thu, 17 Sep 2020 08:28:32 +0000 (01:28 -0700)]
Revert "Re-land: Add new hidden option -print-changed which only reports changes to IR"
The test added in this commit is failing on Windows bots:
http://lab.llvm.org:8011/builders/llvm-clang-win-x-armv7l/builds/1269
This reverts commit
f9e6d1edc0dad9afb26e773aa125ed62c58f7080 and follow-up commit
6859d95ea2d0f3fe0de2923a3f642170e66a1a14.
Roman Lebedev [Thu, 17 Sep 2020 08:08:26 +0000 (11:08 +0300)]
[NFC] EliminateDuplicatePHINodes(): small-size optimization: if there are <= 32 PHI's, O(n^2) algo is faster (geomean -0.08%)
This is functionally equivalent to the old implementation.
As per https://llvm-compile-time-tracker.com/compare.php?from=
5f4e9bf6416e45eba483a4e5e263749989fdb3b3&to=
4739e6e4eb54d3736e6457249c0919b30f6c855a&stat=instructions
this is a clear geomean compile-time regression-free win with overall geomean of `-0.08%`
32 PHI's appears to be the sweet spot; both the 16 and 64 performed worse:
https://llvm-compile-time-tracker.com/compare.php?from=
5f4e9bf6416e45eba483a4e5e263749989fdb3b3&to=
c4efe1fbbfdf0305ac26cd19eacb0c7774cdf60e&stat=instructions
https://llvm-compile-time-tracker.com/compare.php?from=
5f4e9bf6416e45eba483a4e5e263749989fdb3b3&to=
e4989d1c67010d3339d1a40ff5286a31f10cfe82&stat=instructions
If we have more PHI's than that, we fall-back to the original DenseSet-based implementation,
so the not-so-fast cases will still be handled.
However compile-time isn't the main motivation here.
I can name at least 3 limitations of this CSE:
1. Assumes that all PHI nodes have incoming basic blocks in the same order (can be fixed while keeping the DenseMap)
2. Does not special-handle `undef` incoming values (i don't see how we can do this with hashing)
3. Does not special-handle backedge incoming values (maybe can be fixed by hashing backedge as some magical value)
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D87408
Jay Foad [Wed, 16 Sep 2020 10:13:45 +0000 (11:13 +0100)]
[SplitKit] Only copy live lanes
When splitting a live interval with subranges, only insert copies for
the lanes that are live at the point of the split. This avoids some
unnecessary copies and fixes a problem where copying dead lanes was
generating MIR that failed verification. The test case for this is
test/CodeGen/AMDGPU/splitkit-copy-live-lanes.mir.
Without this fix, some earlier live range splitting would create %430:
%430 [256r,848r:0)[848r,2584r:1) 0@256r 1@848r L0000000000000003 [848r,2584r:0) 0@848r L0000000000000030 [256r,2584r:0) 0@256r weight:1.480938e-03
...
256B undef %430.sub2:vreg_128 = V_LSHRREV_B32_e32 16, %20.sub1:vreg_128, implicit $exec
...
848B %430.sub0:vreg_128 = V_AND_B32_e32 %92:sreg_32, %20.sub1:vreg_128, implicit $exec
...
2584B %431:vreg_128 = COPY %430:vreg_128
Then RAGreedy::tryLocalSplit would split %430 into %432 and %433 just
before 848B giving:
%432 [256r,844r:0) 0@256r L0000000000000030 [256r,844r:0) 0@256r weight:3.066802e-03
%433 [844r,848r:0)[848r,2584r:1) 0@844r 1@848r L0000000000000030 [844r,2584r:0) 0@844r L0000000000000003 [844r,844d:0)[848r,2584r:1) 0@844r 1@848r weight:2.831776e-03
...
256B undef %432.sub2:vreg_128 = V_LSHRREV_B32_e32 16, %20.sub1:vreg_128, implicit $exec
...
844B undef %433.sub0:vreg_128 = COPY %432.sub0:vreg_128 {
internal %433.sub2:vreg_128 = COPY %432.sub2:vreg_128
848B }
%433.sub0:vreg_128 = V_AND_B32_e32 %92:sreg_32, %20.sub1:vreg_128, implicit $exec
...
2584B %431:vreg_128 = COPY %433:vreg_128
Note that the copy from %432 to %433 at 844B is a curious
bundle-without-a-BUNDLE-instruction that SplitKit creates deliberately,
and it includes a copy of .sub0 which is not live at this point, and
that causes it to fail verification:
*** Bad machine code: No live subrange at use ***
- function: zextload_global_v64i16_to_v64i64
- basic block: %bb.0 (0x7faed48) [0B;2848B)
- instruction: 844B undef %433.sub0:vreg_128 = COPY %432.sub0:vreg_128
- operand 1: %432.sub0:vreg_128
- interval: %432 [256r,844r:0) 0@256r L0000000000000030 [256r,844r:0) 0@256r weight:3.066802e-03
- at: 844B
Using real bundles with a BUNDLE instruction might also fix this
problem, but the current fix is less invasive and also avoids some
unnecessary copies.
https://bugs.llvm.org/show_bug.cgi?id=47492
Differential Revision: https://reviews.llvm.org/D87757
Jay Foad [Wed, 16 Sep 2020 19:28:02 +0000 (20:28 +0100)]
[AMDGPU] Generate test checks for splitkit-copy-bundle.mir
This is a pre-commit for D87757 "[SplitKit] Only copy live lanes".
Sjoerd Meijer [Thu, 17 Sep 2020 07:47:39 +0000 (08:47 +0100)]
[Lint] Add check for intrinsic get.active.lane.mask
As @efriedma pointed out in D86301, this "not equal to 0 check" of
get.active.lane.mask's second operand needs to live here in Lint and not the
Verifier.
Differential Revision: https://reviews.llvm.org/D87228
Qiu Chaofan [Thu, 17 Sep 2020 08:00:54 +0000 (16:00 +0800)]
[SelectionDAG] Check any use of negation result before removal
2508ef01 fixed a bug about constant removal in negation. But after
sanitizing check I found there's still some issue about it so it's
reverted.
Temporary nodes will be removed if useless in negation. Before the
removal, they'd be checked if any other nodes used it. So the removal
was moved after getNode. However in rare cases the node to be removed is
the same as result of getNode. We missed that and will be fixed by this
patch.
Reviewed By: steven.zhang
Differential Revision: https://reviews.llvm.org/D87614
Tres Popp [Tue, 15 Sep 2020 16:28:59 +0000 (18:28 +0200)]
[mlir] Remove redundant shape.cstr_broadcastable canonicalization.
These canonicalizations are already handled by folding which will occur
in a superset of situations, so they are being removed.
Differential Revision: https://reviews.llvm.org/D87706
Fangrui Song [Thu, 17 Sep 2020 06:18:46 +0000 (23:18 -0700)]
[llvm-cov gcov] Add --demangled-names (-m)
gcov 4.9 introduced the option.
Artur Bialas [Thu, 17 Sep 2020 05:53:52 +0000 (22:53 -0700)]
[mlir][spirv] Add GroupNonUniformBroadcastOp
Added GroupNonUniformBroadcastOp to spirv dialect.
Differential Revision: https://reviews.llvm.org/D87688
Igor Kudrin [Thu, 17 Sep 2020 05:47:38 +0000 (12:47 +0700)]
[DebugInfo] Simplify DIEInteger::SizeOf().
An AsmPrinter should always be provided to the method because some forms
depend on its parameters. The only place in the codebase which passed
a nullptr value was found in the unit tests, so the patch updates it to
use some dummy AsmPrinter instead.
Differential Revision: https://reviews.llvm.org/D85293
Fangrui Song [Thu, 17 Sep 2020 05:41:30 +0000 (22:41 -0700)]
[llvm-cov gcov][test] Move tests to gcov/
And rename llvm-cov.test (misnomer) to basic.test
Craig Topper [Thu, 17 Sep 2020 04:56:01 +0000 (21:56 -0700)]
Add __divmodti4 to match libgcc.
gcc has used this on x86-64 since at least version 7.
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D80506
Jonas Devlieghere [Thu, 17 Sep 2020 04:11:40 +0000 (21:11 -0700)]
[lldb] Return FileSP and StreamFileSP by value in IOHandler (NFC)
Smart pointers should be returned by value.
Jianzhou Zhao [Thu, 17 Sep 2020 04:02:19 +0000 (04:02 +0000)]
Fix the arguments of std::min
fixing
https://github.com/llvm/llvm-project/commit/
11201315d5881a135faa5aa87f415ce03f99eb96
Jianzhou Zhao [Thu, 17 Sep 2020 03:48:36 +0000 (03:48 +0000)]
Add the header of std::min
fixing
https://github.com/llvm/llvm-project/commit/
11201315d5881a135faa5aa87f415ce03f99eb96
Jianzhou Zhao [Sat, 12 Sep 2020 19:35:17 +0000 (19:35 +0000)]
Flush bitcode incrementally for LTO output
Bitcode writer does not flush buffer until the end by default. This is
fine to small bitcode files. When -flto,--plugin-opt=emit-llvm,-gmlt are
used, the final bitcode file is large, for example, >8G. Keeping all
data in memory consumes a lot of memory.
This change allows bitcode writer flush data to disk early when buffered
data size is above some threshold. This is only enabled when lld emits
LLVM bitcode.
One issue to address is backpatching bitcode: subblock length, function
body indexes, meta data indexes need to backfill. If buffer can be
flushed partially, we introduced raw_fd_stream that supports
read/seek/write, and enables backpatching bitcode flushed in disk.
Reviewed-by: tejohnson, MaskRay
Differential Revision: https://reviews.llvm.org/D86905
LLVM GN Syncbot [Thu, 17 Sep 2020 03:02:00 +0000 (03:02 +0000)]
[gn build] Port
a895040eb02
Stella Stamenova [Thu, 17 Sep 2020 03:00:43 +0000 (20:00 -0700)]
Revert "[IRSim] Adding IR Instruction Mapper"
This reverts commit
b04c1a9d3127730c05e8a22a0e931a12a39528df.
David Blaikie [Tue, 15 Sep 2020 19:49:53 +0000 (12:49 -0700)]
debug_rnglists/symbolizing: reduce memory usage by not caching rnglists
This matches the debug_ranges behavior - though is currently implemented
differently. (the debug_ranges parsing was handled by creating a new
ranges parser during DIE address querying, and just destroying it after
the query - whereas the rnglists parser is a member of the DWARFUnit
currently - so the API doesn't cache anymore)
I think this could/should be improved by not parsing debug_rnglists
headers at all when dumping debug_info or symbolizing - do it the way
DWARF (roughly) intended: take the rnglists_base, add addr*index to it,
read the offset, parse the list at rnglists_base+offset. This would have
no error checking for valid index (because the number of valid indexes
is stored in the header, which has a negative offset from rnglists_base
- and is sort of only intended for use by dumpers, not by parsers going
from debug_info to a rnglist) or out of contribution bounds access
(since it wouldn't know the length of the contribution, also in the
header) - nor any error-checking that the rnglist contribution was using
the same properties as the debug_info (version, DWARF32/64, address
size, etc).
Eric Christopher [Wed, 16 Sep 2020 22:52:50 +0000 (15:52 -0700)]
Use zu rather than llu format specifier for size_t (-Wformat warning fix).
Qiu Chaofan [Thu, 17 Sep 2020 02:19:09 +0000 (10:19 +0800)]
[PowerPC] Fix store-fptoi combine of f128 on Power8
llc would crash for (store (fptosi-f128-i32)) when -mcpu=pwr8, we should
not generate FP_TO_(S|U)INT_IN_VSR for f128 types at this time. This
patch fixes it.
Reviewed By: steven.zhang
Differential Revision: https://reviews.llvm.org/D86686
Chen Zheng [Thu, 17 Sep 2020 01:51:53 +0000 (21:51 -0400)]
[MachineSink] add one more mir case - nfc
Ryan Prichard [Wed, 16 Sep 2020 08:22:55 +0000 (01:22 -0700)]
[libunwind][DWARF] Fix end of .eh_frame calculation
* When .eh_frame is located using .eh_frame_hdr (PT_GNU_EH_FRAME), the
start of .eh_frame is known, but not the size. In this case, the
unwinder must rely on a terminator present at the end of .eh_frame.
Set dwarf_section_length to UINTPTR_MAX to indicate this.
* Add a new field, text_segment_length, that the FrameHeaderCache uses
to track the size of the PT_LOAD segment indicated by dso_base.
* Compute ehSectionEnd by adding sectionLength to ehSectionStart,
never to fdeHint.
Fixes PR46829.
Differential Revision: https://reviews.llvm.org/D87750
LLVM GN Syncbot [Thu, 17 Sep 2020 01:54:10 +0000 (01:54 +0000)]
[gn build] Port
b04c1a9d312
zhanghb97 [Mon, 14 Sep 2020 14:52:22 +0000 (22:52 +0800)]
[mlir] expose affine map to C API
This patch provides C API for MLIR affine map.
- Implement C API for AffineMap class.
- Add Utils.h to include/mlir/CAPI/, and move the definition of the CallbackOstream to Utils.h to make sure mlirAffineMapPrint work correct.
- Add TODO for exposing the C API related to AffineExpr and mutable affine map.
Differential Revision: https://reviews.llvm.org/D87617
Andrew Litteken [Thu, 17 Sep 2020 01:24:29 +0000 (20:24 -0500)]
[IRSim] Adding IR Instruction Mapper
This introduces the IRInstructionMapper, and the associated wrapper for
instructions, IRInstructionData, that maps IR level Instructions to
unsigned integers.
Mapping is done mainly by using the "isSameOperationAs" comparison
between two instructions. If they return true, the opcode, result type,
and operand types of the instruction are used to hash the instruction
with an unsigned integer. The mapper accepts instruction ranges, and
adds each resulting integer to a list, and each wrapped instruction to
a separate list.
At present, branches, phi nodes are not mapping and exception handling
is illegal. Debug instructions are not considered.
The different mapping schemes are tested in
unittests/Analysis/IRSimilarityIdentifierTest.cpp
Differential Revision: https://reviews.llvm.org/D86968
Arthur Eubanks [Tue, 15 Sep 2020 02:01:38 +0000 (19:01 -0700)]
[NewPM] Port -print-alias-sets to NPM
Really it should be named print<alias-sets>, but for the sake of
changing fewer tests, added a TODO to rename after NPM switch and test
cleanup.
Reviewed By: ychen
Differential Revision: https://reviews.llvm.org/D87713
Richard Smith [Thu, 17 Sep 2020 01:08:03 +0000 (18:08 -0700)]
PR47555: Inheriting constructors are implicitly definable.
Don't forget to define them if they're constexpr and used inside a
template; we might try to evaluate a call to them before the template is
instantiated.
Richard Smith [Wed, 2 Sep 2020 21:42:37 +0000 (14:42 -0700)]
Canonicalize declaration pointers when forming APValues.
References to different declarations of the same entity aren't different
values, so shouldn't have different representations.
Recommit of
e6393ee813178e9d3306b8e3c6949a4f32f8a2cb with fixed
handling for weak declarations. We now look for attributes on the most
recent declaration when determining whether a declaration is weak.
Alina Sbirlea [Tue, 15 Sep 2020 01:07:44 +0000 (18:07 -0700)]
[MemorySSA] Rename uses in blocks with Phis.
Renaming should include blocks with existing Phis.
Resolves PR45927.
Differential Revision: https://reviews.llvm.org/D87661
Craig Topper [Wed, 16 Sep 2020 23:37:36 +0000 (16:37 -0700)]
[DAGCombiner] Teach visitMSTORE to replace an all ones mask with an unmasked store.
Similar to what done in D87788 for MLOAD.
Again I've skipped indexed, truncating, and compressing stores.
Daniel Kiss [Wed, 16 Sep 2020 21:55:46 +0000 (23:55 +0200)]
[AArch64] Add -mmark-bti-property flag.
Writing the .note.gnu.property manually is error prone and hard to
maintain in the assembly files.
The -mmark-bti-property is for the assembler to emit the section with the
GNU_PROPERTY_AARCH64_FEATURE_1_BTI. To be used when C/C++ is compiled
with -mbranch-protection=bti.
This patch refactors the .note.gnu.property handling.
Reviewed By: chill, nickdesaulniers
Differential Revision: https://reviews.llvm.org/D81930
Reland with test dependency on aarch64 target.
Daniel Kiss [Wed, 16 Sep 2020 23:17:23 +0000 (01:17 +0200)]
Revert "[AArch64] Add -mmark-bti-property flag."
This reverts commit
95e43f84b7b9c61011aece7583c0367297dd67d8.
ogiroux [Wed, 16 Sep 2020 23:12:10 +0000 (16:12 -0700)]
Commenting out atomics with padding to unbreak MSAN tests
Shilei Tian [Wed, 16 Sep 2020 22:54:11 +0000 (18:54 -0400)]
[Flang] Fixed installation permission of the "binary" flang
Under current configuration, the permission of `flang` after installation is 700.
This could bring a problem for system administrators who build and install flang
for other users, which only the user who builds LLVM can execute it, and others
can not. In this patch, the explicit permission setting in the `install` command
is removed, and let CMake determine what perssion to be used like other components.
Reviewed By: DavidTruby
Differential Revision: https://reviews.llvm.org/D87783
Michael Liao [Wed, 16 Sep 2020 22:21:10 +0000 (18:21 -0400)]
[EarlyCSE] Simplify max/min pattern matching. NFC.
Nico Weber [Wed, 16 Sep 2020 22:28:51 +0000 (18:28 -0400)]
[gn build] (manually) port
1321160a2
Daniel Kiss [Wed, 16 Sep 2020 21:55:46 +0000 (23:55 +0200)]
[AArch64] Add -mmark-bti-property flag.
Writing the .note.gnu.property manually is error prone and hard to
maintain in the assembly files.
The -mmark-bti-property is for the assembler to emit the section with the
GNU_PROPERTY_AARCH64_FEATURE_1_BTI. To be used when C/C++ is compiled
with -mbranch-protection=bti.
This patch refactors the .note.gnu.property handling.
Reviewed By: chill, nickdesaulniers
Differential Revision: https://reviews.llvm.org/D81930
jasonliu [Wed, 16 Sep 2020 21:51:41 +0000 (21:51 +0000)]
Disable a large test for EXPENSIVE_CHECKS and debug build
Summary:
When running a large test in LLVM_ENABLE_EXPENSIVE_CHECKS=ON mode,
buildbot could hit timeout.
Disable the test when this mode is on.
Also disable it for debug so that the test won't hang for too long.
Reviewed By: hubert.reinterpretcast
Differential Revision: https://reviews.llvm.org/D87794
Peter Steinfeld [Wed, 16 Sep 2020 21:42:30 +0000 (14:42 -0700)]
[flang] Substrings with lower bound greater than upper bound
According to section 9.4.1, paragraph 3,
If the starting point is greater than the ending point, the substring has
length zero
But the compilers code for substring processing was failing a call to `CHECK()`
in this case. I fixed this by just setting the number of items in the
resulting string to 0 for this situation.
Differential Revision: https://reviews.llvm.org/D87799
Daniel Kiss [Wed, 16 Sep 2020 21:03:19 +0000 (23:03 +0200)]
[libunwind] Support for leaf function unwinding.
Unwinding leaf function is useful in cases when the backtrace finds a
leaf function for example when it caused a signal.
This patch also add the support for the DW_CFA_undefined because it marks
the end of the frames.
Ryan Prichard provided code for the tests.
Reviewed By: #libunwind, mstorsjo
Differential Revision: https://reviews.llvm.org/D83573
Yaxun (Sam) Liu [Wed, 22 Jul 2020 19:31:53 +0000 (15:31 -0400)]
[NFC] Refactor DiagnosticBuilder and PartialDiagnostic
PartialDiagnostic misses some functions compared to DiagnosticBuilder.
This patch refactors DiagnosticBuilder and PartialDiagnostic, extracts
the common functionality so that the streaming << operators are
shared.
Differential Revision: https://reviews.llvm.org/D84362
Jordan Rupprecht [Wed, 16 Sep 2020 21:26:40 +0000 (14:26 -0700)]
[lldb/test] Enable faulthandler in dotest
Register the `faulthandler` module so we can see what lldb tests are doing when they misbehave (e.g. run under a test runner that sets a timeout). This will print a stack trace for the following signals:
- `SIGSEGV`, `SIGFPE`, `SIGABRT`, `SIGBUS`, and `SIGILL` (via `faulthandler.enable()`)
- `SIGTERM` (via `faulthandler.register(SIGTERM)`) [This is what our test runners sends when it times out].
The only signal we currently handle is `SIGINT` (via `unittest2.signals.installHandler()`) so there should be no overlap added by this patch.
Because this import is not available until python3, and the `register()` method is not available on Windows, this is enabled defensively.
This should have absolutely no effect when tests are passing (or even normally failing), but can be observed by running this while ninja is running:
```
kill -s SIGTERM $(ps aux | grep dotest.py | head -1 | awk '{print $2}')
```
Reviewed By: JDevlieghere
Differential Revision: https://reviews.llvm.org/D87637
Rahman Lavaee [Wed, 16 Sep 2020 21:17:02 +0000 (14:17 -0700)]
[obj2yaml] - Match ".stack_size" with the original section name, and not the uniquified name.
Without this patch, obj2yaml decodes the content of only one ".stack_size" section. Other sections are dumped with their full contents.
Reviewed By: grimar, MaskRay
Differential Revision: https://reviews.llvm.org/D87727
Mircea Trofin [Wed, 16 Sep 2020 15:36:58 +0000 (08:36 -0700)]
[NFC][regalloc] type LiveInterval::reg() as Register
We have the Register type which precisely captures the role of this
member. Storage-wise, it's an unsigned.
This helps readability & maintainability.
Differential Revision: https://reviews.llvm.org/D87768
Fangrui Song [Wed, 16 Sep 2020 21:03:34 +0000 (14:03 -0700)]
[ELF] Bump the limit of thunk creation passes from 10 to 15
I have noticed that a 374MiB powerpc64le 'ld.lld' requires 11 passes to link.
There is a ThunkSection (whose parent OutputSection is ".text" of 169MiB) with 12867 thunks.
Vitaly Buka [Wed, 16 Sep 2020 08:14:55 +0000 (01:14 -0700)]
[NFC][LSAN] Change SuspendedThreadsList interface
Remove RegisterCount and let GetRegistersAndSP to resize buffer as needed.
Reviewed By: morehouse
Differential Revision: https://reviews.llvm.org/D87747
Stanislav Mekhanoshin [Wed, 16 Sep 2020 20:43:45 +0000 (13:43 -0700)]
[AMDGPU] gfx1030 test update. NFC.
Amy Huang [Wed, 16 Sep 2020 20:51:36 +0000 (13:51 -0700)]
Revert "Do not apply calling conventions to MSVC entry points"
This reverts commit
4cff1b40dacf6a5489b09657d94ea4757b8cd3b0.
Caused "undefined symbol: _WinMain@16" link errors.
Lang Hames [Wed, 16 Sep 2020 20:46:55 +0000 (13:46 -0700)]
[ORC] Add operations to create and lookup JITDylibs to OrcV2 C bindings.
Petr Hosek [Wed, 16 Sep 2020 20:48:19 +0000 (13:48 -0700)]
Revert "[lsan] Share platform allocator settings between ASan and LSan"
This reverts commit
c57df3dc09e8b59c55c83ba5c354569a82a5c3b8 which broke
Windows sanitizer bots.
Petr Hosek [Wed, 16 Sep 2020 20:18:41 +0000 (13:18 -0700)]
[lsan] Share platform allocator settings between ASan and LSan
This moves the platform-specific parameter logic from asan into
sanitizer_common so lsan can reuse it.
Patch By: mcgrathr
Differential Revision: https://reviews.llvm.org/D85930
Craig Topper [Wed, 16 Sep 2020 20:21:15 +0000 (13:21 -0700)]
[DAGCombiner] Teach visitMLOAD to replace an all ones mask with an unmasked load
If we have an all ones mask, we can just a regular masked load. InstCombine already gets this in IR. But the all ones mask can appear after type legalization.
Only avx512 test cases are affected because X86 backend already looks for element 0 and the last element being 1. It replaces this with an unmasked load and blend. The all ones mask is a special case of that where the blend will be removed. That transform is only enabled on avx2 targets. I believe that's because a non-zero passthru on avx2 already requires a separate blend so its more profitable to handle mixed constant masks.
This patch adds a dedicated all ones handling to the target independent DAG combiner. I've skipped extending, expanding, and index loads for now. X86 doesn't use index so I don't know much about it. Extending made me nervous because I wasn't sure I could trust the memory VT had the right element count due to some weirdness in vector splitting. For expanding I wasn't sure if we needed different undef handling.
Differential Revision: https://reviews.llvm.org/D87788
Craig Topper [Wed, 16 Sep 2020 19:20:38 +0000 (12:20 -0700)]
[X86] Add test case for a masked load mask becoming all ones after type legalization.
We should be able to turn this into a unmasked load. X86 has an
optimization to detect that the first and last element aren't masked
and then turn the whole thing into an unmasked load and a blend.
That transform is disabled on avx512 though.
But if we know the blend isn't needed, then the unmasked load by
itself should always be profitable.
Michael Kruse [Wed, 16 Sep 2020 19:58:29 +0000 (14:58 -0500)]
[flang][msvc] Work around if constexpr (false) evaluation. NFC.
MSVC tries to expand templates that are in the false-branch of a `if constexpr` construct. In this case, the condition checks whether a tuple has at least one element and then is trying to access it using `std::get<0>`, which fails when the tuple has 0 elements.
The workaround is to extract that case into a separate method.
This patch is part of the series to make flang compilable with MS Visual Studio <http://lists.llvm.org/pipermail/flang-dev/2020-July/000448.html>.
Reviewed By: klausler
Differential Revision: https://reviews.llvm.org/D87728
Philip Reames [Wed, 16 Sep 2020 19:54:15 +0000 (12:54 -0700)]
[aarch64][tests] Add tests which show current lack of implicit null support
I will be posting a patch which adds appropriate target support shortly; landing the tests so that the diffs are clear.
David Greene [Thu, 23 Jan 2020 20:30:32 +0000 (14:30 -0600)]
[UpdateTestChecks] Allow $ in function names
Some compilers generation functions with '$' in their names, so recognize those
functions.
This also requires recognizing function names inside quotes in some contexts in
order to escape certain characters.
Differential Revision: https://reviews.llvm.org/D82995
LLVM GN Syncbot [Wed, 16 Sep 2020 19:03:25 +0000 (19:03 +0000)]
[gn build] Port
56069b5c71c
Nikita Popov [Thu, 10 Sep 2020 16:45:53 +0000 (18:45 +0200)]
Reapply [InstCombine] Simplify select operand based on equality condition
Reapply after fixing SimplifyWithOpReplaced() to never return
the original value, which would lead to an infinite loop in this
transform.
-----
For selects of the type X == Y ? A : B, check if we can simplify A
by using the X == Y equality and replace the operand if that's
possible. We already try to do this in InstSimplify, but will only
fold if the result of the simplification is the same as B, in which
case the select can be dropped entirely. Here the select will be
retained, just one operand simplified.
As we are performing an actual replacement here, we don't have
problems with refinement / poison values.
Differential Revision: https://reviews.llvm.org/D87480
Nikita Popov [Wed, 16 Sep 2020 18:49:08 +0000 (20:49 +0200)]
[InstSimplify] Clarify SimplifyWithOpReplaced() return value
If SimplifyWithOpReplaced() cannot simplify the value, null should
be returned. Make sure this really does happen in all cases,
including those where SimplifyBinOp() returns the original value.
This does not matter for existing users, but does mattter for
D87480, which would go into an infinite loop otherwise.
Nikita Popov [Wed, 16 Sep 2020 16:27:55 +0000 (18:27 +0200)]
[InstCombine] Add test for infinite combine loop (NFC)
Test courtesy of bkramer for the infinite combine loop introduced
by D87480.
Michael Liao [Wed, 16 Sep 2020 18:43:08 +0000 (14:43 -0400)]
Fix build.
Nico Weber [Wed, 16 Sep 2020 18:50:29 +0000 (14:50 -0400)]
[gn build] unconfuse sync script about "sources = []" in clang/lib/Headers/BUILD.gn
Fanbo Meng [Wed, 16 Sep 2020 17:52:28 +0000 (13:52 -0400)]
[SystemZ][z/OS] Set aligned allocation unavailable by default for z/OS
Aligned allocation is not supported on z/OS. This patch sets -faligned-alloc-unavailable as default in z/OS toolchain.
Reviewed By: abhina.sreeskantharajan, hubert.reinterpretcast
Differential Revision: https://reviews.llvm.org/D87611
Rahman Lavaee [Wed, 16 Sep 2020 18:41:54 +0000 (11:41 -0700)]
Revert "[obj2yaml] - Match ".stack_size" with the original section name, and not the uniquified name."
This reverts commit
14e55f82980cf1342d4d3eea4885a5375e829496.
Stanislav Mekhanoshin [Wed, 16 Sep 2020 18:09:25 +0000 (11:09 -0700)]
[AMDGPU] gfx1030 RT support
Differential Revision: https://reviews.llvm.org/D87782
Johannes Doerfert [Thu, 6 Aug 2020 20:46:44 +0000 (15:46 -0500)]
[OpenMP] Support `std::complex` math functions in target regions
The last (big) missing piece to get "math" working in OpenMP target
regions (that I know of) was complex math functions, e.g.,
`std::sin(std::complex<double>)`. With this patch we overload the system
template functions for these operations with versions that have been
distilled from `libcxx/include/complex`. We use the same
`omp begin/end declare variant`
mechanism we use for other math functions before, except that we this
time overload templates (via D85735).
Reviewed By: JonChesterfield
Differential Revision: https://reviews.llvm.org/D85777
Johannes Doerfert [Sun, 31 May 2020 16:40:09 +0000 (11:40 -0500)]
[OpenMP] Context selector extensions for template functions
With this extension the effects of `omp begin declare variant` will be
applied to template function declarations. The behavior is opt-in and
controlled by the `extension(allow_templates)` trait. While generally
useful, this will enable us to implement complex math function calls by
overloading the templates of the standard library with the ones in
libc++.
Reviewed By: JonChesterfield
Differential Revision: https://reviews.llvm.org/D85735
Johannes Doerfert [Wed, 12 Aug 2020 21:45:46 +0000 (16:45 -0500)]
[OpenMP] Overload `std::isnan` and friends multiple times for the GPU
`std::isnan` and friends can be found in two variants in the wild, one
returns `bool`, as the standard defines it, one returns `int`, as the C
macros do. So far we kinda hoped the system versions of these functions
will work for people, e.g. they are definitions that can be compiled for
the target. We know that is not the case always so we leverage the
`disable_implicit_base` OpenMP context extension to specialize both
versions of these functions without causing an invalid redeclaration.
Reviewed By: JonChesterfield, tra
Differential Revision: https://reviews.llvm.org/D85879
Johannes Doerfert [Wed, 12 Aug 2020 21:49:10 +0000 (16:49 -0500)]
[OpenMP] Context selector extensions for return value overloading
This extension allows to declare variants in between `omp begin/end
declare variant` that do not match the type of the existing function
with that name. Without this extension we would not find a base function
(with a compatible type), therefore create a new one, which would
cause conflicting declarations. With this extension we will not create
"missing" base functions, which basically renders these specializations
harmless. They will be generated but never called.
Reviewed By: JonChesterfield
Differential Revision: https://reviews.llvm.org/D85878
Johannes Doerfert [Thu, 13 Aug 2020 06:05:51 +0000 (01:05 -0500)]
[OpenMP] Support nested OpenMP context selectors (declare variant)
Due to `omp begin/end declare variant`, OpenMP context selectors can be
nested. This patch adds initial support for this so we can use it for
target math variants. We should improve the detection of "equivalent"
scores and user conditions, we should also revisit the data structures
of the OMPTraitInfo object, however, both are not pressing issues right
now.
Reviewed By: JonChesterfield
Differential Revision: https://reviews.llvm.org/D85877
Johannes Doerfert [Thu, 13 Aug 2020 06:12:31 +0000 (01:12 -0500)]
[OpenMP][FIX] Do not drop a '$' while demangling declare variant names
Reviewed By: ABataev
Differential Revision: https://reviews.llvm.org/D85876
Johannes Doerfert [Thu, 13 Aug 2020 00:44:25 +0000 (19:44 -0500)]
[OpenMP][FIX] Do not crash trying to print a missing (demangled) user condition
Reviewed By: JonChesterfield
Differential Revision: https://reviews.llvm.org/D85875
Johannes Doerfert [Fri, 14 Aug 2020 01:25:02 +0000 (20:25 -0500)]
[UpdateTestChecks][NFC] Fix spelling
Patrick Beard [Thu, 30 Jul 2020 21:43:46 +0000 (14:43 -0700)]
Add '<' meta command to read in code from external file
Perform all error handling in ReadCode()
Add :help text describing “< path”, add extra line before Commands
Differential Revision: https://reviews.llvm.org/D87640
Rahman Lavaee [Wed, 16 Sep 2020 18:31:21 +0000 (11:31 -0700)]
[obj2yaml] - Match ".stack_size" with the original section name, and not the uniquified name.
Without this patch, obj2yaml decodes the content of only one ".stack_size" section. Other sections are dumped with their full contents.
Reviewed By: grimar, MaskRay
Differential Revision: https://reviews.llvm.org/D87727
Matt Arsenault [Sat, 22 Aug 2020 16:34:38 +0000 (12:34 -0400)]
GlobalISel: Lift store value widening restriction
This doesn't change the memory size and doesn't need to worry about
non-power-of-2 sizes.
Nico Weber [Wed, 16 Sep 2020 18:21:14 +0000 (14:21 -0400)]
[gn build] make "all" target build
If you want to build everything, building the default target
via just `ninja` is better, but `ninja all` shouldn't give you
compile errors -- this fixes that.
Amara Emerson [Wed, 16 Sep 2020 18:19:08 +0000 (11:19 -0700)]
[AArch64][GlobalISel] Make G_BUILD_VECTOR os <16 x s8> legal.
Michael Liao [Wed, 16 Sep 2020 12:52:02 +0000 (08:52 -0400)]
[clang][codegen] Skip adding default function attributes on intrinsics.
- After loading builtin bitcode for linking, skip adding default
function attributes on LLVM intrinsics as their attributes are
well-defined and retrieved directly from internal definitions. Adding
extra attributes on intrinsics results in inconsistent result when
`-save-temps` is present. Also, that makes few optimizations
conservative.
Differential Revision: https://reviews.llvm.org/D87761
Zequan Wu [Wed, 16 Sep 2020 18:03:04 +0000 (11:03 -0700)]
fix test no-rtti.cpp
Saleem Abdulrasool [Wed, 9 Sep 2020 22:43:37 +0000 (22:43 +0000)]
Sema: add support for `__attribute__((__swift_bridge__))`
This extends semantic analysis of attributes for Swift interoperability
by introducing the `swift_bridge` attribute. This attribute enables
bridging Objective-C types to Swift specific types.
This is based on the work of the original changes in
https://github.com/llvm/llvm-project-staging/commit/
8afaf3aad2af43cfedca7a24cd817848c4e95c0c
Differential Revision: https://reviews.llvm.org/D87532
Reviewed By: Aaron Ballman
Matt Morehouse [Tue, 15 Sep 2020 17:33:23 +0000 (10:33 -0700)]
[libFuzzer] Enable entropic by default.
Entropic has performed at least on par with vanilla scheduling on
Clusterfuzz, and has shown a slight coverage improvement on FuzzBench:
https://www.fuzzbench.com/reports/2020-08-31/index.html
Reviewed By: Dor1s
Differential Revision: https://reviews.llvm.org/D87476
Zequan Wu [Tue, 15 Sep 2020 20:44:22 +0000 (13:44 -0700)]
[Sema][MSVC] warn at dynamic_cast/typeid when /GR- is given
Differential Revision: https://reviews.llvm.org/D86369
Michael Kitzan [Sat, 22 Aug 2020 06:11:22 +0000 (23:11 -0700)]
[GISel] Add new combines for unary FP instrs with constant operand
https://reviews.llvm.org/D86393
Patch adds five new `GICombinerRules`, one for each of the following unary
FP instrs: `G_FNEG`, `G_FABS`, `G_FPTRUNC`, `G_FSQRT`, and `G_FLOG2`. The
combine rules perform the FP operation on the constant operand and replace
the original instr with the result. Patch additionally adds new combiner
tests for the AArch64 target to test these new combiner rules.
Simon Pilgrim [Wed, 16 Sep 2020 17:32:03 +0000 (18:32 +0100)]
DwarfUnit.h - remove unnecessary includes. NFCI.
Simon Pilgrim [Wed, 16 Sep 2020 17:11:39 +0000 (18:11 +0100)]
raw_ostream.cpp - remove duplicate includes. NFCI.
Remove headers already included in raw_ostream.h
Simon Pilgrim [Wed, 16 Sep 2020 17:09:30 +0000 (18:09 +0100)]
InterferenceCache.cpp - remove duplicate includes. NFCI.
Remove headers already included in InterferenceCache.h
Simon Pilgrim [Wed, 16 Sep 2020 17:08:32 +0000 (18:08 +0100)]
ValueEnumerator.cpp - remove duplicate includes. NFCI.
Remove headers already included in ValueEnumerator.h
Sanjay Patel [Wed, 16 Sep 2020 14:59:30 +0000 (10:59 -0400)]
[SLP] add tests for reduction ordering; NFC
Fangrui Song [Wed, 16 Sep 2020 17:24:58 +0000 (10:24 -0700)]
[llvm-nm] Use aggregate initialization instead of memset zero