Commit Graph

398644 Commits

Author SHA1 Message Date
Tobias Gysi 16488dc300 [mlir][linalg] Pass all operands to tile to the tile loop region builder (NFC).
Extend the signature of the tile loop nest region builder to take all operand values to use and not just the scf::For iterArgs. This change allows us to pass in all block arguments of TiledLoop and use them directly instead of replacing them after the loop generation.

Reviewed By: pifon2a

Differential Revision: https://reviews.llvm.org/D109569
2021-09-10 08:35:11 +00:00
Petr Hosek baf1444929 [CMake] Use NOT instead of STREQUAL
`<var> STREQUAL ""` fails when `<var>` is unset which can be the
case when using runtimes as top-level build. Use `NOT` instead.

Differential Revision: https://reviews.llvm.org/D109570
2021-09-10 01:32:46 -07:00
Diana Picus b2528fc490 [clang][deps] Stop using `ClangTool` for virtual files
This patch changes how the dependency scanner creates the fake input file when scanning dependencies of a single module (introduced in D109485). The scanner now has its own `InMemoryFilesystem` which sits under the minimizing FS (when that's requested). This makes it possible to drop the duplicate work in `DependencyScanningActions::runInvocation` that sets up the main file ID. Besides that, this patch makes it possible to land D108979, where we drop `ClangTool` entirely.

Depends on D109485.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D109498
2021-09-10 10:19:27 +02:00
Sjoerd Meijer 4f9217c519 [FuncSpec] Don't specialise call sites that have the MinSize attribute set
The MinSize attribute can be attached to both the callee and the caller
in the callsite. Function specialisation was already skipped for function
declarations (callees) with MinSize. This also skips specialisations for
the callsite when it has MinSize set.

Differential Revision: https://reviews.llvm.org/D109441
2021-09-10 09:01:45 +01:00
Michał Górny 24332f0e27 [lldb] [Process/FreeBSD] Introduce mips64 FPU reg support
Differential Revision: https://reviews.llvm.org/D96766
2021-09-10 09:13:15 +02:00
Michał Górny f659bf00b4 [lldb] [test] Add synchronization fix Subprocess test flakiness
Add synchronization routines to ensure that Subprocess tests output
in a predictable order, and all test strings are output before the tests
terminate.

Differential Revision: https://reviews.llvm.org/D109495
2021-09-10 09:11:08 +02:00
Nicolas Vasilache 5f1a1af4bf [mlir][Linalg] Properly order extract_slice traversal in comprehensive bufferization
This revision fixes the traversal order of extract_slice during the inplace analysis.
It was previously thought that such ops could be analyzed at the very end.
This is unfortunately not true as the AliasInfo for dependents of these ops need to be updated.

This change allows the aliases introduced by the bufferization of extract_slice to be properly propagated.

Differential Revision: https://reviews.llvm.org/D109519
2021-09-10 07:10:06 +00:00
Alexey Lapshin 3493540830 [DebugInfo][NFC] Erase capacity in DWARFUnit::clearDIEs().
DWARFUnit::clearDIEs() uses std::vector::shrink_to_fit() to make
capacity of DieArray matched with its size(). The shrink_to_fit()
is not binding request to make capacity match with size().
Thus the memory could still be reserved after DWARFUnit::clearDIEs()
is called. This patch erases capacity when DWARFUnit::clearDIEs() is requested.
So the memory occupied by dies would be freed.

Differential Revision: https://reviews.llvm.org/D109499
2021-09-10 10:07:28 +03:00
Marius Brehler 6593cd3fe9 [mlir] Replace `include_directories`
Switches to adding target specific, private includes instead of adding
global includes.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D109494
2021-09-10 07:06:27 +00:00
Bjorn Pettersson eccb9b614f [NPM] Complementary fixes for opt option -print-pipeline-passes
Make sure we handle some more adaptors etc (such as cgscc and devirt).

Reviewed By: aeubanks

Differential Revision: https://reviews.llvm.org/D109542
2021-09-10 09:04:24 +02:00
Chris Lattner 704a395693 [APInt] Enable APInt to support zero bit integers.
Motivation: APInt not supporting zero bit values leads to
a lot of special cases in various bits of code, particularly
when using APInt as a bit vector (where you want to start with
zero bits and then concat on more.  This is particularly
challenging in the CIRCT project, where the absence of zero-bit
ConstantOp forces duplication of ops and makes instcombine-like
logic far more complicated.

Approach: zero bit integers are weird.  There are two reasonable
approaches: either make it illegal to do general arithmetic on
them (e.g. sign extends), or treat them as as implicitly having
a zero value.  This patch takes the conservative approach, which
enables their use in bitvector applications.

Differential Revision: https://reviews.llvm.org/D109555
2021-09-09 22:43:54 -07:00
Liu, Chen3 7f793b102c [X86][NFC] Remove unused encoding string: VK[1/2/4/8/16]PAIR
This is also a bug. The VK[1/2/4/8/16]PAIR here should be VK[1/2/4/8/16]Pair which has its
custom PrintMethod and ParserMatchClass. However we don't have any instructions using vvvv
and ModR/M.REG field so this issue is not exposed.

Differential Revision: https://reviews.llvm.org/D109564
2021-09-10 13:02:11 +08:00
hsmahesha 0c28814015 Revert "[AMDGPU] Split entry basic block after alloca instructions."
This reverts commit 98f4713122.

Without any (theoretical/practical) guarantee that all the allocas within
*entry* basic block are clustered together at the beginning of the block,
this patch is doomed to fail. Hence reverting it.
2021-09-10 10:23:51 +05:30
Max Kazantsev 09d0fa3bbe [Test] Add tests showing missed opportunity for SimplifyCFG for switches
Patch by Dmitry Bakunevich!
2021-09-10 11:16:13 +07:00
Yonghong Song e52617c31d BPF: change BTF_KIND_TAG format
Previously we have the following binary representation:
    struct bpf_type { name, info, type }
    struct btf_tag { __u32 component_idx; }
If the tag points to a struct/union/var/func type, we will have
   kflag = 1, component_idx = 0
if the tag points to struct/union member or func argument, we will have
   kflag = 0, component_idx = 0, ..., vlen - 1

The above rather makes interface complex to have both kflag and
component needed to determine its legality and index.

This patch simplifies the interface by removing kflag involvement.
   component_idx = (u32)-1 : tag pointing to a type
   component_idx = 0 ... vlen - 1 : tag pointing to a member or argument
and kflag is always 0 and there is no need to check.

Differential Revision: https://reviews.llvm.org/D109560
2021-09-09 19:03:57 -07:00
Zequan Wu 12f80c0bbd [DebugInfo] Emit DW_AT_inline under -g1/-gmlt
Differential Revision: https://reviews.llvm.org/D109554
2021-09-09 18:59:50 -07:00
Arthur O'Dwyer 7ba3627b54 [libc++] Clean up test_iterators.h. NFCI.
The majority of the changes here are whitespace.
Also simplify `ThrowingIterator`'s bookkeeping (NFC).
Also move some free operators into hidden friends, for sanity's sake.
Also `=delete` some more comma operators.
Also use `constexpr` in C++20 instead of `TEST_CONSTEXPR_CXX14`.

Differential Revision: https://reviews.llvm.org/D103341
2021-09-09 21:20:33 -04:00
Jason Molenda f3472ad5c5 Add specific error messages around gdb RSP handshake failures
Report timeout exceeded and connection lost error messages
when sending the initial handshake packet in a gdb remote
serial protocol connection, an especially fragile time.

Differential Revision: https://reviews.llvm.org/D108888
2021-09-09 17:02:42 -07:00
Jason Molenda 766afbc804 Don't re-define constants that are now in compact_unwind_encoding.h. 2021-09-09 17:01:43 -07:00
Fangrui Song bcc34ab6c8 [lld] Enable ANSI escape code for Windows
Buffered diagnostics need ENABLE_VIRTUAL_TERMINAL_PROCESSING after D87272.
Do it unconditionally like FileCheck.
2021-09-09 16:51:11 -07:00
Haowei Wu 38a5bd4115 [clang_format] Add fallback-style flag to clang-format-diff.py
This change adds fallback-style flag to clang-format-diff.py

Differential Revision: https://reviews.llvm.org/D109550
2021-09-09 16:36:39 -07:00
natashaknk d4d50e4710 [mlir][tosa] Add lowering for tosa.clz using scf::whileOp
Reviewed By: rsuderman

Differential Revision: https://reviews.llvm.org/D109540
2021-09-09 15:57:35 -07:00
Aart Bik 066d786ce0 [mlir][sparse] add folding to sparse_tensor.convert
folds conversion between identical types (with tests)

Reviewed By: ThomasRaoux

Differential Revision: https://reviews.llvm.org/D109545
2021-09-09 15:45:19 -07:00
Matt Arsenault 0197cd0bd4 AMDGPU: Optimize amdgpu-no-* attributes
This allows clobbering a few extra registers in the fixed ABI, and
avoids some workitem ID packing instructions.
2021-09-09 18:24:28 -04:00
Matt Arsenault db4963d080 AMDGPU: Use attributor to propagate uniform-work-group-size
Drop the legacy version in AMDGPUAnnotateKernelFeatures. This has the
side effect of now respecting the linkage, and not changing externally
visible functions.
2021-09-09 18:24:28 -04:00
Matt Arsenault 722b8e0e5a AMDGPU: Invert ABI attribute handling
Previously we assumed all callable functions did not need any
implicitly passed inputs, and added attributes to functions to
indicate when they were necessary. Requiring attributes for
correctness is pretty ugly, and it makes supporting indirect and
external calls more complicated.

This inverts the direction of the attributes, so an undecorated
function is assumed to need all implicit imputs. This enables
AMDGPUAttributor by default to mark when functions are proven to not
need a given input. This strips the equivalent functionality from the
legacy AMDGPUAnnotateKernelFeatures pass.

However, AMDGPUAnnotateKernelFeatures is not fully removed at this
point although it should be in the future. It is still necessary for
the two hacky amdgpu-calls and amdgpu-stack-objects attributes, which
would be better served by a trivial analysis on the IR during
selection. Additionally, AMDGPUAnnotateKernelFeatures still
redundantly handles the uniform-work-group-size attribute to be
removed in a future commit.

At this point when not using -amdgpu-fixed-function-abi, we are still
modifying the ABI based on these newly negated attributes. In the
future, this option will be removed and the locations for implicit
inputs will always be fixed. We will then use the new attributes to
avoid passing the values when unnecessary.
2021-09-09 18:24:28 -04:00
Philip Reames bfa2a81e92 [ScalarEvolution] Add an additional bailout to avoid NOT of pointer.
It's possible in some cases for the LHS to be a pointer where the RHS is not. This isn't directly possible for an icmp, but the analysis mixes up operands of different icmp expressions in some cases.

This does not include a test case as the smallest reduced case we've managed is extremely fragile and unlikely to test anything meaningful in the long term.

Also add an assertion to getNotSCEV() to make tracking down this sort of issue a bit easier in the future.

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

Differential Revision: https://reviews.llvm.org/D109546
2021-09-09 15:19:36 -07:00
thomasraoux 2a69790bad [mlir][sparse] Mark convert op as noSideEffect
Differential Revision: https://reviews.llvm.org/D109543
2021-09-09 14:39:09 -07:00
Philip Reames eede4846a9 [SCEV] Allow negative steps for LT exit count computation for unsigned comparisons
This bit of code is incredibly suspicious. It allows fully unknown (but potentially negative) steps, but not steps known to be negative. The comment about scev flag inference is worrying, but also not correct to my knowledge.

At best, this might be covering up some related miscompile. However, there's no test in tree for it, the review history doesn't include obvious motivation, and the C++ example doesn't appear to give wrong results when hand translated to IR. I think it's time to remove this and see what falls out.

During review, there were concerns raised about the correctness of the corresponding signed case.  This change was deliberately narrowed to the unsigned case which has been auditted and appears correct for negative values.  We need to get back to the known-negative signed case, but that'll be a future patch if nothing falls out from this one.

Differential Revision: https://reviews.llvm.org/D104140
2021-09-09 14:09:29 -07:00
Siva Chandra Reddy c5cfbe40de [libc] Skip fenv exception tests on aarch64 if HW doesn't support exceptions.
Reviewed By: michaelrj

Differential Revision: https://reviews.llvm.org/D109538
2021-09-09 20:47:59 +00:00
Amy Kwan 351a0d8a90 [PowerPC] Update PC-Relative Load/Store Patterns to use the refactored Load/Store Implementation
This patch updates the PC-Relative load and store patterns to utilize the
refactored load/store implementation introduced in D93370.

PC-Relative implementation has been added to PPCISelLowering.cpp, and also the
patterns in PPCInstrPrefix.td have been updated and no longer require AddedComplexity.
All existing test cases pass with this update.

Differential Revision: https://reviews.llvm.org/D95116
2021-09-09 15:38:42 -05:00
Julian Lettner ee0ac45672 [TSan][Darwin] Add integration tests for dyld interposition
Add integration tests for dyld interposition: DYLD_LIBRARY_PATH and
DYLD_INSERT_LIBRARIES.

DYLD_INSERT_LIBRARIES is also relevant for TSan thread
finalization/destruction sequence in the presence of additional pthread
introspection hooks (libBacktraceRecording.dylib for Xcode 'Queue
Debugging' feature).

rdar://78739125

Differential Revision: https://reviews.llvm.org/D109332
2021-09-09 22:33:59 +02:00
Nilay Vaish e976fc61ec Add "profiling" to the list of absl libraries.
Reviewed By: ymandel

Differential Revision: https://reviews.llvm.org/D109470
2021-09-09 20:31:06 +00:00
Craig Topper 9af8f1b18e [SelectionDAG] Add isZero/isAllOnes methods to ConstantSDNode.
Soft deprecrate isNullValue/isAllOnesValue and update in tree
callers. This matches the changes to the APInt interface from
D109483.

Reviewed By: lattner

Differential Revision: https://reviews.llvm.org/D109535
2021-09-09 13:28:30 -07:00
Xing Xue f53fafbacb [libc++] Add missing short wchar handling for codecvt_utf8, codecvt_utf16 and codecvt_utf8_utf16
Summary:
AIX have 2 byte wchar in 32 bit mode and 4 byte wchar in 64 bit mode.
This patch add more missing short wchar handling under the existing _LIBCPP_SHORT_WCHAR macro.

Marked test case ctor_move.pass.cpp as XFAIL for 32-bit mode on AIX because UTF-8 constants used cannot be converted to 2-byte wchar (by xingxue).

Authored by: jasonliu

Reviewed by: ldionne, zibi, SeanP, libc++

Differential Revision: https://reviews.llvm.org/D100777
2021-09-09 16:20:36 -04:00
Nikita Popov af382b9383 [IR] Handle constant expressions in containsUndefinedElement()
If the constant is a constant expression, then getAggregateElement()
will return null. Guard against this before calling HasFn().
2021-09-09 22:04:12 +02:00
Joe Nash 7f48a8aede [AMDGPU] Make fexp.ll test autogenerated
This test is very verbose and appears generated by a script.
Make it truly autogenerated for easy updates.
NFC

Reviewed By: arsenm

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

Change-Id: I1352b17b6d13ab9c5650dbe95ef0da97f71f1930
2021-09-09 15:37:28 -04:00
Craig Topper 8c4803dc93 [RISCV] Add test cases showing failure to fold splatted shift amounts across basic blocks.
We should have CGP copy the splats into the same basic block as the
shift so that SelectionDAG can fold them.
2021-09-09 12:45:30 -07:00
Eli Friedman 8f792707c4 [ScalarEvolution] Fix pointer/int confusion in howManyLessThans.
In general, howManyLessThans doesn't really want to work with pointers
at all; the result is an integer, and the operands of the icmp are
effectively integers.  However, isLoopEntryGuardedByCond doesn't like
extra ptrtoint casts, so the arguments to isLoopEntryGuardedByCond need
to be computed without those casts.

Somehow, the values got mixed up with the recent howManyLessThans
improvements; fix the confused values, and add a better comment to
explain what's happening.

Differential Revision: https://reviews.llvm.org/D109465
2021-09-09 12:38:33 -07:00
Alexander Slepko 89837a0e1b Adding min(f/s/u) and max(f/s/u) cases for vector reduction
This PR adds missing AtomicRMWKind::min/max cases which we would like to use for min/max reduction loop vectorizations.

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D104881
2021-09-09 12:00:43 -07:00
Louis Dionne 53438979fe [libc++][NFC] Consistently reindent test cases for stringbuf 2021-09-09 15:16:08 -04:00
Steven Wu 05eaa2b42f [CMake][Darwin] Ignore stderr during SDKSetting.plist parsing
Don't print stderr to commandline when configuring compiler-rt for
darwin platforms. NFC.

Reviewed By: delcypher

Differential Revision: https://reviews.llvm.org/D108156
2021-09-09 12:09:29 -07:00
Sanjay Patel 3cb5aa8622 [InstCombine] add tests for insertelement with cast ops; NFC 2021-09-09 14:58:39 -04:00
Louis Dionne 7a3d54a217 [libc++][NFC] Move misplaced XFAIL annotation
For consistency with the other surrounding tests.
2021-09-09 14:46:07 -04:00
Louis Dionne ad2b7a14f0 [libc++][NFC] Add #endif comment for long #if-#endif block 2021-09-09 14:43:10 -04:00
Jameson Nash e20f69f612 [Aarch64] Correct register class for pseudo instructions
This constrains the Mov* and similar pseudo instruction to take
GPR64common register classes rather than GPR64. GPR64 includs XZR
which is invalid here, because this pseudo instructions expands
into an adrp/add pair sharing a destination register. XZR is invalid
on add and attempting to encode it will instead increment the stack
pointer causing crashes (downstream report at [1]). The test case
there reproduces on LLVM11, but I do not have a test case that
reaches this code path on main, since it is being masked by
improved dead code elimination introduced in D91513. Nevertheless,
this seems like a good thing to fix in case there are other cases
that dead code elimination doesn't clean up (e.g. if `optnone` is
used and the optimization is skipped).

I think it would be worth auditing uses of GPR64 in pseudo
instructions to see if there are any similar issues, but I do not
have a high enough view of the backend or knowledge of the
Aarch64 architecture to do this quickly.

[1] https://github.com/JuliaLang/julia/issues/39818

Reviewed By: t.p.northover

Differential Revision: https://reviews.llvm.org/D97435
2021-09-09 14:31:49 -04:00
Artem Belevich d99a83b4e5 [NVPTX] Simplify and generalize constant printer.
This allows handling i128 values and fixes
https://bugs.llvm.org/show_bug.cgi?id=51789.

Differential Revision: https://reviews.llvm.org/D109458
2021-09-09 11:30:19 -07:00
Louis Dionne 367a9e709d [libc++][NFC] Remove remnants of _LIBCPP_HAS_NO_STDOUT, which should have been removed by 87dd51983c 2021-09-09 14:27:31 -04:00
Saiyedul Islam 543604f30e [clang-nvlink-wrapper][docs][NFC] Fix sphinx warning about asterisk
Sphinx was giving warning on unescaped special symbol *. It was
an issue on systems treating warning as error.
2021-09-09 23:55:15 +05:30
Simon Pilgrim ea685e1028 [X86][AVX] Update _mm256_loadu2_m128* intrinsics to use _mm256_set_m128* (PR51796)
As reported on PR51796, the _mm256_loadu2_m128i in particular was inserting bitcasts and shuffles with different types making it trickier for some combines, and prevented the value tracker from identifying the shuffle sequences as a single insert_subvector style concat_vectors pattern.

This patch instead concatenate the 128-bit unaligned loads with _mm256_set_m128*, which was written to avoid the unnecessary bitcasts and only emits a single shuffle.

Differential Revision: https://reviews.llvm.org/D109497
2021-09-09 19:15:48 +01:00