Philip Reames [Wed, 13 Oct 2021 03:35:27 +0000 (20:35 -0700)]
[tests] Add coverage for follow ons to D111675
Philip Reames [Wed, 13 Oct 2021 03:23:22 +0000 (20:23 -0700)]
Fix bug introduced with 6f34839 (poison flags on floating point ops)
The newly introduced API for checking whether poison comes solely from flags which can be dropped was out of sync. This was noticed by a reviewer post commit.
For the moment, disable the floating point flags. In a follow up change, I plan to add support in dropPoisonGeneratingFlags, but that deserves to be a change of it's own.
Mogball [Tue, 12 Oct 2021 23:14:57 +0000 (23:14 +0000)]
[MLIR] Replace std ops with arith dialect ops
Precursor: https://reviews.llvm.org/D110200
Removed redundant ops from the standard dialect that were moved to the
`arith` or `math` dialects.
Renamed all instances of operations in the codebase and in tests.
Reviewed By: rriddle, jpienaar
Differential Revision: https://reviews.llvm.org/D110797
Jinsong Ji [Wed, 13 Oct 2021 02:20:27 +0000 (02:20 +0000)]
[compiler-rt][profile] Enable profile tests for AIX
This patch enable profile test for supported options on AIX.
Reviewed By: w2yehia
Differential Revision: https://reviews.llvm.org/D110945
Joe Loser [Wed, 13 Oct 2021 02:30:58 +0000 (22:30 -0400)]
[libc++][docs] Mark LWG3274 as complete
Mark LWG3274 as complete. The feature test macro `__cpp_lib_span` was added in
`
6d2599e4f776d0cd88438cb82a00c4fc25cc3f67`.
https://wg21.link/p1024 mentions marking `span:::empty()` with
`[[nodiscard]]` which is not done yet. So, do that and add tests.
Reviewed By: ldionne, Quuxplusone, Mordante, #libc
Differential Revision: https://reviews.llvm.org/D111516
David Blaikie [Tue, 12 Oct 2021 22:24:05 +0000 (15:24 -0700)]
Improve printing of const variable sized arrays
Follow-on from
40acc0adad59ac39e9a7a02fcd93161298500c00 with help from
Richard Smith on how to provoke this particular case.
Weiwei Li [Wed, 13 Oct 2021 01:59:38 +0000 (09:59 +0800)]
[mlir][SPIRVToLLVM] Solve ExecutionModeOp redefinition and add OpTypeSampledImage into SPV_Type
1. To avoid two ExecutionModeOp using the same name, adding the value of execution mode in name when converting to LLVM dialect.
2. To avoid syntax error in spv.OpLoad, add OpTypeSampledImage into SPV_Type.
Reviewed by:antiagainst
Differential revision:https://reviews.llvm.org/D111193
peter klausler [Wed, 13 Oct 2021 01:57:58 +0000 (18:57 -0700)]
[flang] Fixing Windows build (take 3)
Add explicit casts to replace implicit conversions and
recently deleted assignment operators from uint128.h
used in runtime/edit-output.cpp.
Gulfem Savrun Yeniceri [Tue, 12 Oct 2021 17:56:42 +0000 (17:56 +0000)]
[profile] Remove emitting symbolizer markup
Fuchsia Clang code coverage pipeline started to use binary ids that are
embedded in profiles. This patch removes emitting symbolizer markup,
which is not necessary in the coverage pipeline anymore.
Differential Revision: https://reviews.llvm.org/D111674
peter klausler [Wed, 13 Oct 2021 01:10:33 +0000 (18:10 -0700)]
[flang] Fix Windows build (take 2)
Remove the offending "operator=()" member functions. This should
silence the MSVC warnings that persist in uint128.h.
Ben Shi [Mon, 11 Oct 2021 14:01:37 +0000 (14:01 +0000)]
[RISCV] Optimize immediate materialisation with BCLRI
Do the following optimization for immediate materialisation:
1. For values in range 0xffffffff
7fffffff ~ 0xffffffff
00000000, first
generate the lower 32-bit with Val|0x80000000 (which is expected be an
int32), then emit (BCLRI r, 31).
2. For values in range 0x80000000 ~ 0xffffffff, first generate the lower
32-bit with Val&~0x80000000 (which is expected to be an int32), then
emit (BSETI r, 31).
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D111532
Matthias Springer [Wed, 13 Oct 2021 00:50:43 +0000 (09:50 +0900)]
[mlir][linalg][bufferize][NFC] Remove InSpaceSpec from bufferizesToMemoryWrite
Move functionality into a separate function `isInplaceMemoryWrite`.
Differential Revision: https://reviews.llvm.org/D111040
Matthias Springer [Wed, 13 Oct 2021 00:38:50 +0000 (09:38 +0900)]
[mlir][linalg][bufferize][NFC] Simplify getAliasingOpOperand signature
Differential Revision: https://reviews.llvm.org/D110982
peter klausler [Wed, 13 Oct 2021 00:40:28 +0000 (17:40 -0700)]
[flang] Fix "latest-clang" build warnings
A recent patch to fix warnings from a Windows build regarding
inconsistent "struct" vs "class" usage missed a few code sites
and now the "latest-clang" build bot is also failing. This
patch should resolve those failing builds.
Matthias Springer [Wed, 13 Oct 2021 00:31:06 +0000 (09:31 +0900)]
[mlir][linalg][bufferize][NFC] Simplify allocateBuffersForResults
Reuse `getResultBuffer`.
Differential Revision: https://reviews.llvm.org/D110941
Matthias Springer [Wed, 13 Oct 2021 00:23:59 +0000 (09:23 +0900)]
[mlir][linalg][bufferize] Put buffer copying in separate function
This is to avoid code duplication.
Differential Revision: https://reviews.llvm.org/D110940
Matthias Springer [Wed, 13 Oct 2021 00:16:29 +0000 (09:16 +0900)]
[mlir][linalg][bufferize][NFC] Conflict detection funcs take OpOperand and OpResult
By doing so, it is not necessary to get the OpOperand a second time via
getAliasingOpOperand. Also, code slightly more readable because we do
not have to deal with Optional<> return value.
Differential Revision: https://reviews.llvm.org/D110918
peter klausler [Wed, 13 Oct 2021 00:14:14 +0000 (17:14 -0700)]
[flang] Fix Windows build
A recently added class constructor needs to be "explicit" to
prevent it from being available for use as a conversion, which
is breaking the MSVC build of flang.
Matthias Springer [Wed, 13 Oct 2021 00:08:20 +0000 (09:08 +0900)]
[mlir][linalg][bufferize][NFC] Reduce code duplication around bufferizableInPlaceAnalysis
Differential Revision: https://reviews.llvm.org/D111380
Fangrui Song [Tue, 12 Oct 2021 23:18:51 +0000 (16:18 -0700)]
[X86] Remove little support we had for MPX
GCC 9.1 removed Intel MPX support. Linux kernel removed MPX in 2019.
glibc 2.35 will remove MPX.
Our support is limited: we support assembling of bndmov but not bnd.
Just remove it.
Reviewed By: pengfei, skan
Differential Revision: https://reviews.llvm.org/D111517
Fangrui Song [Tue, 12 Oct 2021 23:16:58 +0000 (16:16 -0700)]
[lldb][test] Remove Intel MPX tests
Intel MPX failed to gain wide adoption and has been deprecated for a while.
GCC 9.1 removed Intel MPX support. Linux kernel removed MPX in 2019.
glibc 2.35 will remove the support.
thomasraoux [Tue, 12 Oct 2021 23:09:49 +0000 (16:09 -0700)]
[mlir] update new linalg vectorization tests after vectorization fix
peter klausler [Mon, 11 Oct 2021 22:41:14 +0000 (15:41 -0700)]
[flang] runtime: fix output B/O/Z editing of "negative" values
B/O/Z integer output editing must not reflect any sign extension
of scalar output values. Add more size-dependent OutputInteger
I/O APIs and kind instantiations of EditIntegerOutput.
Differential Revision: https://reviews.llvm.org/D111678
peter klausler [Tue, 12 Oct 2021 17:17:02 +0000 (10:17 -0700)]
[flang][NFC] Document extension: scalars are trivially contiguous
The Fortran 2018 standard defines the concept of simple contiguity
in subclause 9.5.4 as a characteristic of arrays. So that scalars
may also be used in contexts where simply contiguous arrays are
allowed, f18 treats them as single-element arrays that are trivially
contiguous. This patch documents this semantic extension and
also adds comments to the predicate that implements the concept.
Differential Revision: https://reviews.llvm.org/D111679
peter klausler [Tue, 12 Oct 2021 20:35:28 +0000 (13:35 -0700)]
[flang][NFC] Address warnings from Windows build
An LLVM Flang build bot for Windows recently failed with a
bunch of warning messages. None were from recent changes to
the Fortran compiler; I suspect that a newer (or maybe older)
version of MSVC was being used, or perhaps a different set of
compiler options were temporarily applied to the build, since
the buildbot status went back to green shortly thereafter.
Most of the warnings looked bogus to me, but some are legitimate
concerns and we might as well clean them up. This patch does so.
Differential Revision: https://reviews.llvm.org/D111677
Vitaly Buka [Tue, 12 Oct 2021 05:18:00 +0000 (22:18 -0700)]
[sanitizer] Remove StackDepotReverseMap
Now StackDepotGet can retrive the stack in O(1).
Depends on D111612.
Reviewed By: dvyukov
Differential Revision: https://reviews.llvm.org/D111613
Vitaly Buka [Tue, 12 Oct 2021 02:44:09 +0000 (19:44 -0700)]
[sanitizer] Remove id and replace link with u32
This lets us reduce size of Node, similar to D111183 proposal.
Depends on D111610.
Reviewed By: dvyukov
Differential Revision: https://reviews.llvm.org/D111612
thomasraoux [Tue, 12 Oct 2021 22:42:02 +0000 (15:42 -0700)]
[mlir][linalg] Fix generic reduction vectorization
We shouldn't broadcast the original value when doing reduction. Instead
we compute the reduction and then combine it with the original value.
Differential Revision: https://reviews.llvm.org/D111666
Arthur Eubanks [Tue, 12 Oct 2021 21:18:31 +0000 (14:18 -0700)]
[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
Vitaly Buka [Tue, 12 Oct 2021 22:33:21 +0000 (15:33 -0700)]
[sanitizer] Fix test on Windows
Vitaly Buka [Tue, 12 Oct 2021 01:37:25 +0000 (18:37 -0700)]
[NFC][sanitizer] Add a few consts
Depends on D111609.
Reviewed By: dvyukov
Differential Revision: https://reviews.llvm.org/D111610
Lang Hames [Tue, 12 Oct 2021 21:55:49 +0000 (14:55 -0700)]
[ORC] Call ExecutorProcessControl::disconnect in unit tests that require it.
Another follow-up to
2815ed57e3c and
19b4e3cfc6a. 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
Artem Belevich [Tue, 12 Oct 2021 18:18:30 +0000 (11:18 -0700)]
[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
Lang Hames [Tue, 12 Oct 2021 21:27:39 +0000 (14:27 -0700)]
[ORC] Call ExecutionSession::endSession in unit tests.
2815ed57e3c 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
Arthur Eubanks [Mon, 11 Oct 2021 20:29:58 +0000 (13:29 -0700)]
[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
Vitaly Buka [Tue, 12 Oct 2021 01:33:48 +0000 (18:33 -0700)]
[NFC][sanitizer] Clang-format a line
Depends on D111608.
Reviewed By: dvyukov
Differential Revision: https://reviews.llvm.org/D111609
Vitaly Buka [Tue, 12 Oct 2021 21:09:49 +0000 (14:09 -0700)]
[sanitizer] Re-enable test on Windows
It's likely missdiagnosed issue fixed with
336e88636a99c18a4747cb06ad1bc9b590901482
Diego Caballero [Tue, 12 Oct 2021 20:46:08 +0000 (20:46 +0000)]
[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
Diego Caballero [Tue, 12 Oct 2021 20:58:06 +0000 (20:58 +0000)]
[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
Nico Weber [Tue, 12 Oct 2021 21:03:22 +0000 (17:03 -0400)]
[lld] fix typos to cycle bots
Jean Perier [Tue, 12 Oct 2021 21:00:23 +0000 (23:00 +0200)]
[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
Vitaly Buka [Tue, 12 Oct 2021 18:41:45 +0000 (11:41 -0700)]
[NFC][sanitizer] Move consts into on top of the class
Vitaly Buka [Mon, 11 Oct 2021 08:35:43 +0000 (01:35 -0700)]
[sanitizer] Switch StackDepot to TwoLevelMap
Depends on D111607.
Reviewed By: dvyukov
Differential Revision: https://reviews.llvm.org/D111608
Philip Reames [Tue, 12 Oct 2021 20:45:11 +0000 (13:45 -0700)]
[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
Vitaly Buka [Sun, 10 Oct 2021 06:27:39 +0000 (23:27 -0700)]
[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
Albion Fung [Tue, 12 Oct 2021 20:47:44 +0000 (15:47 -0500)]
[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
Lang Hames [Tue, 12 Oct 2021 20:24:54 +0000 (13:24 -0700)]
[ORC] Shut down dispatcher in ExecutorProcessControl implementations.
f3411616896 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
Vitaly Buka [Mon, 11 Oct 2021 03:15:45 +0000 (20:15 -0700)]
[NFC][sanitizer] Refactor Maps into templates
Depends on D111599.
Reviewed By: dvyukov
Differential Revision: https://reviews.llvm.org/D111605
Philip Reames [Tue, 12 Oct 2021 20:37:04 +0000 (13:37 -0700)]
Add extra tests for D111675
Vitaly Buka [Tue, 12 Oct 2021 20:17:55 +0000 (13:17 -0700)]
[sanitizer] Fix test on Windows
UL suffix on MSVC is 32bit.
Vitaly Buka [Tue, 12 Oct 2021 19:48:12 +0000 (12:48 -0700)]
[sanitizer] Fix typo in test
Roland Froese [Tue, 12 Oct 2021 20:11:34 +0000 (20:11 +0000)]
[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
Rob Suderman [Tue, 12 Oct 2021 20:02:29 +0000 (13:02 -0700)]
[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
David Blaikie [Tue, 12 Oct 2021 19:26:24 +0000 (12:26 -0700)]
DebugInfo: Add test coverage for non-zero addrx in DW_FORM_LLVM_addrx_offset
Noticed in code review
https://github.com/llvm/llvm-project/commit/
4318028cd2d7633a0cdeb0b5d4d2ed81fab87864#commitcomment-
57738034
But the issue had already been fixed in
943b3048484b7e3cf04f4d51c23c82fcece2185d 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.
David Blaikie [Mon, 11 Oct 2021 19:59:26 +0000 (12:59 -0700)]
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)
peter klausler [Tue, 12 Oct 2021 18:50:26 +0000 (11:50 -0700)]
[flang] Fix build on FreeBSD (need size_t)
Add #include <cstddef> to time-intrinsic.h so std::size_t is
guaranteed to be available.
Jacques Pienaar [Tue, 12 Oct 2021 19:45:57 +0000 (12:45 -0700)]
[mlir][python] Add nameloc getter
Expose the nameloc getter to Python API.
Differential Revision: https://reviews.llvm.org/D111663
Philip Reames [Tue, 12 Oct 2021 19:01:36 +0000 (12:01 -0700)]
[tests] Add coverage for cases we can drop flags to propagate freeze without cost
Ayal Zaks [Sun, 29 Aug 2021 22:24:21 +0000 (01:24 +0300)]
[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
Amara Emerson [Mon, 11 Oct 2021 06:38:34 +0000 (23:38 -0700)]
[GlobalISel] Add support for constant vector folding of binops in CSEMIRBuilder.
Differential Revision: https://reviews.llvm.org/D111524
Arthur Eubanks [Mon, 11 Oct 2021 21:45:34 +0000 (14:45 -0700)]
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
Michael Jones [Mon, 11 Oct 2021 22:11:39 +0000 (22:11 +0000)]
[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
Tobias Gysi [Tue, 12 Oct 2021 17:43:47 +0000 (17:43 +0000)]
[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
Vitaly Buka [Tue, 12 Oct 2021 04:29:06 +0000 (21:29 -0700)]
[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
William Woodruff [Tue, 12 Oct 2021 17:47:10 +0000 (23:17 +0530)]
[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>.
Kevin P. Neal [Tue, 12 Oct 2021 17:42:58 +0000 (13:42 -0400)]
[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.
Mircea Trofin [Mon, 11 Oct 2021 23:43:28 +0000 (16:43 -0700)]
[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
Artem Dergachev [Tue, 12 Oct 2021 17:19:35 +0000 (10:19 -0700)]
[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
LLVM GN Syncbot [Tue, 12 Oct 2021 17:32:05 +0000 (17:32 +0000)]
[gn build] Port
9cf995be6bb7
LLVM GN Syncbot [Tue, 12 Oct 2021 17:32:04 +0000 (17:32 +0000)]
[gn build] Port
838b4a533e68
Nico Weber [Tue, 12 Oct 2021 17:31:50 +0000 (13:31 -0400)]
[gn build] (manually) port
67f94e5a9745
Nico Weber [Mon, 11 Oct 2021 18:26:09 +0000 (14:26 -0400)]
[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
Roman Lebedev [Tue, 12 Oct 2021 17:24:17 +0000 (20:24 +0300)]
[X86] `detectAVGPattern()`: don't require zext in the with-constant case
Roman Lebedev [Tue, 12 Oct 2021 17:19:18 +0000 (20:19 +0300)]
[NFC][X86] Add another test case for PR52131
Lang Hames [Tue, 12 Oct 2021 16:48:29 +0000 (09:48 -0700)]
[Support][ORC] Add an explicit release operation to OwningMemoryBlock.
This gives OwningMemoryBlock clients a way to check for errors on release.
rdar://
84127175
Roman Lebedev [Tue, 12 Oct 2021 17:11:45 +0000 (20:11 +0300)]
[NFC][X86] `detectAVGPattern()`: rely on `AVGSplitter()` to perform truncation
Benjamin Kramer [Tue, 12 Oct 2021 16:01:54 +0000 (18:01 +0200)]
[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
Stanislav Mekhanoshin [Fri, 8 Oct 2021 20:04:32 +0000 (13:04 -0700)]
[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
Sanjay Patel [Tue, 12 Oct 2021 16:18:29 +0000 (12:18 -0400)]
[InstCombine] propagate no-wrap flag through select-of-mul fold
This may not be obvious, but Alive2 agrees:
https://alive2.llvm.org/ce/z/Ld9qNT
If the mul has "nsw", then -1 * INT_MIN is poison, so the
negate can also have "nsw" because 0 - INT_MIN is poison.
If the mul has "nuw", then that means the "OtherOp" can only
be 0 or 1 (anything else multiplied by 0xfff... would wrap).
So the replacement negate must be "nsw" because it is either
"0-0" or "0-1".
This is another regression noticed with a planned follow-up
to D111410.
Sanjay Patel [Tue, 12 Oct 2021 15:47:03 +0000 (11:47 -0400)]
[InstCombine] add tests with nsw/nuw for mul-of-select; NFC
Roman Lebedev [Tue, 12 Oct 2021 16:43:51 +0000 (19:43 +0300)]
[X86] `detectAVGPattern()`: support basic case of PAVG chaining (PR52131)
As noted in https://github.com/halide/Halide/pull/6302,
we hilariously fail to match PAVG if we even as much
as look at it the wrong way.
In this particular case, the problem stems from the fact that
`PAVG` root (def) is a `trunc`, and leafs (uses) are `zext`'s,
and InstCombine really loves to get rid of both of these,
for example replace them with a bit mask. So we may not have
said `zext`.
Instead of checking for that + type match,
i think we should rely on the actual active type,
as per the knownbits.
Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/D111571
Roman Lebedev [Tue, 12 Oct 2021 16:42:24 +0000 (19:42 +0300)]
[X86] `detectAVGPattern()`: small preparatory NFC refactor
Nimish Mishra [Tue, 12 Oct 2021 16:44:21 +0000 (22:14 +0530)]
Added OpenMP 5.0 specification based semantic checks for CRITICAL construct name resolution
As reported in https://bugs.llvm.org/show_bug.cgi?id=48145, name resolution for omp critical construct was failing. This patch adds functionality to help that name resolution as well as implementation to catch name mismatches.
The following semantic restrictions are therefore handled here:
- If a name is specified on a critical directive, the same name must also be specified on the end critical directive
- If no name appears on the critical directive, no name can appear on the end critical directive
- If a name appears on either the start critical directive or the end critical directive
Reviewed By: kiranchandramohan
Differential Revision: https://reviews.llvm.org/D110502
Hongtao Yu [Thu, 30 Sep 2021 16:13:41 +0000 (09:13 -0700)]
[CSSPGO] Unblock optimizations with pseudo probe instrumentation part 3.
This patch continues unblocking optimizations that are blocked by pseudo probe instrumentation.
Not exactly like DbgIntrinsics, PseudoProbe intrinsic has other attributes (such as mayread, maywrite, mayhaveSideEffect) that can block optimizations. The issues fixed are:
- Flipped default param of getFirstNonPHIOrDbg API to skip pseudo probes
- Unblocked CSE by avoiding pseudo probe from clobbering memory SSA
- Unblocked induction variable simpliciation
- Allow empty loop deletion by treating probe intrinsic isDroppable
- Some refactoring.
Reviewed By: wenlei
Differential Revision: https://reviews.llvm.org/D110847
peter klausler [Wed, 6 Oct 2021 21:03:48 +0000 (14:03 -0700)]
[flang] More work on SYSTEM_CLOCK runtime API and implementation
To get proper wrap-around behavior for the various kind parameter
values of the optional COUNT= and COUNT_MAX= dummy arguments to
the intrinsic subroutine SYSTEM_CLOCK, add an extra argument to
the APIs for lowering to pass the integer kind of the actual argument.
Avoid confusion by requiring that both actual arguments have the same
kind when both are present. The results of the runtime functions
remain std::int64_t and lowering should still convert them before
storing to the actual argument variables.
Rework the implementation a bit to accomodate the dynamic
specification of the kind parameter, and to clean up some coding
issues with preprocessing and templates.
Use the kind of the COUNT=/COUNT_MAX= actual arguments to determine
the clock's resolution, where possible, in conformance with other
Fortran implementations.
Differential Revision: https://reviews.llvm.org/D111281
Kazu Hirata [Tue, 12 Oct 2021 16:19:48 +0000 (09:19 -0700)]
[AST, CodeGen, Driver] Use llvm::is_contained (NFC)
Craig Topper [Tue, 12 Oct 2021 15:46:08 +0000 (08:46 -0700)]
[TableGen] Fix both sides of '&&' are same
The operand of the second any_of in EnforceSmallerThan should be
B not S like the FP code in the if below.
Unfortunately, fixing that causes an infinite loop in the build
of RISCV. So I've added a workaround for that as well.
Fixes PR44768.
Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/D111502
Saiyedul Islam [Sat, 9 Oct 2021 12:06:11 +0000 (12:06 +0000)]
[Clang][clang-nvlink-wrapper] Pass nvlink path to the wrapper
Added support of a "--nvlink-path" option in clang-nvlink-wrapper which
takes the path of nvlink binary.
Static Device Library support for OpenMP (D105191) now searches for
nvlink binary and passes its location via this option. In absence
of this option, nvlink binary is searched in locations in PATH.
Differential Revision: https://reviews.llvm.org/D111488
Mark de Wever [Sun, 10 Oct 2021 13:18:46 +0000 (15:18 +0200)]
[libc++] Use addressof to fix debug tests.
Fixes the tests added in D110852 for the debug iterators.
Similar issues with hijacking `operator&` still exist, they will be
addressed separately.
Reviewed By: #libc, ldionne, Quuxplusone
Differential Revision: https://reviews.llvm.org/D111564
Jeremy Morse [Tue, 12 Oct 2021 16:05:51 +0000 (17:05 +0100)]
Scatter NDEBUG to fix after
838b4a533e6
These "dump" methods call into MachineOperand::dump, which doesn't exist
with NDEBUG, thus we croak. Disable LiveDebugValues dump methods when
NDEBUG is turned on to avoid this.
David Tenty [Tue, 12 Oct 2021 15:53:12 +0000 (11:53 -0400)]
[libcxx][AIX] Explicitly include localedef.h in locale.cpp
This header was transitively included to provide the definition of
__lc_ctype_ptr that we use on AIX, but that is fragile as it depends on
the settings of compatibility macros, so we explicitly include it here
to avoid that scenario.
Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/D111239
Aart Bik [Tue, 12 Oct 2021 00:11:13 +0000 (17:11 -0700)]
[mlir][sparse] add action enum, group enums together, few asserts
Some random changes that were hanging around in my workspace. Also,
a tiny step towards creating a header file for the sparse utils lib.
Reviewed By: bixia
Differential Revision: https://reviews.llvm.org/D111589
Lei Zhang [Tue, 12 Oct 2021 15:39:56 +0000 (11:39 -0400)]
[mlir][vector] Add folder for no-op InsertStridedSliceOp
Reviewed By: nicolasvasilache
Differential Revision: https://reviews.llvm.org/D111636
Mike Urbach [Mon, 11 Oct 2021 23:23:42 +0000 (16:23 -0700)]
[mlir] Limit Python dependency to Development.Module when possible.
After CMake 3.18, we are able to limit the scope of the search to just
Development.Module. Searching for Development will fail in situations
where the Python libraries are not available. When possible, limit to
just Development.Module. See:
https://pybind11.readthedocs.io/en/stable/compiling.html#findpython-mode
Reviewed By: stellaraccident
Differential Revision: https://reviews.llvm.org/D111585
Mark de Wever [Sun, 6 Jun 2021 12:48:08 +0000 (14:48 +0200)]
[libc++] Update atomic synopsis and tests.
While looking at LWG-2988 and P0558 it seems the issues were already
implemented, but the synopsis wasn't updated. Some of the tests didn't
validate the `noexcept` status. A few tests were missing completely:
- `atomic_wait_explicit`
- `atomic_notify_one`
- `atomic_notify_all`
Mark P0558 as complete, didn't investigate which version of libc++ first
includes this. It seems the paper has been retroactively applied. I
couldn't find whether this is correct, but looking at cppreference it
seems intended.
Completes
- LWG-2988 Clause 32 cleanup missed one typename
- P0558 Resolving atomic<T> named base class inconsistencies
Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/D103765
Martin Storsjö [Fri, 27 Aug 2021 10:09:19 +0000 (10:09 +0000)]
[libcxx] [test] Make windows triples in XFAILs less specific
This allows picking up on mingw triples that often use 'w64' instead
of 'pc' as the vendor part.
Differential Revision: https://reviews.llvm.org/D111297
Jay Foad [Tue, 12 Oct 2021 15:19:35 +0000 (16:19 +0100)]
Revert "[AMDGPU] Enable load clustering in the post-RA scheduler"
This reverts commit
66e13c7f439cf162d7ed1d25883e71a5755ac7ec.
It was committed by accident.
Jay Foad [Tue, 12 Oct 2021 08:15:07 +0000 (09:15 +0100)]
[TwoAddressInstruction] Remove ad hoc machine verification
With the -early-live-intervals command line flag,
TwoAddressInstructionPass::runOnMachineFunction would call
MachineFunction::verify before returning to check the live intervals.
But there was not much benefit to doing this since -verify-machineinstrs
and LLVM_ENABLE_EXPENSIVE_CHECKS provide a more general way of
scheduling machine verification after every pass.
Also it caused problems on targets like Lanai which are marked as "not
machine verifier clean", since verification would fail for known
target-specific problems which are nothing to do with LiveIntervals.
Differential Revision: https://reviews.llvm.org/D111618
Jay Foad [Tue, 12 Oct 2021 14:39:43 +0000 (15:39 +0100)]
[AMDGPU] Enable load clustering in the post-RA scheduler
This has a couple of benefits:
1. It can sometimes fix clusters that got broken apart when the register
allocator inserted a copy.
2. Post-RA scheduling does not have to worry about increasing register
pressure, which in some cases gives it more freedom to reorder
instructions.
Testing on a collection of 10,000 graphics shaders compiled for gfx1010
showed:
- The average length of each run of one or more load instructions
increased by about 1%.
- The number of runs of two or more load instructions increased by
about 4%.
Jeremy Morse [Tue, 12 Oct 2021 14:55:46 +0000 (15:55 +0100)]
[DebugInfo][NFC] Move LiveDebugValues class to header
This patch shifts the InstrRefBasedLDV class declaration to a header.
Partially because it's already massive, but mostly so that I can start
writing some unit tests for it. This patch also adds the boilerplate for
said unit tests.
Differential Revision: https://reviews.llvm.org/D110165