Andrew Wei [Fri, 20 Nov 2020 16:35:53 +0000 (00:35 +0800)]
[DeadMachineInstrctionElim] Post order visit all blocks and Iteratively run DeadMachineInstructionElim pass until nothing dead
Patched by: guopeilin
Reviewed By: hliao,rampitec
Differential Revision: https://reviews.llvm.org/D91513
Simon Pilgrim [Fri, 20 Nov 2020 16:52:15 +0000 (16:52 +0000)]
[X86][SSE] LowerADDSAT_SUBSAT - avoid X86ISD::BLENDV in UADDSAT/USUBSAT custom lowering
Use the OR(CMP,ADD) / AND(CMP,SUB) patterns like we do on pre-SSE4 targets.
We're still using X86ISD::BLENDV on some AVX targets as we don't do custom lowering for >= 256-bit vectors.
Really this (and combineVSelectWithAllOnesOrZeros) needs moving to DAGCombiner, but pre-SSE42 we see the vXi64 comparison type as a 2 x 32-bits result so we can't just rely on ComputeNumSignBits to give us the 'all bits' result we need.
Andrzej Warzynski [Fri, 20 Nov 2020 16:41:55 +0000 (16:41 +0000)]
[flang][driver] Remove unnecessary CMake dependencies (nfc)
Remove clangFrontend from the list of dependencies. These should have
been removed in:
8d51d37e0628bde3eb5a3200507ba7135dfc2751. See also
https://reviews.llvm.org/D87774.
Sanjay Patel [Fri, 20 Nov 2020 16:13:37 +0000 (11:13 -0500)]
[CostModel] mostly remove cost-kind predicate for intrinsics in basic TTI implementation
This is re-applying a combination of
f7eac51b9b3f and
8ec7ea3ddce7 as one patch
to avoid regressions now that we have better testing in place.
Those were reverted with
32dd5870ee31 because of crashing in experimental intrinsics.
That bug should be fixed with
7ae346434.
Paraphrased original commit messages:
This is the last step in removing cost-kind as a consideration in the
basic class model for intrinsics.
See D89461 for the start of that.
Subsequent commits dealt with each of the special-case intrinsics that
had customization here in the basic class. This should remove a barrier
to retrying D87188 (canonicalization to the abs intrinsic).
The ARM and x86 cost diffs seen here may be wrong because the
target-specific overrides have their own bugs, but we hope this is
less wrong - if something has a significant throughput cost, then it
should have a significant size / blended cost too by default.
The only behavioral diff in current regression tests is shown in the
x86 scatter-gather test (which is misplaced or broken because it runs
the entire -O3 pipeline) - we unrolled less, and we assume that is
a improvement.
Exception: in general, we want the *size* cost for a scalar call to be
cheap even if the other costs are expensive - we expect it to just be
a branch with some optional stack manipulation.
It is likely that we will want to carve out some
exceptions/overrides to this rule as follow-up patches for
calls that have some general and/or target-specific difference
to the expected lowering.
This was noticed as a regression in unrolling, so we have a test
for that now along with a couple of direct cost model tests.
If the assumed scalarization costs for the oversized vector
calls are not realistic, that would be another follow-up
refinement of the cost models.
Differential Revision: https://reviews.llvm.org/D90554
Simon Pilgrim [Fri, 20 Nov 2020 16:00:08 +0000 (16:00 +0000)]
[X86] Add SSE42 sat-add test coverage
Check SSE42 targets which have PCMPGTQ
Alex Richardson [Wed, 22 Jul 2020 13:41:06 +0000 (14:41 +0100)]
[AMDGPU] Set the default globals address space to 1
This will ensure that passes that add new global variables will create them
in address space 1 once the passes have been updated to no longer default
to the implicit address space zero.
This also changes AutoUpgrade.cpp to add -G1 to the DataLayout if it wasn't
already to present to ensure bitcode backwards compatibility.
Reviewed by: arsenm
Differential Revision: https://reviews.llvm.org/D84345
Alex Richardson [Fri, 20 Nov 2020 15:17:52 +0000 (15:17 +0000)]
Add a default address space for globals to DataLayout
This is similar to the existing alloca and program address spaces (D37052)
and should be used when creating/accessing global variables.
We need this in our CHERI fork of LLVM to place all globals in address space 200.
This ensures that values are accessed using CHERI load/store instructions
instead of the normal MIPS/RISC-V ones.
The problem this is trying to fix is that most of the time the type of
globals is created using a simple PointerType::getUnqual() (or ::get() with
the default address-space value of 0). This does not work for us and we get
assertion/compilation/instruction selection failures whenever a new call
is added that uses the default value of zero.
In our fork we have removed the default parameter value of zero for most
address space arguments and use DL.getProgramAddressSpace() or
DL.getGlobalsAddressSpace() whenever possible. If this change is accepted,
I will upstream follow-up patches to use DL.getGlobalsAddressSpace() instead
of relying on the default value of 0 for PointerType::get(), etc.
This patch and the follow-up changes will not have any functional changes
for existing backends with the default globals address space of zero.
A follow-up commit will change the default globals address space for
AMDGPU to 1.
Reviewed By: dylanmckay
Differential Revision: https://reviews.llvm.org/D70947
Siva Chandra Reddy [Thu, 19 Nov 2020 20:51:04 +0000 (12:51 -0800)]
[libc] Combine all math differential fuzzers into one target.
Also added diffing of a few more math functions. Combining the diff check
for all of these functions helps us meet the OSS fuzz bar of a minimum of
100 program edges.
Reviewed By: lntue
Differential Revision: https://reviews.llvm.org/D91817
Anton Afanasyev [Fri, 20 Nov 2020 14:49:09 +0000 (17:49 +0300)]
[SLP][Test] Update pr47269.ll test. NFC
Expand test for PR47269 to better demonstrate changes introduced by D90445.
Jamie Schmeiser [Fri, 20 Nov 2020 15:26:33 +0000 (10:26 -0500)]
Reland: Expand existing loopsink testing to also test loopsinking using new pass manager and fix LICM bug.
Summary:
Expand existing loopsink testing to also test loopsinking using new pass
manager. Enable memoryssa for loopsink with new pass manager. This
combination exposed a bug that was previously fixed for loopsink
without memoryssa. When sinking an instruction into a loop, the source
block may not be part of the loop but still needs to be checked for
pointer invalidation. This is the fix for bugzilla #39695 (PR 54659)
expanded to also work with memoryssa.
Respond to review comments. Enable Memory SSA in legacy Loop Sink pass
under EnableMSSALoopDependency option control. Update tests accordingly.
Respond to review comments. Add options controlling whether memoryssa is
used for loop sink, defaulting to off. Expand testing based on these
options.
Respond to review comments. Properly indicated preserved analyses.
This relanding addresses a compile-time performance problem by moving
test for profile data earlier to avoid unnecessary computations.
Author: Jamie Schmeiser <schmeise@ca.ibm.com>
Reviewed By: asbirlea (Alina Sbirlea)
Differential Revision: https://reviews.llvm.org/D90249
Sanjay Patel [Fri, 20 Nov 2020 15:14:44 +0000 (10:14 -0500)]
[CostModel] avoid crashing while finding scalarization overhead
The constrained intrinsics have metadata arguments, so the
tests here were crashing as noted in D90554 (and that was
reverted even though this bug exists independently of that
change).
Chris Kennelly [Sat, 7 Nov 2020 19:14:08 +0000 (14:14 -0500)]
[clang-tidy] Include std::basic_string_view in readability-redundant-string-init.
std::string_view("") produces a string_view instance that compares
equal to std::string_view(), but requires more complex initialization
(storing the address of the string literal, rather than zeroing).
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D91009
Jamie Schmeiser [Fri, 20 Nov 2020 14:43:06 +0000 (09:43 -0500)]
[NFC intended] Refactor the code for printChanged for reuse and to facilitate subsequent reporters of changes to the IR in the new pass manager.
Summary:
[NFC intended] Refactor the code for printChanged for reuse and to facilitate
subsequent reporters of changes to the IR in the new pass manager.
Create abstract template base classes for common functionality and give
classes more appropriate names. The base classes handle all of the
determination of when a function or pass is "interesting" and should be
reported or filtered out. They have pure virtual functions which are called
when a change by a pass has been recognized so the derived class need only
provide the overrides to present the information about the changing IR.
There are at least 2 more change reporters to come (which were presented
in my tutorial at the 2020 llvm developer's meeting) that derive from
these classes.
Respond to review comments: move function out of line, remove inline keyword,
remove unneeded qualifiers, simplify comparison.
Author: Jamie Schmeiser <schmeise@ca.ibm.com>
Reviewed By: aeubanks (Arthur Eubanks), madhur13490 (Madhur Amilkanthwar)
Differential Revision: https://reviews.llvm.org/D87000
Adam Czachorowski [Tue, 17 Nov 2020 13:24:00 +0000 (14:24 +0100)]
[clang] Do not crash on pointer wchar_t pointer assignment.
wchar_t can be signed (thus hasSignedIntegerRepresentation() returns
true), but it doesn't have an unsigned type, which would lead to a crash
when trying to get it.
With this fix, we special-case WideChar types in the pointer assignment
code.
Differential Revision: https://reviews.llvm.org/D91625
Sjoerd Meijer [Fri, 20 Nov 2020 14:04:26 +0000 (14:04 +0000)]
[AArch64] Enable post RA scheduler for Cortex-R82
Just something I forgot when I added the R82. Need to have a look
at crypto and fusing, but will do that as a follow up.
Differential Revision: https://reviews.llvm.org/D91848
Yafei Liu [Fri, 20 Nov 2020 13:50:39 +0000 (08:50 -0500)]
Add a call super attribute plugin example
If a virtual method is marked as call_super, the
override method must call it, simpler feature like @CallSuper
in Android Java.
Stephen Kelly [Tue, 17 Nov 2020 16:50:53 +0000 (16:50 +0000)]
Add documentation illustrating use of IgnoreUnlessSpelledInSource
Differential Revision: https://reviews.llvm.org/D91639
David Green [Fri, 20 Nov 2020 13:30:44 +0000 (13:30 +0000)]
[ARM] Disable WLSTP loops
This checks to see if the loop will likely become a tail predicated loop
and disables wls loop generation if so, as the likelihood for reverting
is currently too high. These should be fairly rare situations anyway due
to the way iterations and element counts are used during lowering. Just
not trying can alter how SCEV's are materialized however, leading to
different codegen.
It also adds a option to disable all while low overhead loops, for
debugging.
Differential Revision: https://reviews.llvm.org/D91663
Pavel Iliin [Thu, 19 Nov 2020 19:52:46 +0000 (19:52 +0000)]
[AArch64] Out-of-line atomics (-moutline-atomics) implementation.
This patch implements out of line atomics for LSE deployment
mechanism. Details how it works can be found in llvm/docs/Atomics.rst
Options -moutline-atomics and -mno-outline-atomics to enable and disable it
were added to clang driver. This is clang and llvm part of out-of-line atomics
interface, library part is already supported by libgcc. Compiler-rt
support is provided in separate patch.
Differential Revision: https://reviews.llvm.org/D91157
Sanjay Patel [Fri, 13 Nov 2020 23:01:39 +0000 (18:01 -0500)]
[CostModel] add tests for math library calls; NFC
This is a partial un-revert of
32dd5870ee31 (originally
df09f82599 ).
I'm adding back the baseline tests first, so we don't have
to back-track as much in case there are still problems.
Sanjay Patel [Fri, 20 Nov 2020 13:03:33 +0000 (08:03 -0500)]
[LoopUnroll] add test for full unroll that is sensitive to cost-model; NFC
See discussion in D90554.
This is a partial un-revert of
32dd5870ee31. I'm adding
back the baseline tests first, so we don't have to
back-track as much in case there are still problems.
Rainer Orth [Fri, 20 Nov 2020 13:06:25 +0000 (14:06 +0100)]
[sanitizers][test] Test sanitizer_common and ubsan_minimal on Solaris
During the initial Solaris sanitizer port, I missed to enable the
`sanitizer_common` and `ubsan_minimal` testsuites. This patch fixes this,
correcting a few unportabilities:
- `Posix/getpass.cpp` failed to link since Solaris lacks `libutil`.
Omitting the library lets the test `PASS`, but I thought adding `%libutil`
along the lines of `%librt` to be overkill.
- One subtest of `Posix/getpw_getgr.cpp` is disabled because Solaris
`getpwent_r` has a different signature than expected.
- `/dev/null` is a symlink on Solaris.
- XPG7 specifies that `uname` returns a non-negative value on success.
Tested on `amd64-pc-solaris2.11` and `sparcv9-sun-solaris2.11`.
Differential Revision: https://reviews.llvm.org/D91606
Stephan Herhut [Fri, 20 Nov 2020 10:21:27 +0000 (11:21 +0100)]
[mlir][std] Canonicalize a dim(memref_reshape) into a load from the shape operand
This canonicalization helps propagate shape information through the program.
Differential Revision: https://reviews.llvm.org/D91854
Sanjay Patel [Fri, 20 Nov 2020 11:40:28 +0000 (06:40 -0500)]
[InstCombine] add test comments for negative tests; NFC
Stephan Herhut [Fri, 20 Nov 2020 10:32:42 +0000 (11:32 +0100)]
[mlir][std] Fold load(tensor_to_memref) into extract_element
This canonicalization is useful to resolve loads into scalar values when
doing partial bufferization.
Differential Revision: https://reviews.llvm.org/D91855
Raphael Isemann [Fri, 20 Nov 2020 12:01:01 +0000 (13:01 +0100)]
Partially revert '[MachO] Update embedded part of ObjectFileMachO for Mangled API change'
Commit
f3aa9e36d91b7b0f4f24f7a3b13cf80c11356e5e fixed the embedded OS
build by removing all passed args for `GetName`/`GetDemangledName`. The motivation
for this was that these arguments were apparently removed in
commit
22b044877d239c40c9a932d1ea47d489c507000f. However, only `GetName`'s language
argument was removed but the mangling preference argument was *not* removed
(and unfortunately had a default argument). So when that commit removed all
the args it didn't just fix the build but it also changed all the mangling
preferences to 'demangled' for all `GetName` calls.
Also some `GetName` calls were outside the TARGET_OS_EMBEDDED ifdef, so
this change ended up breaking the following tests on macOS:
lldb-api :: lang/objc/objc-static-method-stripped/TestObjCStaticMethodStripped.py
lldb-api :: lang/objc/objc-super/TestObjCSuper.py
From what I can see
f3aa9e36d91b7 removed 12 ePreferMangled args and this patch
re-adds 12 args with roughly the same line numbers, so this *should* restore the
old behaviour and also keep the embedded build working. On the other hand,
ObjectFileMachO::ParseSymtab is a very successful attempt at writing
the longest possible function within LLVM, so this fix is partly based
on the engineering principle known as "hoping for the best".
Kazushi (Jam) Marukawa [Thu, 19 Nov 2020 12:31:21 +0000 (21:31 +0900)]
[VE] Change threshold for jump table generation
Implement getMinimumJumpTableEntries() to specify threshold for jump
table genaration. We use 8 for the case of PIC mode to relieve the
impact of PIC calculation required to implement PIC mode jump table.
Update jump table regression test also.
Reviewed By: simoll
Differential Revision: https://reviews.llvm.org/D91785
Stephan Herhut [Fri, 20 Nov 2020 10:46:22 +0000 (11:46 +0100)]
[mlir][std] Fold comparisons when the operands are equal
For equal operands, comparisons can be decided statically.
Differential Revision: https://reviews.llvm.org/D91856
Mikhail Goncharov [Fri, 20 Nov 2020 12:09:28 +0000 (13:09 +0100)]
Revert "[mlir][Linalg] Fuse sequence of Linalg operation (on buffers)"
This reverts commit
f8284d21a8e294d58a0acd4b8b2e906d7a9f110c.
Revert "[mlir][Linalg] NFC: Expose some utility functions used for promotion."
This reverts commit
0c59f51592ef5c014352994369f5216c6376fae1.
Revert "Remove unused isZero function"
This reverts commit
0f9f0a4046e11c2b4c130640f343e3b2b5db08c1.
Change
f8284d21 led to multiple failures in IREE compilation.
Simon Pilgrim [Fri, 20 Nov 2020 12:02:57 +0000 (12:02 +0000)]
[clang][CodeGen] Move WebAssembly specific tests to WebAssembly subtarget folder
Minor cleanup to move more target specific tests out of the root codegen test folder
Simon Pilgrim [Fri, 20 Nov 2020 11:47:27 +0000 (11:47 +0000)]
[clang][CodeGen] Move riscv specific tests to RISCV subtarget folder
Minor cleanup to move more target specific tests out of the root codegen test folder
Rainer Orth [Fri, 20 Nov 2020 12:02:15 +0000 (13:02 +0100)]
[sanitizer_common][test] Disable CombinedAllocator32Compact etc. on Solaris/sparcv9
As reported in PR 48202, two allocator tests `FAIL` on Solaris/sparcv9,
presumably because Solaris uses the full 64-bit address space and the
allocator cannot deal with that:
SanitizerCommon-Unit :: ./Sanitizer-sparcv9-Test/SanitizerCommon.CombinedAllocator32Compact
SanitizerCommon-Unit :: ./Sanitizer-sparcv9-Test/SanitizerCommon.SizeClassAllocator32Iteration
This patch disables the tests.
Tested on `sparcv9-sun-solaris2.11`.
Differential Revision: https://reviews.llvm.org/D91622
Rainer Orth [Fri, 20 Nov 2020 11:52:18 +0000 (12:52 +0100)]
[sanitizer_common][test] Disable FastUnwindTest.* on SPARC
Many of the `FastUnwindTest.*` tests `FAIL` on SPARC, both Solaris and
Linux. The issue is that the fake stacks used in those tests don't match
the requirements of the SPARC unwinder in `sanitizer_stacktrace_sparc.cpp`
which has to look at the register window save area.
I'm disabling the failing tests.
Tested on `sparcv9-sun-solaris2.11`.
Differential Revision: https://reviews.llvm.org/D91618
Simon Pilgrim [Fri, 20 Nov 2020 11:40:59 +0000 (11:40 +0000)]
Fix MSVC "not all control paths return a value" warnings. NFCI.
David Spickett [Mon, 17 Aug 2020 14:02:04 +0000 (15:02 +0100)]
[lldb][AArch64/Linux] Show memory tagged memory regions
This extends the "memory region" command to
show tagged regions on AArch64 Linux when the MTE
extension is enabled.
(lldb) memory region the_page
[0x0000fffff7ff8000-0x0000fffff7ff9000) rw-
memory tagging: enabled
This is done by adding an optional "flags" field to
the qMemoryRegion packet. The only supported flag is
"mt" but this can be extended.
This "mt" flag is read from /proc/{pid}/smaps on Linux,
other platforms will leave out the "flags" field.
Where this "mt" flag is received "memory region" will
show that it is enabled. If it is not or the target
doesn't support memory tagging, the line is not shown.
(since majority of the time tagging will not be enabled)
Testing is added for the existing /proc/{pid}/maps
parsing and the new smaps parsing.
Minidump parsing has been updated where needed,
though it only uses maps not smaps.
Target specific tests can be run with QEMU and I have
added MTE flags to the existing helper scripts.
Reviewed By: labath
Differential Revision: https://reviews.llvm.org/D87442
Eugene Zhulenev [Fri, 20 Nov 2020 10:42:28 +0000 (02:42 -0800)]
[mlir] Automatic reference counting for Async values + runtime support for ref counted objects
Depends On D89963
**Automatic reference counting algorithm outline:**
1. `ReturnLike` operations forward the reference counted values without
modifying the reference count.
2. Use liveness analysis to find blocks in the CFG where the lifetime of
reference counted values ends, and insert `drop_ref` operations after
the last use of the value.
3. Insert `add_ref` before the `async.execute` operation capturing the
value, and pairing `drop_ref` before the async body region terminator,
to release the captured reference counted value when execution
completes.
4. If the reference counted value is passed only to some of the block
successors, insert `drop_ref` operations in the beginning of the blocks
that do not have reference coutned value uses.
Reviewed By: silvas
Differential Revision: https://reviews.llvm.org/D90716
Sebastian Neubauer [Thu, 15 Oct 2020 11:26:44 +0000 (13:26 +0200)]
[AMDGPU] Implement flat scratch init for pal
Extract the scratch offset from the scratch buffer descriptor that is
stored in the global table.
Differential Revision: https://reviews.llvm.org/D91701
QingShan Zhang [Fri, 20 Nov 2020 09:56:53 +0000 (09:56 +0000)]
[NFC][Test] Update test for IEEE Long Double
Max Kazantsev [Fri, 20 Nov 2020 09:52:50 +0000 (16:52 +0700)]
[Test] Auto-update checks in a test
Georgii Rymar [Thu, 19 Nov 2020 15:23:27 +0000 (18:23 +0300)]
[llvm-readelf/obj] - Improve error reporting when dumping group sections.
Our code that dumps groups has 3 noticeable issues:
1) It uses `unwrapOrError` in many places.
2) It doesn't allow reporting unique warnings, because the `getGroups` helper is not
a member of `DumpStyle<ELFT>`.
3) It might just crash. See the comment for `StrTableOrErr->data() + Sym.st_name` line.
In this patch I am starting addressing these points.
For start I've converted one of `unwrapOrError` calls to a unique warning.
Differential revision: https://reviews.llvm.org/D91798
Kirill Bobyrev [Fri, 20 Nov 2020 09:38:41 +0000 (10:38 +0100)]
[clangd] NFC: Reorder headers in tests accordig to Clang-Tidy
Georgii Rymar [Thu, 12 Nov 2020 09:46:59 +0000 (12:46 +0300)]
[llvm-readobj] - Introduce `forEachRelocationDo` helper.
Our `printStackSize` implementation currently uses
API like `RelocationRef`, `object::symbol_iterator`.
It is not ideal as it doesn't allow
to handle possible error conditions properly.
Some time ago I started rewriting it and this NFC patch is
a one more step toward to it. Here I am introducing the
`forEachRelocationDo` helper. With it it is possible to iterate
over all kinds of relocations, what is helpful for improving
the code in `printStackSize` and around.
Differential revision: https://reviews.llvm.org/D91530
AndreyChurbanov [Fri, 20 Nov 2020 09:15:00 +0000 (12:15 +0300)]
Revert "[OpenMP] Add support for Intel's umonitor/umwait"
This reverts commit
9cfad5f9c5bfd985f1bc8b0954f58013c5236e58.
Max Kazantsev [Fri, 20 Nov 2020 08:57:44 +0000 (15:57 +0700)]
[Test] Add tests demonstrating a bug in SCEV, PR48225
Slightly simplified version of original test reported by Congzhe Cao.
Michał Górny [Fri, 20 Nov 2020 08:43:08 +0000 (09:43 +0100)]
[lldb] [test/Register] XFAIL x86-fp-write on Darwin
Michał Górny [Fri, 20 Nov 2020 08:42:13 +0000 (09:42 +0100)]
Revert "[LLDB] Fixing lldb/test/Shell/Register/x86-fp-write.test"
The problem is not specific to arch but to the whole Darwin platform.
Reverts:
0fd04337a17138174adf9e6d408cf9c885dea086
Liu, Chen3 [Fri, 30 Oct 2020 03:11:35 +0000 (11:11 +0800)]
[X86] Add support for vex, vex2, vex3, and evex for MASM
For MASM syntax, the prefixes are not enclosed in braces.
The assembly code should like:
"evex vcvtps2pd xmm0, xmm1"
Differential Revision: https://reviews.llvm.org/D90441
Georgii Rymar [Thu, 12 Nov 2020 12:16:57 +0000 (15:16 +0300)]
[lib/Object] - Generalize the RelocationResolver API.
This allows to reuse the RelocationResolver from the code
that doesn't want to deal with `RelocationRef` class.
I am going to use it in llvm-readobj. See the description
of D91530 for more details.
Differential revision: https://reviews.llvm.org/D91533
Qiu Chaofan [Fri, 20 Nov 2020 07:04:57 +0000 (15:04 +0800)]
[NFC] Pre-commit test for flt_rounds on PowerPC
Arthur Eubanks [Thu, 19 Nov 2020 22:40:33 +0000 (14:40 -0800)]
[PGO] Make -disable-preinline work with NPM
Fixes cspgo_profile_summary.ll under NPM.
Reviewed By: xur
Differential Revision: https://reviews.llvm.org/D91826
Eric Christopher [Fri, 20 Nov 2020 05:59:16 +0000 (21:59 -0800)]
Temporarily Revert "[CostModel] remove cost-kind predicate for intrinsics in basic TTI implementation"
as it's causing crashes in the optimizer. A reduced testcase has been posted as a follow-up.
This reverts commit
f7eac51b9b3f780c96ca41913293851c5acb465b.
Temporarily Revert "[CostModel] make default size cost for libcalls small (again)" as it depends upon the primary revert.
This reverts commit
8ec7ea3ddce7379e13e8dfb4a5260a6d2004aa1c.
Temporarily Revert "[CostModel] add tests for math library calls; NFC" as it depends upon the primary revert.
This reverts commit
df09f825995b10da03f148133c119f52c94fd6e4.
Temporarily Revert "[LoopUnroll] add test for full unroll that is sensitive to cost-model; NFC" as it depends upon the primary revert.
This reverts commit
618d555e8d926a83161774df2035519c387269db.
Kazu Hirata [Fri, 20 Nov 2020 06:07:55 +0000 (22:07 -0800)]
[CodeGen] Use llvm::is_contained (NFC)
Haruki Imai [Fri, 20 Nov 2020 05:07:31 +0000 (05:07 +0000)]
[mlir] Support big-endian systems in DenseElementsAttr (multiple word)
D78076 supports big endian in DenseElementsAttr, but does not work when
APInt has multiple words(the number of bits > 64). This patch updates
D78076 to support it.
This patch removed the fix in D78076 and re-implemented to support multiple words.
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D80272
Geoffrey Martin-Noble [Fri, 20 Nov 2020 03:35:13 +0000 (19:35 -0800)]
Remove unused isZero function
Unused since https://reviews.llvm.org/D91503 and triggering
-Wunused-function
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D91838
MaheshRavishankar [Fri, 20 Nov 2020 03:04:57 +0000 (19:04 -0800)]
[mlir][Linalg] NFC: Expose some utility functions used for promotion.
Exposing some utility functions from Linalg to allow for promotion of
fused views outside of the core tile+fuse logic.
This is an alternative to patch D91322 which adds the promotion logic
to the tileAndFuse method. Downside with that approach is that it is
not easily customizable based on needs.
Differential Revision: https://reviews.llvm.org/D91503
MaheshRavishankar [Fri, 20 Nov 2020 03:02:31 +0000 (19:02 -0800)]
[mlir][Linalg] Fuse sequence of Linalg operation (on buffers)
Enhance the tile+fuse logic to allow fusing a sequence of operations.
Differential Revision: https://reviews.llvm.org/D90991
MaheshRavishankar [Fri, 20 Nov 2020 02:59:48 +0000 (18:59 -0800)]
[mlir][Linalg] Add utility function that return static loop bounds of Linalg ops
Differential Revision: https://reviews.llvm.org/D91749
Bill Wendling [Wed, 18 Nov 2020 12:06:09 +0000 (04:06 -0800)]
[PowerPC] Allow a '%' prefix for registers in CFI directives
Clang generates a '%' prefix for some registers in CFI directives. E.g.
".cfi_register lr, r12" becomes ".cfi_register lr, %r12" after
processing.
Differential Revision: https://reviews.llvm.org/D91735
Arthur Eubanks [Fri, 20 Nov 2020 02:13:22 +0000 (18:13 -0800)]
[test] Fix multiply-minimal.ll
Duncan P. N. Exon Smith [Thu, 19 Nov 2020 02:57:50 +0000 (18:57 -0800)]
ADT: Split out isSafeToReferenceAfterResize helper to use early returns, NFC
The assertion logic in SmallVector::assertSafeToReferenceAfterResize is
hard to follow; split out SmallVector::isSafeToReferenceAfterResize and
add early returns and comments. No functionality change here.
Arthur Eubanks [Wed, 18 Nov 2020 07:09:20 +0000 (23:09 -0800)]
Port -lower-matrix-intrinsics-minimal to NPM
This reuses the existing lower-matrix-intrinsics pass rather than going
the legacy pass route of creating a new pass.
Use this new variant in the NPM -O0 pipeline.
Reviewed By: asbirlea
Differential Revision: https://reviews.llvm.org/D91811
Duncan P. N. Exon Smith [Fri, 20 Nov 2020 01:21:40 +0000 (17:21 -0800)]
ADT: Use early returns in SmallVector::resize, NFC
Just a simple cleanup, no functionality change here.
Duncan P. N. Exon Smith [Fri, 20 Nov 2020 01:15:34 +0000 (17:15 -0800)]
ADT: Weaken SmallVector::resize assertion from
5abf76fbe37380874a88cc9aa02164800e4e10f3
There's no need to check for reference invalidation when
`SmallVector::resize` is shrinking; the parameter isn't accessed.
Differential Revision: https://reviews.llvm.org/D91832
Sam Clegg [Wed, 18 Nov 2020 05:52:45 +0000 (21:52 -0800)]
[lld][WebAssembly] Convert more tests to asm format. NFC.
Differential Revision: https://reviews.llvm.org/D91681
shafik [Fri, 20 Nov 2020 00:29:28 +0000 (16:29 -0800)]
[LLDB] Fixing lldb/test/Shell/Register/x86-fp-write.test
D91497 changed lldb/test/Shell/Register/x86-fp-write.test and added target-x86_64 to the REQUIRES clause.
It looks this test does not pass on this platform so removing it since it one of tests failing on the
green dragon build bot.
LLVM GN Syncbot [Fri, 20 Nov 2020 00:15:31 +0000 (00:15 +0000)]
[gn build] Port
8adc4d1ec76
Sam McCall [Fri, 16 Oct 2020 18:03:48 +0000 (20:03 +0200)]
[clangd] Add textDocument/ast extension method to dump the AST
This is a mass-market version of the "dump AST" tweak we have behind
-hidden-features.
I think in this friendlier form it'll be useful for people outside clang
developers, which would justify making it a real feature.
It could be useful as a step towards lightweight clang-AST tooling in clangd
itself (like matcher-based search).
Advantages over the tweak:
- simplified information makes it more accessible, likely somewhat useful
without learning too much clang internals
- can be shown in a tree view
- structured information gives some options for presentation (e.g.
icon + two text colors + tooltip in vscode)
- clickable nodes jump to the corresponding code
Disadvantages:
- a bunch of code to handle different node types
- likely missing some important info vs dump-ast due to brevity/oversight
- may end up chasing/maintaining support for the long tail of nodes
Demo with VSCode support: https://imgur.com/a/6gKfyIV
Differential Revision: https://reviews.llvm.org/D89571
Arthur Eubanks [Thu, 19 Nov 2020 22:58:24 +0000 (14:58 -0800)]
[test] Fix split-vfunc.ll under NPM
We need an AA pipeline under NPM.
This is a no-op if we are still using the legacy PM.
Florian Hahn [Wed, 18 Nov 2020 11:45:26 +0000 (11:45 +0000)]
[ConstraintElimination] Decompose GEP with arbitrary offsets.
This patch decomposes `GEP %x, %offset` as 0 + 1 * %x + 1 * %off.
Arthur Eubanks [Thu, 19 Nov 2020 22:24:46 +0000 (14:24 -0800)]
[test] Fix globalaa-retained.ll under NPM
Just '-O2' didn't run the full AA pipeline under NPM.
Arthur Eubanks [Thu, 19 Nov 2020 22:19:48 +0000 (14:19 -0800)]
[test] Fix pr39282.ll under NPM
Already has a NPM RUN line
Tres Popp [Thu, 19 Nov 2020 21:48:03 +0000 (22:48 +0100)]
[mlir] Add missing const * updates in StandardAttributes
This add missing updates to the header file that caused linking issues.
Original change at https://reviews.llvm.org/D91740
Differential Revision: https://reviews.llvm.org/D91822
Geoffrey Martin-Noble [Thu, 19 Nov 2020 21:34:40 +0000 (13:34 -0800)]
Remove unused private fields
Unused since https://reviews.llvm.org/D91762 and triggering
-Wunused-private-field
```
llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp:365:13: error: private field 'GetArgTLS' is not used [-Werror,-Wunused-private-field]
Constant *GetArgTLS;
^
llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp:366:13: error: private field 'GetRetvalTLS' is not used [-Werror,-Wunused-private-field]
Constant *GetRetvalTLS;
```
Reviewed By: stephan.yichao.zhao
Differential Revision: https://reviews.llvm.org/D91820
Roman Lebedev [Thu, 19 Nov 2020 21:07:48 +0000 (00:07 +0300)]
[InstCombine] Fold `and(shl(zext(x), width(SIGNMASK) - width(%x)), SIGNMASK)` to `and(sext(%x), SIGNMASK)`
One less instruction and reducing use count of zext.
As alive2 confirms, we're fine with all the weird combinations of
undef elts in constants, but unless the shift amount was undef
for a lane, we must sanitize undef mask to zero, since sign bits
are no longer zeros.
https://rise4fun.com/Alive/d7r
```
----------------------------------------
Optimization: zz
Precondition: ((C1 == (width(%r) - width(%x))) && isSignBit(C2))
%o0 = zext %x
%o1 = shl %o0, C1
%r = and %o1, C2
=>
%n0 = sext %x
%r = and %n0, C2
Done: 2016
Optimization is correct!
```
Roman Lebedev [Thu, 19 Nov 2020 21:04:48 +0000 (00:04 +0300)]
[NFC][InstCombine] Add test coverage for `and (sext %x), SIGNMASK`-like pattern
Nikita Popov [Thu, 19 Nov 2020 21:28:39 +0000 (22:28 +0100)]
[MemLoc] Use hasValue() method more (NFC)
Followup to
7de7c40898a8f815d661781c92757f93fa4c6e5b. I previously
removed a number of == comparisons to LocationSize::unknown(), but
missed these != comparisons.
Alex Zinenko [Thu, 19 Nov 2020 18:35:35 +0000 (19:35 +0100)]
[mlir] Add an assertion on creating an Operation with null result types
Null types are commonly used as an error marker. Catch them in the constructor
of Operation if they are present in the result type list, as otherwise this
could lead to further surprising behavior when querying op result types.
Fix AsyncToLLVM and StandardToLLVM that were using null types when constructing
operations.
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D91770
Jianzhou Zhao [Thu, 19 Nov 2020 05:27:13 +0000 (05:27 +0000)]
Remove deadcode from DFSanFunction::get*TLS*()
clean more deadcode after D84704
Reviewed-by: morehouse
Differential Revision: https://reviews.llvm.org/D91762
Sean Silva [Mon, 16 Nov 2020 21:10:20 +0000 (13:10 -0800)]
[mlir] Split BufferUtils.h out of Bufferize.h
These utilities are more closely associated with the buffer
optimizations and buffer deallocation than with the dialect conversion
stuff in Bufferize.h. So move them out.
This makes Bufferize.h very easy to understand and completely focused on
dialect conversion.
Differential Revision: https://reviews.llvm.org/D91563
Nikita Popov [Thu, 19 Nov 2020 20:53:20 +0000 (21:53 +0100)]
[MemLoc] Use hasValue() method (NFC)
Instead of comparing to LocationSize::unknown(), prefer calling
the hasValue() method instead, which is less reliant on
implementation details.
Nikita Popov [Thu, 19 Nov 2020 20:50:44 +0000 (21:50 +0100)]
[MemLoc] Specify LocationSize in unit test
Followup to
393b9e9db31a3f83bc8b813ee24b56bc8ed93a49,
where I missed updating one MemoryLocation use inside a unit test.
Nikita Popov [Thu, 19 Nov 2020 20:41:51 +0000 (21:41 +0100)]
[MemLoc] Require LocationSize argument (NFC)
When constructing a MemoryLocation by hand, require that a
LocationSize is explicitly specified. D91649 will split up
LocationSize::unknown() into two different states, and callers
should make an explicit choice regarding the kind of MemoryLocation
they want to have.
Tres Popp [Thu, 19 Nov 2020 13:27:58 +0000 (14:27 +0100)]
Fix rollback of first block erasure in a region.
Differential Revision: https://reviews.llvm.org/D91788
Jianzhou Zhao [Thu, 19 Nov 2020 04:39:25 +0000 (04:39 +0000)]
Replace the equivalent code by UnionTableAddr
UnionTableAddr is always inlined.
Reviewed-by: morehouse
Differential Revision: https://reviews.llvm.org/DD91758
Artur Pilipenko [Tue, 17 Nov 2020 20:16:24 +0000 (12:16 -0800)]
[BasicAA] Deoptimize intrinsics don't modify memory
Similarly to assumes and guards deoptimize intrinsics are
marked as writing to ensure proper control dependencies
but they never modify any particular memory location.
Differential Revision: https://reviews.llvm.org/D91658
George [Thu, 19 Nov 2020 18:45:43 +0000 (10:45 -0800)]
Make array pointers in the CAPI const
These pointers do not need to be mutable. This has an affect that generated function signatures in the Swift bindings now use `UnsafePointer` instead of `UnsafeMutablePointer`.
Reviewed By: ftynse, mehdi_amini
Differential Revision: https://reviews.llvm.org/D91740
Nikita Popov [Thu, 19 Nov 2020 19:53:27 +0000 (20:53 +0100)]
[Lint] Use MemoryLocation
Instead of separately passing pointer and size, make use of
MemoryLocation. This allows us to also reuse all the existing
logic for determining the MemoryLocation correponding to an
instruction or call argument.
Not quite NFC because used locations may be more precise in some
cases.
Louis Dionne [Thu, 19 Nov 2020 19:22:28 +0000 (14:22 -0500)]
[libc++] Add documentation for setting up new CI jobs
Nikita Popov [Thu, 19 Nov 2020 19:25:30 +0000 (20:25 +0100)]
[Polly] Use LocationSize::unknown() (NFC)
Avoid MemoryLocation::UnknownSize when we're initializing a
LocationSize.
Nico Weber [Thu, 19 Nov 2020 19:24:27 +0000 (14:24 -0500)]
[gn build] (manually) merge
1fb91fcf9cfe849
Arthur Eubanks [Mon, 16 Nov 2020 20:48:42 +0000 (12:48 -0800)]
[NPM] Move more O0 pass building into PassBuilder
This moves handling of alwaysinline, coroutines, matrix lowering, PGO,
and LTO-required passes into PassBuilder. Much of this is replicated
between Clang and opt. Other out-of-tree users also replicate some of
this, such as Rust [1] replicating the alwaysinline, LTO, and PGO
passes.
The LTO passes are also now run in
build(Thin)LTOPreLinkDefaultPipeline() since they are semantically
required for (Thin)LTO.
[1]: https://github.com/rust-lang/rust/blob/
f5230fbf76bafd86ee4376a0e26e551df8d17fec/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp#L896
Reviewed By: tejohnson
Differential Revision: https://reviews.llvm.org/D91585
Jorge Gorbe Moya [Thu, 19 Nov 2020 18:59:08 +0000 (10:59 -0800)]
Fix crash after looking up dwo_id=0 in CU index.
In the current state, if getFromHash(0) is called and there's no CU with
dwo_id=0, the lookup will stop at an empty slot, then the check
`Rows[H].getSignature() != S` won't cause the lookup to fail and return
a nullptr (as it should), because the empty slot has a 0 in the
signature field, and a pointer to the empty slot will be incorrectly
returned.
This patch fixes this by using the index field in the hash entry to
check for empty slots: signature = 0 can match a valid hash but
according to the spec the index for an occupied slot will always be
non-zero.
Differential Revision: https://reviews.llvm.org/D91670
Sam McCall [Thu, 19 Nov 2020 19:14:40 +0000 (20:14 +0100)]
[clangd] Express ASAN interactions of tests more clearly. NFC
River Riddle [Thu, 19 Nov 2020 18:43:12 +0000 (10:43 -0800)]
[mlir][BuiltinDialect] Resolve comments from D91571
* Move ops to a BuiltinOps.h
* Add file comments
Sam McCall [Wed, 11 Nov 2020 21:34:46 +0000 (22:34 +0100)]
[clangd] Also detect corrupt stri table size.
Differential Revision: https://reviews.llvm.org/D91299
AndreyChurbanov [Thu, 19 Nov 2020 19:04:21 +0000 (22:04 +0300)]
[OpenMP] Add support for Intel's umonitor/umwait
Patch by tlwilmar (Terry Wilmarth)
Differential Revision: https://reviews.llvm.org/D91189
Fraser Cormack [Thu, 19 Nov 2020 18:39:35 +0000 (18:39 +0000)]
[RISCV] Add test cases for missed grevi/greviw opportunities. NFC
Louis Dionne [Thu, 19 Nov 2020 18:36:48 +0000 (13:36 -0500)]
[libc++] Mark a few tests as unsupported on older Clangs to fix bots
Artem Belevich [Thu, 19 Nov 2020 18:06:57 +0000 (10:06 -0800)]
[CUDA] Unbreak CUDA compilation with -std=c++20
Standard libc++ headers in stdc++ mode include <new> which picks up
cuda_wrappers/new before any of the CUDA macros have been defined.
We can not include CUDA headers that early, so the work-around is to define
__device__ in the wrapper header itself.
Differential Revision: https://reviews.llvm.org/D91807
Stella Stamenova [Thu, 19 Nov 2020 18:30:40 +0000 (10:30 -0800)]
[mlir] Add a missing dependency to LinalgToLLVM
Generate passes.h before trying to use it
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D91750