Commit Graph

401858 Commits

Author SHA1 Message Date
Arthur Eubanks b6a8c69554 [NFC] Rename EmitAssemblyHelper new/legacy PM methods
To reflect the fact that the new PM is the default now.

Differential Revision: https://reviews.llvm.org/D111680
2021-10-12 15:41:44 -07:00
Vitaly Buka f815c2ccda [sanitizer] Fix test on Windows 2021-10-12 15:38:37 -07:00
Vitaly Buka 3ec4d4dc99 [NFC][sanitizer] Add a few consts
Depends on D111609.

Reviewed By: dvyukov

Differential Revision: https://reviews.llvm.org/D111610
2021-10-12 15:38:37 -07:00
Lang Hames adf55ac665 [ORC] Call ExecutorProcessControl::disconnect in unit tests that require it.
Another follow-up to 2815ed57e3 and 19b4e3cfc6. For unit tests that don't use
an ExecutionSession we need to call ExecutorProcessControl::disconnect directly
to wait for the dispatcher to shut down.

https://llvm.org/PR52153
2021-10-12 14:59:39 -07:00
Artem Belevich f526ee5b85 [CUDA] Provide address space conversion builtins.
CUDA-11 headers rely on these NVCC builtins.
Despite having `__nv` previx, those are *not* provided by libdevice.

Differential Revision: https://reviews.llvm.org/D111665
2021-10-12 14:56:39 -07:00
Lang Hames 19b4e3cfc6 [ORC] Call ExecutionSession::endSession in unit tests.
2815ed57e3 added calls from ExecutorProcessControl::disconnect implementations
to shut down the TaskDispatcher. We still need to call endSession to trigger
disconnection though. This commit adds the necessary calls to the failing unit
tests.

https://llvm.org/PR52153
2021-10-12 14:27:39 -07:00
Arthur Eubanks 2cadef6537 [clang] Teardown new PM data structures before running codegen pipeline
Do this by refactoring the optimization and codegen pipelines into separate functions.

This saves a tiny bit of memory in non-LTO builds [1].

[1] https://llvm-compile-time-tracker.com/compare.php?from=fbddf22ef72d3c2e9b14e1501841b03380eef12b&to=cd276df52eb6f2b84a8e1efe5318460c6debf82d&stat=max-rss

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D111582
2021-10-12 14:17:11 -07:00
Vitaly Buka d402fb02b9 [NFC][sanitizer] Clang-format a line
Depends on D111608.

Reviewed By: dvyukov

Differential Revision: https://reviews.llvm.org/D111609
2021-10-12 14:11:26 -07:00
Vitaly Buka 67905bcaf3 [sanitizer] Re-enable test on Windows
It's likely missdiagnosed issue fixed with 336e88636a
2021-10-12 14:10:46 -07:00
Diego Caballero eeb09fd646 [mlir][Linalg] Enable vectorization of 'mul', 'and', 'or' and 'xor' reductions
This patch adds support for vectorizing 'mul', 'and', 'or' anx 'xor' reductions
to Linalg.

Reviewed By: pifon2a, ThomasRaoux, aartbik

Differential Revision: https://reviews.llvm.org/D111565
2021-10-12 21:08:23 +00:00
Diego Caballero 5c1d356c18 [mlir][Linalg] Enable vectorization of explicit broadcasts
This patch teaches `isProjectedPermutation` and `inverseAndBroadcastProjectedPermutation`
utilities to deal with maps representing an explicit broadcast, e.g., (d0, d1) -> (d0, 0).
This extension is needed to enable vectorization of such explicit broadcast in Linalg.

Reviewed By: pifon2a, nicolasvasilache

Differential Revision: https://reviews.llvm.org/D111563
2021-10-12 21:08:22 +00:00
Nico Weber f09dce564e [lld] fix typos to cycle bots 2021-10-12 17:03:39 -04:00
Jean Perier 68d692375c
[fir] Add cfg conversion pass
This patch upstream the cfg conversion pass. This pass
rewrite FIR loop-like operation to a CFG.

This patch is part of the upstreaming effort from fir-dev branch.

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
Co-authored-by: Valentin Clement <clementval@gmail.com>

Reviewed By: schweitz

Differential Revision: https://reviews.llvm.org/D111095
2021-10-12 23:01:54 +02:00
Vitaly Buka d80a5d54e1 [NFC][sanitizer] Move consts into on top of the class 2021-10-12 13:59:16 -07:00
Vitaly Buka 38f121cd84 [sanitizer] Switch StackDepot to TwoLevelMap
Depends on D111607.

Reviewed By: dvyukov

Differential Revision: https://reviews.llvm.org/D111608
2021-10-12 13:57:30 -07:00
Philip Reames 6f34839407 [instcombine] propagate freeze through single use poison producing flag instruction
If we have an instruction which produces poison only when flags are specified on the instruction, then we know that freezing the operands and dropping flags is equivalent to freezing the result. If we know those flags don't result in any undefined behavior being executed, then there's no point in preserving the flags as we gain no knowledge by having them.

This patch extends the existing propagation logic which sinks freeze to single potential non-poison operands to allow dropping of flags when we know the freeze is the sole use of the instruction with poison flags.

The main value is that we tend to sink freezes towards the phi in IV cycles where the incoming value to the phi is the freeze of an IV increment. This will in turn (in a future patch), let us fold the freeze through the phi into the loop preheader. Motivated by eliminating need for CanonicalizeFreezeInLoops for the clearly profitable cases from onephi.ll test case in the test directory.

Differential Revision: https://reviews.llvm.org/D111675
2021-10-12 13:52:41 -07:00
Vitaly Buka 884d290427 [sanitizer] Remove SpinMutexLock from stat function
Mapped size is more appropriate for most users.

Depends on D111605.

Reviewed By: dvyukov

Differential Revision: https://reviews.llvm.org/D111607
2021-10-12 13:49:10 -07:00
Albion Fung b4b9f9b4b3 [PowerPC] Emit dcbt and dcbtst in place of their extended mnemonics on AIX
On AIX, the system assembler does not support the extended mnemonics
dcbtt and dcbtstt. This patch stops them from being emitted on
AIX and emits the base mnemonics instead, dcbt X, X, 16 and
dcbtstt X, X, 16 respectively.

Differential revision: https://reviews.llvm.org/D111258
2021-10-12 15:47:57 -05:00
Lang Hames 2815ed57e3 [ORC] Shut down dispatcher in ExecutorProcessControl implementations.
f341161689 added a task dispatcher for async handlers, but didn't add a
TaskDispatcher::shutdown call to SelfExecutorProcessControl or SimpleRemoteEPC.
This patch adds the missing call, which ensures that we don't destroy the
dispatcher while tasks are still running.

This should fix the use-after-free crash seen in
https://lab.llvm.org/buildbot/#/builders/5/builds/13063
2021-10-12 13:40:15 -07:00
Vitaly Buka 9939e562f7 [NFC][sanitizer] Refactor Maps into templates
Depends on D111599.

Reviewed By: dvyukov

Differential Revision: https://reviews.llvm.org/D111605
2021-10-12 13:37:44 -07:00
Philip Reames c24b2ad0e2 Add extra tests for D111675 2021-10-12 13:37:13 -07:00
Vitaly Buka 336e88636a [sanitizer] Fix test on Windows
UL suffix on MSVC is 32bit.
2021-10-12 13:24:40 -07:00
Vitaly Buka 0e0d3b3326 [sanitizer] Fix typo in test 2021-10-12 13:24:40 -07:00
Roland Froese 28e648b29e [PowerPC] Simplify PPC codegen test pre-inc-disable.ll
Simplify the test case to make it easier to look at. Change from auto-generated
checks to targeted manual checks to reduce sensitivity to register allocation
and scheduling changes.

Differential Revision: https://reviews.llvm.org/D111333
2021-10-12 20:12:31 +00:00
Rob Suderman 95e4b71519 [mlir][tosa] Fix tosa average_pool2d to linalg type issue
Average pool assumed the same input/output type. Result type for integers
is always an i32, should be updated appropriately.

Reviewed By: GMNGeoffrey

Differential Revision: https://reviews.llvm.org/D111590
2021-10-12 13:09:21 -07:00
David Blaikie d7e766c781 DebugInfo: Add test coverage for non-zero addrx in DW_FORM_LLVM_addrx_offset
Noticed in code review
4318028cd2 (commitcomment-57738034)

But the issue had already been fixed in
943b304848 due to a code checking tool
(PVS studio) identification, but that lacked test coverage.

Refactor this test a little bit too by using more CHECK-SAME to help the
checks fail sooner (rather than, if the addrx or sizes are wrong, having
that check bind to a much later output line - and then fail due to the
implicit-check-nots, which don't provide a lot of information about
where the intended check was likely to land) & more informatively.
2021-10-12 13:02:47 -07:00
David Blaikie dfa8d33eea DebugInfo: Update ranges_always.ll to include more details about how to generate the IR
Also modify the test to be more robust (current IR generation doesn't
include call sites for callees that are only declared but not defined -
so the test case couldn't be regenerated - add a function definition (&
optnone attribute) so it doesn't depend on call sites for
declared-but-not-defined functions)
2021-10-12 13:02:47 -07:00
peter klausler f7858e7582 [flang] Fix build on FreeBSD (need size_t)
Add #include <cstddef> to time-intrinsic.h so std::size_t is
guaranteed to be available.
2021-10-12 13:00:00 -07:00
Jacques Pienaar 04d76d3694 [mlir][python] Add nameloc getter
Expose the nameloc getter to Python API.

Differential Revision: https://reviews.llvm.org/D111663
2021-10-12 12:45:57 -07:00
Philip Reames 357b8d7ddb [tests] Add coverage for cases we can drop flags to propagate freeze without cost 2021-10-12 12:30:46 -07:00
Ayal Zaks 15692fd6b5 [LV] Fix 2nd crash for reverse interleaved groups under mask/fold-tail.
This patch fixes another crash revealed by PR51614:
when *deciding* to vectorize with masked interleave groups, check if the access
is reverse (which is currently not supported).

Differential Revision: https://reviews.llvm.org/D108900
2021-10-12 21:44:42 +03:00
Amara Emerson 5abce56edb [GlobalISel] Add support for constant vector folding of binops in CSEMIRBuilder.
Differential Revision: https://reviews.llvm.org/D111524
2021-10-12 11:31:22 -07:00
Arthur Eubanks 26827337df Remove checks for old gcc versions for LLVM_ATTRIBUTE_*
According to [1] we only support gcc 5.1+. So these checks for older gcc versions are not supported.

Some gcc 5.1+ versions still don't support __has_builtin, so just check __GNUC__ in those cases.

Add a missing #endif for LLVM_ATTRIBUTE_UNREACHABLE.

[1] https://llvm.org/docs/GettingStarted.html#host-c-toolchain-both-compiler-and-standard-library

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D111581
2021-10-12 11:19:48 -07:00
Michael Jones 9e9803bf82 [libc] Add strncat and fix strcat
This adds strncat to llvm libc. In addition, an error was found with
strcat and that was fixed.

Reviewed By: lntue

Differential Revision: https://reviews.llvm.org/D111583
2021-10-12 18:18:18 +00:00
Tobias Gysi 63638ed181 [mlir][linalg] Enable the vector transfer lowering by default.
Adapt CodegenStartegy to used the vector transfer lowering patterns by default.

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D111649
2021-10-12 18:11:05 +00:00
Vitaly Buka b4db2a500d [sanitizer] Fix StackDepotPrintAll
unlock corrupted backets by using s set by loop to nullptr.
Also StackDepot supports iterating without locking.

Reviewed By: dvyukov

Differential Revision: https://reviews.llvm.org/D111599
2021-10-12 10:57:40 -07:00
William Woodruff 86a4a93a1c [docs] [NFC] Clarify the datalayout documentation
This patch fixes a couple of small oversights in the documentation for
the datalayout specification:

* The v and f specifications are subject to the same constraints on <size>
as i is.
* The p[n] specification didn't mark <idx> as optional, despite
being documented and parsed as such.
* Similarly, none of the alignment specifications require <pref>.
2021-10-12 23:21:48 +05:30
Kevin P. Neal bdf6ba2d30 [FPEnv][InstSimplify] Precommit tests: Enable more folds for constrained fsub
Precommit tests for D107285 as requested. TODO notes left at individual
functions also as requested.
2021-10-12 13:47:28 -04:00
Mircea Trofin ea4a6c8426 [Inline] Make sure the InlineAdvisor is correctly cleared.
If another inlining session came after a ModuleInlinerWrapperPass, the
advisor alanysis would still be cached, but its Result would be cleared.
We need to clear both.

This addresses PR52118

Differential Revision: https://reviews.llvm.org/D111586
2021-10-12 10:42:41 -07:00
Artem Dergachev f3ec9d8501 [analyzer] Fix non-obvious analyzer warning: Use of zero-allocated memory.
Clarify the message provided when the analyzer catches the use of memory
that is allocated with size zero.

Differential Revision: https://reviews.llvm.org/D111655
2021-10-12 10:41:00 -07:00
LLVM GN Syncbot 27bc1e6164 [gn build] Port 9cf995be6b 2021-10-12 17:32:05 +00:00
LLVM GN Syncbot e9119a74d9 [gn build] Port 838b4a533e 2021-10-12 17:32:04 +00:00
Nico Weber 532d71c8b0 [gn build] (manually) port 67f94e5a97 2021-10-12 13:31:50 -04:00
Nico Weber 2cc42758a9 [clang/CFG] Don't explicitly add AttributedStmtClass to AlwaysAddList
CFGBuilder::addStmt() implicitly passes AddStmtChoice::AlwaysAdd
to Visit() already, so this should have no behavior change.

Differential Revision: https://reviews.llvm.org/D111570
2021-10-12 13:29:19 -04:00
Roman Lebedev 958da6598f
[X86] `detectAVGPattern()`: don't require zext in the with-constant case 2021-10-12 20:24:17 +03:00
Roman Lebedev 0902451abe
[NFC][X86] Add another test case for PR52131 2021-10-12 20:19:35 +03:00
Lang Hames bbc2fc548b [Support][ORC] Add an explicit release operation to OwningMemoryBlock.
This gives OwningMemoryBlock clients a way to check for errors on release.

rdar://84127175
2021-10-12 10:13:43 -07:00
Roman Lebedev a1d57f75d1
[NFC][X86] `detectAVGPattern()`: rely on `AVGSplitter()` to perform truncation 2021-10-12 20:12:09 +03:00
Benjamin Kramer f67d57c95f [mlir][Shape] Add a pattern to turn extract from shape_of into tensor.dim
If I remember correctly this wasn't done previously because dim used to
be in the memref dialect.

Differential Revision: https://reviews.llvm.org/D111651
2021-10-12 19:09:21 +02:00
Stanislav Mekhanoshin 9cf995be6b [AMDGPU] Promote generic pointer kernel arguments into global
The new pass walks kernel's pointer arguments, then loads from them.
If a loaded value is a pointer and loaded pointer is unmodified in
the kernel before the load, then promote loaded pointer to global.
Then recursively continue.

Differential Revision: https://reviews.llvm.org/D111464
2021-10-12 10:07:33 -07:00