Marius Brehler [Thu, 10 Sep 2020 15:37:56 +0000 (17:37 +0200)]
[mlir] Fix generation of AVX512 dialect documentation
This changes adjusts the documentation generation for the AVX512 dialect. The machanism to generate documentation was changed with https://github.com/llvm/llvm-project/commit/
1a083f027f33f4014247df4c0e757e23d5cdab64.
Reviewed By: nicolasvasilache
Differential Revision: https://reviews.llvm.org/D87460
Guillaume Chatelet [Fri, 11 Sep 2020 08:08:02 +0000 (10:08 +0200)]
Uncapitalize word in LanguageExtensions.rst
Rainer Orth [Fri, 11 Sep 2020 07:53:19 +0000 (09:53 +0200)]
[clang][Sparc] Default to -mcpu=v9 for Sparc V8 on Solaris
As reported in Bug 42535, `clang` doesn't inline atomic ops on 32-bit
Sparc, unlike `gcc` on Solaris. In a 1-stage build with `gcc`, only two
testcases are affected (currently `XFAIL`ed), while in a 2-stage build more
than 100 tests `FAIL` due to this issue.
The reason for this `gcc`/`clang` difference is that `gcc` on 32-bit
Solaris/SPARC defaults to `-mpcu=v9` where atomic ops are supported, unlike
with `clang`'s default of `-mcpu=v8`. This patch changes `clang` to use
`-mcpu=v9` on 32-bit Solaris/SPARC, too.
Doing so uncovered two bugs:
`clang -m32 -mcpu=v9` chokes with any Solaris system headers included:
/usr/include/sys/isa_defs.h:461:2: error: "Both _ILP32 and _LP64 are defined"
#error "Both _ILP32 and _LP64 are defined"
While `clang` currently defines `__sparcv9` in a 32-bit `-mcpu=v9`
compilation, neither `gcc` nor Studio `cc` do. In fact, the Studio 12.6
`cc(1)` man page clearly states:
These predefinitions are valid in all modes:
[...]
__sparcv8 (SPARC)
__sparcv9 (SPARC -m64)
At the same time, the patch defines `__GCC_HAVE_SYNC_COMPARE_AND_SWAP_[1248]`
for a 32-bit Sparc compilation with any V9 cpu. I've also changed
`MaxAtomicInlineWidth` for V9, matching what `gcc` does and the Oracle
Developer Studio 12.6: C User's Guide documents (Ch. 3, Support for Atomic
Types, 3.1 Size and Alignment of Atomic C Types).
The two testcases that had been `XFAIL`ed for Bug 42535 are un-`XFAIL`ed
again.
Tested on `sparcv9-sun-solaris2.11` and `amd64-pc-solaris2.11`.
Differential Revision: https://reviews.llvm.org/D86621
MaheshRavishankar [Fri, 11 Sep 2020 06:56:34 +0000 (23:56 -0700)]
[mlir][Linalg] Make LinalgBaseTilingPattern not delete the original operation.
The LinalgTilingPattern class dervied from the base deletes the
original operation. This allows for the use case where the more
transformations are necessary on the original operation after
tiling. In such cases the pattern can derive from
LinalgBaseTilingPattern instead of LinalgTilingPattern.
Differential Revision: https://reviews.llvm.org/D87308
David Sherwood [Thu, 3 Sep 2020 10:57:55 +0000 (11:57 +0100)]
[SVE][CodeGen] Fix InlineFunction for scalable vectors
When inlining functions containing allocas of scalable vectors we
cannot specify the size in the lifetime markers, since we don't
know this at compile time.
Added new test here:
test/Transforms/Inline/AArch64/sve-alloca-merge.ll
Differential Revision: https://reviews.llvm.org/D87139
Yevgeny Rouban [Fri, 11 Sep 2020 05:55:24 +0000 (12:55 +0700)]
[NewPM] Introduce PreserveCFG check
Check that all passes, which report they preserve CFG,
are really preserving CFG.
A new standard instrumentation is introduced. It can be
switched on/off by the flag verify-cfg-preserved, which
is on by default for debug builds.
Reviewers: kuhar, fedor.sergeev
Differential Revision: https://reviews.llvm.org/D81558
Martin Storsjö [Mon, 7 Sep 2020 21:00:07 +0000 (00:00 +0300)]
[MC] [Win64EH] Write packed ARM64 epilogues if possible
This gives a pretty substantial size reduction; for a 6.5 MB
DLL with 300 KB .xdata, the .xdata shrinks by 66 KB.
Differential Revision: https://reviews.llvm.org/D87369
Martin Storsjö [Mon, 7 Sep 2020 11:45:37 +0000 (14:45 +0300)]
[MC] [Win64EH] Canonicalize ARM64 unwind opcodes
Convert 2-byte opcodes to equivalent 1-byte ones.
Adjust the existing exhaustive testcase to avoid being altered by
the simplification rules (to keep that test exercising all individual
opcodes).
Fix the assembler parser limits for register pairs; for .seh_save_regp
and .seh_save_regp_x, we can allow up to x29, for a x29+x30 pair
(which gets remapped to the UOP_SaveFPLR(X) opcodes), for .seh_save_fregp
and .seh_save_fregpx, allow up to d14+d15.
Not creating .seh_save_next for float register pairs, as the
actual unwinder implementation in current versions of Windows is buggy
for that case.
This gives a minimal but measurable size reduction. (For a 6.5 MB
DLL with 300 KB .xdata, the .xdata shrinks by 48 bytes. The opcode
sequences are padded to a 4 byte boundary, so very small improvements
might not end up mattering directly.)
Differential Revision: https://reviews.llvm.org/D87367
Martin Storsjö [Thu, 10 Sep 2020 09:37:34 +0000 (12:37 +0300)]
[CodeGen] [WinException] Remove a redundant explicit section switch for aarch64
The following EmitWinEHHandlerData() implicitly switches to .xdata, just
like on x86_64.
This became orphaned from the original code requiring it in
0b61d220c9b1f0 / https://reviews.llvm.org/D61095.
Differential Revision: https://reviews.llvm.org/D87447
Guillaume Chatelet [Thu, 10 Sep 2020 14:27:27 +0000 (14:27 +0000)]
[Clang] Clarify __builtin_memcpy_inline documentation
This patch updates the documentation about `__builtin_memcpy_inline` and reorders the sections so it is more consitent and understandable.
Differential Revision: https://reviews.llvm.org/D87458
Esme-Yi [Fri, 11 Sep 2020 07:16:58 +0000 (07:16 +0000)]
[NFC][PowerPC] Add tests of constants-i64.
Michael Liao [Fri, 11 Sep 2020 05:58:11 +0000 (01:58 -0400)]
[EarlyCSE] Remove unnecessary operand swap.
- As min/max are commutative operators, there is no need to swap
operands. That breaks the convention calculating the hash value.
Alok Kumar Sharma [Fri, 11 Sep 2020 05:41:39 +0000 (11:11 +0530)]
[DebugInfo] Fixing CodeView assert related to lowerBound field of DISubrange.
This is to fix CodeView build failure https://bugs.llvm.org/show_bug.cgi?id=47287
after DIsSubrange upgrade D80197
Assert condition is now removed and Count is calculated in case LowerBound
is absent or zero and Count or UpperBound is constant. If Count is unknown
it is later handled as VLA (currently Count is set to zero).
Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D87406
Mircea Trofin [Fri, 11 Sep 2020 03:25:42 +0000 (20:25 -0700)]
[NFC][MLInliner] Presort instruction successions.
Differential Revision: https://reviews.llvm.org/D87489
Jan Vesely [Thu, 10 Sep 2020 19:43:28 +0000 (15:43 -0400)]
libclc/spirv: Add missing files from D85911
Fixes:
060c8e083dd637866854acb6a0823c45b2ef68ef
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Michael Liao [Fri, 11 Sep 2020 03:11:22 +0000 (23:11 -0400)]
[EarlyCSE] Fix and recommit the revised
c9826829d74e637163fdb0351870b8204e62d6e6
In addition to calculate hash consistently by swapping SELECT's
operands, we also need to inverse the select pattern favor to match the
original logic.
[EarlyCSE] Equivalent SELECTs should hash equally
DenseMap<SimpleValue> assumes that, if its isEqual method returns true
for two elements, then its getHashValue method must return the same value
for them. This invariant is broken when one SELECT node is a min/max
operation, and the other can be transformed into an equivalent min/max by
inverting its predicate and swapping its operands. This patch fixes an
assertion failure that would occur intermittently while compiling the
following IR:
define i32 @t(i32 %i) {
%cmp = icmp sle i32 0, %i
%twin1 = select i1 %cmp, i32 %i, i32 0
%cmpinv = icmp sgt i32 0, %i
%twin2 = select i1 %cmpinv, i32 0, i32 %i
%sink = add i32 %twin1, %twin2
ret i32 %sink
}
Differential Revision: https://reviews.llvm.org/D86843
Vitaly Buka [Fri, 11 Sep 2020 02:59:31 +0000 (19:59 -0700)]
[Asan] Fix __asan_update_allocation_context
Update both thread and stack.
Update thread and stack as atomic operation.
Keep all 32bit of TID as now we have enough bits.
Depends on D87135.
Reviewed By: morehouse
Differential Revision: https://reviews.llvm.org/D87217
Michael Liao [Fri, 11 Sep 2020 02:37:35 +0000 (22:37 -0400)]
Revert "[EarlyCSE] Equivalent SELECTs should hash equally"
This reverts commit
c9826829d74e637163fdb0351870b8204e62d6e6 as it
breaks regression tests.
Michael Liao [Fri, 11 Sep 2020 02:16:42 +0000 (22:16 -0400)]
Remove dependency on clangASTMatchers.
- It seems no long required for shared library builds.
Peter Collingbourne [Thu, 10 Sep 2020 19:38:42 +0000 (12:38 -0700)]
scudo: Remove the THREADLOCAL macro.
Replace all remaining uses with thread_local, which is a C++11
standard feature.
Differential Revision: https://reviews.llvm.org/D87478
Peter Collingbourne [Wed, 9 Sep 2020 22:15:46 +0000 (15:15 -0700)]
scudo: Introduce a new mechanism to let Scudo access a platform-specific TLS slot
An upcoming change to Scudo will change how we use the TLS slot
in tsd_shared.h, which will be a little easier to deal with if
we can remove the code path that calls pthread_getspecific and
pthread_setspecific. The only known user of this code path is Fuchsia.
We can't eliminate this code path by making Fuchsia use ELF TLS
because although Fuchsia supports ELF TLS, it is not supported within
libc itself. To address this, Roland McGrath on the Fuchsia team has
proposed that Scudo will optionally call a platform-provided function
to access a TLS slot reserved for Scudo. Android also has a reserved
TLS slot, but the code that accesses the TLS slot lives in Scudo.
We can eliminate some complexity and duplicated code by having Android
use the same mechanism that was proposed for Fuchsia, which is what
this change does. A separate change to Android implements it.
Differential Revision: https://reviews.llvm.org/D87420
MaheshRavishankar [Thu, 10 Sep 2020 23:47:29 +0000 (16:47 -0700)]
[mlir][Analysis] Allow Slice Analysis to work with linalg::LinalgOp
Differential Revision: https://reviews.llvm.org/D87307
Jonas Devlieghere [Fri, 11 Sep 2020 01:48:24 +0000 (18:48 -0700)]
[lldb] Add missing LLDB_REGISTER_CONSTRUCTOR in SBPlatform
This fixes the following assertion in TestPlatformPython.py.
Assertion failed: (id != 0 && "Forgot to add function to
registry?")
Xing GUO [Fri, 11 Sep 2020 00:42:16 +0000 (08:42 +0800)]
[obj2yaml] Add support for dumping the .debug_ranges section.
This patch adds support for dumping the .debug_ranges section to
elf2yaml.
Reviewed By: jhenderson
Differential Revision: https://reviews.llvm.org/D87429
Zarko Todorovski [Fri, 11 Sep 2020 00:07:11 +0000 (20:07 -0400)]
Remove unused variable introduce in
0448d11a06b451a causing build
failures with -Werror on.
Reid Kleckner [Thu, 10 Sep 2020 23:45:20 +0000 (16:45 -0700)]
Fix wrong comment about enabling optimizations to work around a bug
Amara Emerson [Thu, 10 Sep 2020 21:57:16 +0000 (14:57 -0700)]
[AArch64][GlobalISel] Don't emit a branch for a fallthrough G_BR at -O0.
With optimizations we leave the decision to eliminate fallthrough branches to
bock placement, but at -O0 we should do it in the selector to save code size.
This regressed -O0 with a recent change to a combiner.
Reid Kleckner [Thu, 10 Sep 2020 18:23:42 +0000 (11:23 -0700)]
Use pragmas to work around MSVC x86_32 debug miscompile bug
Halide users reported this here: https://llvm.org/pr46176
I reported the issue to MSVC here:
https://developercommunity.visualstudio.com/content/problem/1179643/msvc-copies-overaligned-non-trivially-copyable-par.html
This codepath is apparently not covered by LLVM's unit tests, so I added
coverage in a unit test.
If we want to support this configuration going forward, it means that is
in general not safe to pass a SmallVector<T, N> by value if alignof(T)
is greater than 4. This doesn't appear to come up often because passing
a SmallVector by value is inefficient and not idiomatic: it copies the
inline storage. In this case, the SmallVector<LLT,4> is captured by
value by a lambda, and the lambda is passed by value into std::function,
and that's how we hit the bug.
Differential Revision: https://reviews.llvm.org/D87475
Peter Steinfeld [Fri, 4 Sep 2020 15:44:52 +0000 (08:44 -0700)]
[flang] Fix assert on constant folding of extended types
When we define a derived type that extends another derived type, we can then
create a structure constructor that contains values for the fields of both the
child type and its parent. The compiler's internal representation of that
value contains the name of the parent type where a component name would
normally appear. This caused an assert during contant folding.
There are three cases for components that appear in structure constructors.
The first is the normal case of a component appearing in a structure
constructor for its type.
The second is a component of the parent (or grandparent) type appearing in a
structure constructor for the child type.
The third is the parent type component, which can appear in the structure
constructor of its child.
There are also cases where the component can be arrays.
I created the test case folding12.f90 that covers all of these cases and
modified the code to handle them.
Most of my changes were to the "Find()" method of the type
"StructureConstructor" where I added code to cover the second and third cases
described above. To handle these cases, I needed to create a
"StructureConstructor" for the parent type component and return it. To handle
returning a newly created "StructureConstructor", I changed the return type of
"Find()" to be "std::optional" rather than an ordinary pointer.
This change supersedes D86172.
Differential Revision: https://reviews.llvm.org/D87151
Fangrui Song [Thu, 10 Sep 2020 21:30:00 +0000 (14:30 -0700)]
[ELF] Make two PPC64.cpp variables constexpr. NFC
Why are they mutable? :)
Florian Hahn [Thu, 10 Sep 2020 21:00:10 +0000 (22:00 +0100)]
[DSE] Switch to MemorySSA-backed DSE by default.
The tests have been updated and I plan to move them from the MSSA
directory up.
Some end-to-end tests needed small adjustments. One difference to the
legacy DSE is that legacy DSE also deletes trivially dead instructions
that are unrelated to memory operations. Because MemorySSA-backed DSE
just walks the MemorySSA, we only visit/check memory instructions. But
removing unrelated dead instructions is not really DSE's job and other
passes will clean up.
One noteworthy change is in llvm/test/Transforms/Coroutines/ArgAddr.ll,
but I think this comes down to legacy DSE not handling instructions that
may throw correctly in that case. To cover this with MemorySSA-backed
DSE, we need an update to llvm.coro.begin to treat it's return value to
belong to the same underlying object as the passed pointer.
There are some minor cases MemorySSA-backed DSE currently misses, e.g. related
to atomic operations, but I think those can be implemented after the switch.
This has been discussed on llvm-dev:
http://lists.llvm.org/pipermail/llvm-dev/2020-August/144417.html
For the MultiSource/SPEC2000/SPEC2006 the number of eliminated stores
goes from ~17500 (legayc DSE) to ~26300 (MemorySSA-backed). More numbers
and details in the thread on llvm-dev.
Impact on CTMark:
```
Legacy Pass Manager
exec instrs size-text
O3 + 0.60% - 0.27%
ReleaseThinLTO + 1.00% - 0.42%
ReleaseLTO-g. + 0.77% - 0.33%
RelThinLTO (link only) + 0.87% - 0.42%
RelLO-g (link only) + 0.78% - 0.33%
```
http://llvm-compile-time-tracker.com/compare.php?from=
3f22e96d95c71ded906c67067d75278efb0a2525&to=
ae8be4642533ff03803967ee9d7017c0d73b0ee0&stat=instructions
```
New Pass Manager
exec instrs. size-text
O3 + 0.95% - 0.25%
ReleaseThinLTO + 1.34% - 0.41%
ReleaseLTO-g. + 1.71% - 0.35%
RelThinLTO (link only) + 0.96% - 0.41%
RelLO-g (link only) + 2.21% - 0.35%
```
http://195.201.131.214:8000/compare.php?from=
3f22e96d95c71ded906c67067d75278efb0a2525&to=
ae8be4642533ff03803967ee9d7017c0d73b0ee0&stat=instructions
Reviewed By: asbirlea, xbolva00, nikic
Differential Revision: https://reviews.llvm.org/D87163
Bryan Chan [Sat, 29 Aug 2020 21:25:16 +0000 (17:25 -0400)]
[EarlyCSE] Equivalent SELECTs should hash equally
DenseMap<SimpleValue> assumes that, if its isEqual method returns true
for two elements, then its getHashValue method must return the same value
for them. This invariant is broken when one SELECT node is a min/max
operation, and the other can be transformed into an equivalent min/max by
inverting its predicate and swapping its operands. This patch fixes an
assertion failure that would occur intermittently while compiling the
following IR:
define i32 @t(i32 %i) {
%cmp = icmp sle i32 0, %i
%twin1 = select i1 %cmp, i32 %i, i32 0
%cmpinv = icmp sgt i32 0, %i
%twin2 = select i1 %cmpinv, i32 0, i32 %i
%sink = add i32 %twin1, %twin2
ret i32 %sink
}
Differential Revision: https://reviews.llvm.org/D86843
Siva Chandra Reddy [Thu, 10 Sep 2020 19:39:50 +0000 (12:39 -0700)]
[libc][obvious] Include Sqrt.h in SqrtLongDoubleX86.h.
This makes SqrtLongDoubleX86.h includable by itself.
Lang Hames [Thu, 10 Sep 2020 20:10:27 +0000 (13:10 -0700)]
[ORC] Make MaterializationResponsibility immovable, pass by unique_ptr.
Making MaterializationResponsibility instances immovable allows their
associated VModuleKeys to be updated by the ExecutionSession while the
responsibility is still in-flight. This will be used in the upcoming
removable code feature to enable safe merging of resource keys even if
there are active compiles using the keys being merged.
Nikita Popov [Fri, 4 Sep 2020 20:40:46 +0000 (22:40 +0200)]
[DemandedBits][BDCE] Add support for min/max intrinsics
Add DemandedBits / BDCE support for min/max intrinsics: If the low
bits are not demanded in the result, they also aren't demanded in
the operands.
Differential Revision: https://reviews.llvm.org/D87161
Nikita Popov [Thu, 10 Sep 2020 20:11:04 +0000 (22:11 +0200)]
[DemandedBits] Add braces to large if (NFC)
While the if only contains a single statement, it happens to be
a huge switch. Add braces to make this code easier to read.
Nikita Popov [Thu, 10 Sep 2020 16:53:08 +0000 (18:53 +0200)]
[InstCombine] Add more tests for select op replacement (NFC)
Nikita Popov [Thu, 10 Sep 2020 16:51:34 +0000 (18:51 +0200)]
[InstCombine] Regenerate test checks (NFC)
Volkan Keles [Thu, 10 Sep 2020 19:57:38 +0000 (12:57 -0700)]
GlobalISel: Combine fneg(fneg x) to x
https://reviews.llvm.org/D87473
Yaxun (Sam) Liu [Thu, 10 Sep 2020 15:51:31 +0000 (11:51 -0400)]
Diable sanitizer options for amdgpu
Currently AMDGPU does not support sanitizer. Disable
sanitizer options for now until they are supported.
Differential Revision: https://reviews.llvm.org/D87461
Siva Chandra Reddy [Thu, 10 Sep 2020 18:45:21 +0000 (11:45 -0700)]
[libc][NFC][obvious] Remove a redudant dep of strcmp implementation.
Anna Thomas [Thu, 10 Sep 2020 19:30:42 +0000 (15:30 -0400)]
[ImplicitNullChecks] NFC: Remove unused PointerReg arg in dep analysis
The PointerReg arg was passed into the dependence function for an
assertion which no longer exists. So, this patch updates the dependence
functions to avoid the PointerReg in the signature.
Tests-Run: make check
Christopher Tetreault [Thu, 10 Sep 2020 18:29:16 +0000 (11:29 -0700)]
[SVE] Bail from VectorUtils heuristics for scalable vectors
Bail from maskIsAllZeroOrUndef and maskIsAllOneOrUndef prior to iterating over the number of
elements for scalable vectors.
Assert that the mask type is not scalable in possiblyDemandedEltsInMask .
Assert that the types are correct in all three functions.
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D87424
Krzysztof Parzyszek [Thu, 10 Sep 2020 19:15:37 +0000 (14:15 -0500)]
[Hexagon] Split pair-based masked memops
Federico Lebrón [Thu, 10 Sep 2020 19:18:07 +0000 (19:18 +0000)]
Fix operator!= for Dialects.
Currently the global operator!=(bool, bool) is selected due to the implicit bool
conversion operator. Since this is never the desired semantics, we give it a
standard operator!= and make the bool conversion explicit.
Depends On D86809
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D86810
Nico Weber [Thu, 10 Sep 2020 19:10:12 +0000 (15:10 -0400)]
[gn build] (semi-manually) port
009cd4e4910
Federico Lebrón [Thu, 10 Sep 2020 19:14:42 +0000 (19:14 +0000)]
Allow Dialects to be initialized via nullptr.
This allows Dialect to follow the MLIR style of nullable objects, and in fact is expected by `Dialect::operator bool() const` which already tests whether `def == nullptr`. This just wasn't a reachable situation, because the constructor was dereferencing the pointer unconditionally.
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D86807
Federico Lebrón [Thu, 10 Sep 2020 19:00:49 +0000 (19:00 +0000)]
Make struct dialects have the same field name as everything else, 'dialect'.
Also make the behavior of getting a dialect more forgiving, in the case where
there isn't a dialect associated with an attribute.
Depends On D86807
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D86809
Dominic Chen [Thu, 10 Sep 2020 05:02:13 +0000 (01:02 -0400)]
[WebAssembly] Set unreachable as canonical to permit disassembly
Currently, using llvm-objdump to disassemble a function containing
unreachable will trigger an assertion while decoding the opcode, since both
unreachable and debug_unreachable have the same encoding. To avoid this, set
unreachable as the canonical decoding.
Differential Revision: https://reviews.llvm.org/D87431
Lang Hames [Thu, 10 Sep 2020 18:36:13 +0000 (11:36 -0700)]
Revert "[Support] Use unique_function rather than std::function for ThreadPool TaskTy."
This reverts commit
d9c8b0256cfc673c2413b13993c9440be598818f.
Some MSVC std::packaged_task implementations are not compatible with move-only types.
This caused failures on some of the Windows builders (e.g.
http://lab.llvm.org:8011/builders/sanitizer-windows/builds/69412).
Reverting until I can come up with a workaround.
Craig Topper [Wed, 9 Sep 2020 20:45:36 +0000 (13:45 -0700)]
[SLPVectorizer][X86][AMDGPU] Remove fcmp+select to fmin/fmax reduction support.
Previously we could match fcmp+select to a reduction if the fcmp had
the nonans fast math flag. But if the select had the nonans fast
math flag, InstCombine would turn it into a fminnum/fmaxnum intrinsic
before SLP gets to it. Seems fairly likely that if one of the
fcmp+select pair have the fast math flag, they both would.
My plan is to start vectorizing the fmaxnum/fminnum version soon,
but I wanted to get this code out as it had some of the strangest
fast math flag behaviors.
Kamil Rytarowski [Thu, 10 Sep 2020 18:11:35 +0000 (20:11 +0200)]
[compiler-rt] [netbsd] Regenerate syscall hooks
Sync with NetBSD 9.99.72.
Kamil Rytarowski [Thu, 10 Sep 2020 18:09:53 +0000 (20:09 +0200)]
[compiler-rt] [netbsd] Update generate_netbsd_syscalls.awk
Sync with NetBSD 9.99.72.
Fangrui Song [Thu, 10 Sep 2020 18:03:48 +0000 (11:03 -0700)]
[PGO] Skip if an IndirectBrInst critical edge cannot be split
PGOInstrumentation runs `SplitIndirectBrCriticalEdges` but some IndirectBrInst
critical edge cannot be split. `getInstrBB` will crash when calling `SplitCriticalEdge`, e.g.
int foo(char *p) {
void *targets[2];
targets[0] = &&indirect;
targets[1] = &&end;
for (;; p++)
if (*p == 7) {
indirect:
goto *targets[p[1]]; // the self loop is critical in -O
}
end:
return 0;
}
Skip such critical edges to prevent a crash.
Reviewed By: davidxl, lebedev.ri
Differential Revision: https://reviews.llvm.org/D87435
Jordan Rupprecht [Thu, 10 Sep 2020 17:57:08 +0000 (10:57 -0700)]
[NFC] Fix whitespace in lldb-vscode --help
Lang Hames [Thu, 10 Sep 2020 17:05:46 +0000 (10:05 -0700)]
[Support] Use unique_function rather than std::function for ThreadPool TaskTy.
This will allow non-copyable function objects (e.g. lambdas that capture
unique_ptrs) to be used with ThreadPool.
Differential Revision: https://reviews.llvm.org/D87467
Anna Thomas [Thu, 10 Sep 2020 17:14:44 +0000 (13:14 -0400)]
[ImplicitNullCheck] Handle instructions that preserve zero value
This is the first in a series of patches to make implicit null checks
more general. This patch identifies instructions that preserves zero
value of a register and considers that as a valid instruction to hoist
along with the faulting load. See added testcases.
Reviewed-By: reames, dantrushin
Differential Revision: https://reviews.llvm.org/D87108
Kamil Rytarowski [Thu, 10 Sep 2020 17:31:41 +0000 (19:31 +0200)]
[compiler-rt] [netbsd] Improve code formatting
No functional change.
Kamil Rytarowski [Thu, 10 Sep 2020 17:26:59 +0000 (19:26 +0200)]
[compiler-rt] [netbsd] Add fallback definitions for MKISCSI=no
Add dev/iscsi/iscsi_ioctl.h fallback ioctl(2) operations.
Sourabh Singh Tomar [Thu, 10 Sep 2020 17:34:37 +0000 (23:04 +0530)]
Revert D86875 "[Flang][NFC] Remove license comments from files in docs/ folder."
This reverts commit
f787c9a90c69f, this was causing some build issues.
Mircea Trofin [Wed, 9 Sep 2020 00:18:04 +0000 (17:18 -0700)]
[NFC][ThinLTO] Let llvm::EmbedBitcodeInModule handle serialization.
llvm::EmbedBitcodeInModule handles serializing the passed-in module, if
the provided MemoryBufferRef is invalid. This is already the path taken
in one of the uses of the API - clang::EmbedBitcode, when called from
BackendConsumer::HandleTranslationUnit - so might as well do the same
here and reduce (by very little) code duplication.
The only difference this patch introduces is that the serialization happens
with ShouldPreserveUseListOrder set to true.
Differential Revision: https://reviews.llvm.org/D87339
Fangrui Song [Thu, 10 Sep 2020 17:15:27 +0000 (10:15 -0700)]
[gcov] Delete flush_fn_list (unused since D83149)
Stella Stamenova [Thu, 10 Sep 2020 17:09:35 +0000 (10:09 -0700)]
[lldb, tests] Correctly configure the yaml2obj paths
They are currently not being set correctly for the case of multi-config generators like XCode and VS. There's also a typo in one of the cmake files.
Reviewed By: JDevlieghere
Differential Revision: https://reviews.llvm.org/D87466
Ettore Tiotto [Thu, 10 Sep 2020 17:08:57 +0000 (13:08 -0400)]
[ArgumentPromotion]: Copy function metadata after promoting arguments
The argument promotion pass currently fails to copy function annotations
over to the modified function after promoting arguments.
This patch copies the original function annotation to the new function.
Reviewed By: fhann
Differential Revision: https://reviews.llvm.org/D86630
Kit Barton [Mon, 17 Aug 2020 20:33:47 +0000 (15:33 -0500)]
[PPC][GlobalISel] Add initial GlobalIsel infrastructure
This adds the initial GlobalISel skeleton for PowerPC. It can only run
ir-translator and legalizer for `ret void`.
This is largely based on the initial GlobalISel patch for RISCV
(https://reviews.llvm.org/D65219).
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D83100
LLVM GN Syncbot [Thu, 10 Sep 2020 16:54:11 +0000 (16:54 +0000)]
[gn build] Port
c01d28dc51b
Azharuddin Mohammed [Thu, 10 Sep 2020 16:49:45 +0000 (09:49 -0700)]
Revert "[gcov] Delete flush_fn_list (unused since D83149)"
This reverts commit
01cdab0b335e21321987505e66f34c24dc55b0d7.
It was causing the instrprof-darwin-exports.c test to fail.
```
Undefined symbols for architecture x86_64:
"_flush_fn_list", referenced from:
-exported_symbol[s_list] command line option
```
Eugene Burmako [Thu, 10 Sep 2020 16:48:13 +0000 (18:48 +0200)]
Introduce linalg.vecmat
This patch adds a new named structured op to accompany linalg.matmul and
linalg.matvec. We needed it for our codegen, so I figured it would be useful
to add it to Linalg.
Reviewed By: nicolasvasilache, mravishankar
Differential Revision: https://reviews.llvm.org/D87292
YangZhihui [Thu, 10 Sep 2020 16:45:13 +0000 (09:45 -0700)]
Fix typo in dsymutil.rst
Differential revision: https://reviews.llvm.org/D87438
Eduardo Caldas [Wed, 9 Sep 2020 08:36:39 +0000 (08:36 +0000)]
[SyntaxTree] Specialize `TreeTestBase` for `BuildTreeTest`, `MutationsTest` and `SynthesisTest`
Differential Revision: https://reviews.llvm.org/D87374
Simon Pilgrim [Thu, 10 Sep 2020 16:35:02 +0000 (17:35 +0100)]
SwitchLoweringUtils.h - reduce TargetLowering.h include. NFCI.
Only include the headers we actually need, and move the remaining includes down to implicit dependent files.
Owen Anderson [Tue, 8 Sep 2020 18:41:56 +0000 (18:41 +0000)]
Mark FMOV constant materialization as being as cheap as a move.
This prevents us from doing things like LICM'ing it out of a loop,
which is usually a net loss because we end up having to spill a
callee-saved FPR to accomodate it.
This does perturb instruction scheduling around this instruction,
so a number of tests had to be updated to account for it.
Reviewed By: t.p.northover
Differential Revision: https://reviews.llvm.org/D87316
Louis Dionne [Thu, 10 Sep 2020 16:20:18 +0000 (12:20 -0400)]
[libcxx] Make sure we pass -isysroot when linking AND when compiling
Simon Pilgrim [Thu, 10 Sep 2020 15:52:05 +0000 (16:52 +0100)]
Hexagon.h - remove unnecessary includes. NFCI.
Replace with forward declarations and move includes to implicit dependent files.
Krzysztof Parzyszek [Wed, 9 Sep 2020 23:05:00 +0000 (18:05 -0500)]
[GVN] Account for masked loads/stores depending on load/store instructions
This is a case where an intrinsic depends on a non-call instruction.
Differential Revision: https://reviews.llvm.org/D87423
Aaron Ballman [Thu, 10 Sep 2020 15:35:10 +0000 (11:35 -0400)]
Speculatively fix the Sphinx builder.
Craig Topper [Thu, 10 Sep 2020 13:55:00 +0000 (06:55 -0700)]
[builtins] Write __divmoddi4/__divmodsi4 in terms __udivmod instead of __div and multiply.
Previously we calculating the remainder by multiplying the
quotient and divisor and subtracting from the dividend.
__udivmod can calculate the remainder while calculating the
quotient. We just need to correct the sign afterward.
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D87433
Nico Weber [Thu, 10 Sep 2020 15:05:28 +0000 (11:05 -0400)]
Fix clangd build after
33c9dbbd380
Simon Pilgrim [Thu, 10 Sep 2020 14:12:05 +0000 (15:12 +0100)]
[X86] Use Register instead of unsigned. NFCI.
Fixes llvm-prefer-register-over-unsigned clang-tidy warnings.
Simon Pilgrim [Thu, 10 Sep 2020 12:09:48 +0000 (13:09 +0100)]
AArch64MachineFunctionInfo.h - remove unnecessary TargetFrameLowering.h include. NFCI.
Nico Weber [Thu, 3 Sep 2020 23:37:29 +0000 (19:37 -0400)]
Add an explicit toggle for the static analyzer in clang-tidy
Instead of using CLANG_ENABLE_STATIC_ANALYZER for use of the
static analyzer in both clang and clang-tidy, add a second
toggle CLANG_TIDY_ENABLE_STATIC_ANALYZER.
This allows enabling the static analyzer in clang-tidy while
disabling it in clang.
Differential Revison: https://reviews.llvm.org/D87118
Frederik Gossen [Thu, 10 Sep 2020 14:41:39 +0000 (14:41 +0000)]
[MLIR][Standard] Simplify `tensor_from_elements`
Define assembly format and add required traits.
Differential Revision: https://reviews.llvm.org/D87366
Yuriy Chernyshov [Thu, 10 Sep 2020 14:40:40 +0000 (16:40 +0200)]
[TableGen] Do not construct string from nullptr
While I am trying to forbid such usages systematically in
https://reviews.llvm.org/D79427 / P2166R0 to C++ standard,
this PR fixes this (definitelly incorrect) usage in llvm.
Differential Revision: https://reviews.llvm.org/D87185
Tim Keith [Thu, 10 Sep 2020 14:22:52 +0000 (07:22 -0700)]
[flang] Fix check for distinguishable operators/assignments
Change how generic operators and assignments are checked for
distinguishable procedures. Because of how they are invoked, available
type-bound generics and normal generics all have to be considered
together. This is different from how generic names are checked.
Move common part of checking into DistinguishabilityHelper so that it
can be used in both cases after the appropriate procedures have been
added.
Cache result of Procedure::Characterize(Symbol) in a map in
CheckHelper so that we don't have to worry about passing the
characterized Procedures around or the cost of recomputing them.
Add MakeOpName() to construct names for defined operators and assignment
for using in error messages. This eliminates the need for different
messages in those cases.
When the procedures for a defined operator or assignment are undistinguishable,
include the type name in the error message, otherwise it may be ambiguous.
Add missing check that procedures for defined operators are functions
and that their dummy arguments are INTENT(IN) or VALUE.
Differential Revision: https://reviews.llvm.org/D87341
Nikita Popov [Thu, 10 Sep 2020 14:16:44 +0000 (16:16 +0200)]
[InstCombine] Temporarily do not drop volatile stores before unreachable
See discussion in D87149. Dropping volatile stores here is legal
per LLVM semantics, but causes issues for real code and may result
in a change to LLVM volatile semantics. Temporarily treat volatile
stores as "not guaranteed to transfer execution" in just this place,
until this issue has been resolved.
Kamil Rytarowski [Thu, 10 Sep 2020 10:45:24 +0000 (12:45 +0200)]
[lldb] [netbsd] Avoid comparison of signed and unsigned integers
Cast ProcessID to ::pid_t.
LLVM GN Syncbot [Thu, 10 Sep 2020 13:33:11 +0000 (13:33 +0000)]
[gn build] Port
ebf496d8055
Roman Lebedev [Thu, 10 Sep 2020 13:31:56 +0000 (16:31 +0300)]
Revert "[clang-tidy] New check readability-prefer-member-initializer"
Either contains unbounded loops, or has *very* high runtime,
100+x of all the current clang-tidy checks.
This reverts commit
f5fd7486d6c0debb465de3e927fcc31884874280.
Jay Foad [Thu, 10 Sep 2020 12:49:33 +0000 (13:49 +0100)]
[TargetLowering] Fix comments describing XOR -> OR/AND transformations
Sanjay Patel [Thu, 10 Sep 2020 12:45:36 +0000 (08:45 -0400)]
[x86] add tests for fmax/fmin experimental intrinsics with 'fast' FMF; NFC
D87391 proposes to change the lowerings for 'nnan'-only FMF.
That's the minimal requirement to get good codegen for x86,
but currently we have bugs hindering that output unless the
full 'fast' FMF is applied. These tests provide coverage for
the ideal lowerings.
Guillaume Chatelet [Thu, 10 Sep 2020 12:27:32 +0000 (12:27 +0000)]
Fix invalid link format in Clang LanguageExtension
Guillaume Chatelet [Thu, 10 Sep 2020 12:01:18 +0000 (12:01 +0000)]
Fix broken link for Sphinx installation
Florian Hahn [Thu, 10 Sep 2020 12:09:25 +0000 (13:09 +0100)]
[DSE] Support eliminating memcpy.inline.
MemoryLocation has been taught about memcpy.inline, which means we can
get the memory locations read and written by it. This means DSE can
handle memcpy.inline
Louis Dionne [Wed, 9 Sep 2020 20:14:56 +0000 (16:14 -0400)]
[libcxx] Simplify back-deployment testing
The needs of back-deployment testing currently require two different
ways of running the test suite: one based on the deployment target,
and one based on the target triple. Since the triple includes all the
information we need, it's better to have just one way of doing things.
Furthermore, `--param platform=XXX` is also supersedded by using the
target triple. Previously, this parameter would serve the purpose of
controling XFAILs for availability markup errors, however it is possible
to achieve the same thing by using with_system_cxx_lib only and using
.verify.cpp tests instead, as explained in the documentation changes.
The motivation for this change is twofold:
1. This part of the Lit config has always been really confusing and
complicated, and it has been a source of bugs in the past. I have
simplified it iteratively in the past, but the complexity is still
there.
2. The deployment-target detection started failing in weird ways in
recent Clangs, breaking our CI. Instead of band-aid patching the
issue, I decided to remove the complexity altogether by using target
triples even on Apple platforms.
A follow-up to this commit will bring the test suite in line with
the recommended way of handling availability markup tests.
Max Kazantsev [Thu, 10 Sep 2020 11:45:12 +0000 (18:45 +0700)]
[NFC] Refactoring in SCEV: add missing `const` qualifiers
Simon Pilgrim [Thu, 10 Sep 2020 11:58:03 +0000 (12:58 +0100)]
[CodeGen][X86] Move x86 builtin intrinsic/codegen tests into X86 subfolder.
There are still plenty of tests that specify x86 as a triple but most shouldn't be doing anything very target specific - we can move any ones that I have missed on a case by case basis.
serge-sans-paille [Tue, 8 Sep 2020 12:38:16 +0000 (14:38 +0200)]
[clang-tidy] Fix reST syntax
Authored by Eisuke Kawashima [https://github.com/llvm/llvm-project/pull/245]
Simon Pilgrim [Thu, 10 Sep 2020 11:38:23 +0000 (12:38 +0100)]
[Codegen][X86] Move AMX specific codegen tests into X86 subfolder.
Simon Pilgrim [Thu, 10 Sep 2020 11:17:54 +0000 (12:17 +0100)]
[CostModel][X86] Add vXi32 division by uniform constant costs (PR47476)
Other types can be handled in future patches but their uniform / non-uniform costs are more similar and don't appear to cause many vectorization issues.
Simon Pilgrim [Thu, 10 Sep 2020 10:52:20 +0000 (11:52 +0100)]
[SLP][X86] Add division by uniform constant tests (PR47476)