Florian Hahn [Mon, 14 Dec 2020 14:13:59 +0000 (14:13 +0000)]
[VPlan] Make VPWidenMemoryInstructionRecipe a VPDef.
This patch updates VPWidenMemoryInstructionRecipe to use VPDef
to manage the value it produces instead of inheriting from VPValue.
Reviewed By: gilr
Differential Revision: https://reviews.llvm.org/D90563
David Spickett [Mon, 30 Nov 2020 11:32:46 +0000 (11:32 +0000)]
[llvm-objdump] Use "--" for long options in --help text
Single dash for these options is not recognised.
Changes found by running this on the --help output
and the user guide:
grep -e ' -[a-zA-Z]\{2,\}'
The user guide was updated in https://reviews.llvm.org/D92305
so no change there.
Reviewed By: jhenderson, MaskRay
Differential Revision: https://reviews.llvm.org/D92310
Raphael Isemann [Mon, 14 Dec 2020 13:03:38 +0000 (14:03 +0100)]
Revert "Consider reference, pointer, and pointer-to-member TemplateArguments to be different if they have different types."
This reverts commit
05cdf4acf42acce9ddcff646a5d6ac666710fe6d. It breaks stage-2
compilation of LLVM, see https://reviews.llvm.org/D91488#2451534
Anton Afanasyev [Sun, 13 Dec 2020 11:42:25 +0000 (14:42 +0300)]
[SLP] Fix vector element size for the store chains
Vector element size could be different for different store chains.
This patch prevents wrong computation of maximum number of elements
for that case.
Differential Revision: https://reviews.llvm.org/D93192
Simon Pilgrim [Mon, 14 Dec 2020 12:12:08 +0000 (12:12 +0000)]
[TableGen] Don't dereference from dyn_cast<> - use cast<> instead. NFCI.
dyn_cast<> can return null if the cast fails, resulting in null dereferences and static analyzer warnings. We should use cast<> instead.
Simon Pilgrim [Mon, 14 Dec 2020 11:39:43 +0000 (11:39 +0000)]
[IRCE] Add test case for PR48051
Kerry McLaughlin [Mon, 14 Dec 2020 10:46:32 +0000 (10:46 +0000)]
[SVE][CodeGen] Lower scalable floating-point vector reductions
Changes in this patch:
- Minor changes to the LowerVECREDUCE_SEQ_FADD function added by @cameron.mcinally
to also work for scalable types
- Added TableGen patterns for FP reductions with unpacked types (nxv2f16, nxv4f16 & nxv2f32)
- Asserts added to expandFMINNUM_FMAXNUM & expandVecReduceSeq for scalable types
Reviewed By: cameron.mcinally
Differential Revision: https://reviews.llvm.org/D93050
David Green [Mon, 14 Dec 2020 11:17:01 +0000 (11:17 +0000)]
[ARM] Improve handling of empty VPT blocks in tail predicated loops
A vpt block that just contains either VPST;VCTP or VPT;VCTP, once the
VCTP is removed will become invalid. This fixed the first by removing
the now empty block and bails out for the second, as we have no simple
way of converting a VPT to a VCMP.
Differential Revision: https://reviews.llvm.org/D92369
Carl Ritson [Mon, 14 Dec 2020 11:01:49 +0000 (20:01 +0900)]
[AMDGPU][NFC] Rename opsel/opsel_hi/neg_lo/neg_hi with suffix 0
These parameters set a default value of 0, so I believe they
should include a 0 suffix. This allows for versions which do not
set a default value in future.
Reviewed By: foad
Differential Revision: https://reviews.llvm.org/D93187
Carl Ritson [Mon, 14 Dec 2020 11:00:53 +0000 (20:00 +0900)]
[AMDGPU][NFC] Remove unused VOP3Mods0Clamp
This is unused and the selection function does not exist.
Reviewed By: foad
Differential Revision: https://reviews.llvm.org/D93188
Raul Tambre [Mon, 14 Dec 2020 09:07:31 +0000 (11:07 +0200)]
[XRay] Remove unnecessary <x86intrin.h> include
It hasn't been necessary since commit
4d4ed0e288bf1f3a90fba6e5b56bc25e2fe961c3 (D43278).
Reviewed By: dberris
Differential Revision: https://reviews.llvm.org/D93196
Frederik Gossen [Fri, 11 Dec 2020 16:54:53 +0000 (17:54 +0100)]
[MLIR] Add atan and atan2 lowerings to CUDA intrinsics
Differential Revision: https://reviews.llvm.org/D93124
Sebastian Neubauer [Wed, 9 Dec 2020 16:25:53 +0000 (17:25 +0100)]
[AMDGPU] Mark amdgpu_gfx functions as module entry function
- Allows lds allocations
- Writes resource usage into COMPUTE_PGM_RSRC1 registers in PAL metadata
Differential Revision: https://reviews.llvm.org/D92946
Frederik Gossen [Fri, 11 Dec 2020 17:00:17 +0000 (18:00 +0100)]
[MLIR] Add lowerings for atan and atan2 to ROCDL intrinsics
Differential Revision: https://reviews.llvm.org/D93123
Raul Tambre [Mon, 14 Dec 2020 09:40:24 +0000 (11:40 +0200)]
Revert "[CMake][compiler-rt][AArch64] Avoid preprocessing LSE builtins separately"
Causing issues on Apple buildbots.
http://green.lab.llvm.org/green/job/clang-stage1-RA/17019/console
This reverts commit
33b740f8dc3496237619a7bc6722f23655cb1f94.
This reverts commit
d9697c2e6b153ac7dc40a69450d9b672f71b1029.
Differential Revision: https://reviews.llvm.org/D93199
Raul Tambre [Mon, 14 Dec 2020 09:24:02 +0000 (11:24 +0200)]
[compiler-rt][CMake] Define HAS_ASM_LSE on Apple if available
Should hopefully fix
33b740f8dc3496237619a7bc6722f23655cb1f94 (D93178) failing on bots.
Differential Revision: https://reviews.llvm.org/D93198
Jan Svoboda [Mon, 14 Dec 2020 09:03:18 +0000 (10:03 +0100)]
[clang][cli] Port FileSystem options to new option parsing system
Depends on D84187
Reviewed By: dexonsmith
Original patch by Daniel Grumberg.
Differential Revision: https://reviews.llvm.org/D84188
Georgii Rymar [Thu, 10 Dec 2020 13:12:26 +0000 (16:12 +0300)]
[llvm-readobj] - For SHT_REL relocations, don't display an addend.
This is https://bugs.llvm.org/show_bug.cgi?id=44257.
In LLVM style we always print `0` as addend when dumping
SHT_REL relocations. It is confusing, this patch stops
printing it as the first comment on the bug page suggests.
Differential revision: https://reviews.llvm.org/D93033
Jan Svoboda [Mon, 14 Dec 2020 08:49:55 +0000 (09:49 +0100)]
[clang][cli] Better defaults for MarshallingInfoString
Depends on D84018
Reviewed By: Bigcheese
Original patch by Daniel Grumberg.
Differential Revision: https://reviews.llvm.org/D84185
Georgii Rymar [Fri, 11 Dec 2020 09:46:30 +0000 (12:46 +0300)]
[llvm-readelf] - Improve ELF type field dumping.
This is related to https://bugs.llvm.org/show_bug.cgi?id=40868.
Currently we don't print `OS Specific`/``Processor Specific`/`<unknown>`
prefixes when dumping the ELF file type. This is not consistent
with GNU readelf. The patch fixes it.
Also, this patch removes the `types.test`, because we already have
`file-types.test`, which tests more cases and this patch revealed that
we have such a duplicate.
Differential revision: https://reviews.llvm.org/D93096
Jan Svoboda [Fri, 11 Dec 2020 15:19:03 +0000 (16:19 +0100)]
[clang][cli] Port Preprocessor and PreprocessorOutput option flags to new option parsing system
Depends on D83979
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D84018
sameeran joshi [Mon, 14 Dec 2020 08:00:26 +0000 (13:30 +0530)]
[Flang][OpenMP-5.0] Semantic checks for flush construct.
From OMP 5.0 [2.17.8]
Restriction:
If memory-order-clause is release,acquire, or acq_rel, list items must not be specified on the flush directive.
Reviewed By: kiranchandramohan, clementval
Differential Revision: https://reviews.llvm.org/D89879
Haojian Wu [Mon, 14 Dec 2020 07:55:47 +0000 (08:55 +0100)]
[clangd] Go-to-definition on pure virtual method decls jumps to all overrides.
Reviewed By: usaxena95
Differential Revision: https://reviews.llvm.org/D92299
QingShan Zhang [Mon, 14 Dec 2020 07:39:06 +0000 (07:39 +0000)]
[PowerPC][FP128] Fix the incorrect signature for math library call
The runtime library has two family library implementation for ppc_fp128 and fp128.
For IBM Long double(ppc_fp128), it is suffixed with 'l', i.e(sqrtl). For
IEEE Long double(fp128), it is suffixed with "ieee128" or "f128".
We miss to map several libcall for IEEE Long double.
Reviewed By: qiucf
Differential Revision: https://reviews.llvm.org/D91675
Haojian Wu [Mon, 14 Dec 2020 07:45:13 +0000 (08:45 +0100)]
[AST][RecoveryExpr] Preserve type for broken overrload member call expr.
Reviewed By: sammccall
Differential Revision: https://reviews.llvm.org/D80109
sameeran joshi [Mon, 14 Dec 2020 07:11:39 +0000 (12:41 +0530)]
[Flang][OpenMP] Semantic checks for Atomic construct.
Patch implements restrictions from 2.17.7 of OpenMP 5.0 standard for atomic Construct. Tests for the same are added.
One of the restriction
`OpenMP constructs may not be encountered during execution of an atomic region.`
Is mentioned in 5.0 standard to be a semantic restriction, but given the stricter nature of parser in F18 it's caught at parsing itself.
This patch is a next patch in series from D88965.
Reviewed By: clementval
Differential Revision: https://reviews.llvm.org/D89583
Craig Topper [Mon, 14 Dec 2020 04:26:00 +0000 (20:26 -0800)]
[LoopIdiom] Pre-commit tests for D92745. NFC
Raul Tambre [Sun, 13 Dec 2020 14:48:26 +0000 (16:48 +0200)]
[CMake][compiler-rt][AArch64] Avoid preprocessing LSE builtins separately
Invoking the preprocessor ourselves is fragile and would require us to replicate CMake's handling of definitions, compiler flags, etc for proper compatibility.
In my toolchain builds this notably resulted in a bunch of warnings from unused flags as my CMAKE_C_FLAGS includes CPU-specific optimization options.
Notably this part was already duplicating the logic for VISIBILITY_HIDDEN define.
Instead, symlink the files and set the proper set of defines on each.
This should also be faster as we avoid invoking the compiler multiple times.
Fixes https://llvm.org/PR48494
Reviewed By: ilinpv
Differential Revision: https://reviews.llvm.org/D93178
Richard Smith [Mon, 14 Dec 2020 06:41:19 +0000 (22:41 -0800)]
Fix test expectation to cope with custom version namespaces.
Richard Smith [Sun, 15 Nov 2020 01:37:25 +0000 (17:37 -0800)]
Consider reference, pointer, and pointer-to-member TemplateArguments to be different if they have different types.
For the Itanium ABI, this implements the mangling rule suggested in
https://github.com/itanium-cxx-abi/cxx-abi/issues/47, namely mangling
such template arguments as being cast to the parameter type in the case
where the template name is overloadable. This can cause a mangling
change for rare cases, where
* the template argument declaration is converted from its declared type
to the type of the template parameter, and
* the template parameter either has a deduced type or is a parameter of
a function template.
However, such changes are necessary to avoid mangling collisions. The
ABI changes can be reversed with -fclang-abi-compat=11 or earlier.
Re-commit with a fix for the regression introduced last time: don't
expect parameters and arguments to line up inside an <unresolved-name>
mangling.
Differential Revision: https://reviews.llvm.org/D91488
Richard Smith [Sun, 13 Dec 2020 08:50:01 +0000 (00:50 -0800)]
Factor out and centralize repeated 'getExpandedPackSize'.
Anton Afanasyev [Sun, 13 Dec 2020 11:00:08 +0000 (14:00 +0300)]
[SLP][Test] Precommit test for D93192
This test shows failure of combined stores chains vectorization
Chen Zheng [Wed, 25 Nov 2020 02:33:13 +0000 (21:33 -0500)]
[MachineCombiner][NFC] Add MustReduceRegisterPressure goal
add a new goal MustReduceRegisterPressure for machine combiner pass.
PowerPC will use this new goal to do some register pressure related optimization.
Reviewed By: spatel
Differential Revision: https://reviews.llvm.org/D92068
Kazu Hirata [Mon, 14 Dec 2020 04:05:47 +0000 (20:05 -0800)]
[CodeGen] Use llvm::erase_value (NFC)
Kazu Hirata [Mon, 14 Dec 2020 03:35:10 +0000 (19:35 -0800)]
[Target] Use llvm::is_contained (NFC)
Arthur Eubanks [Mon, 14 Dec 2020 03:13:48 +0000 (19:13 -0800)]
[opt][NPM] Pin -lower-amx-type to legacy PM
This is part of the codegen pipeline.
Lang Hames [Mon, 14 Dec 2020 02:38:00 +0000 (13:38 +1100)]
Re-apply
8904ee8ac7e with missing header included this time.
Nico Weber [Mon, 14 Dec 2020 02:30:38 +0000 (21:30 -0500)]
Revert "[JITLink] Add JITLinkDylib type, thread through JITLinkMemoryManager APIs."
This reverts commit
8904ee8ac7ebcc50a60de0914abc6862e28b6664.
Didn't `git add` llvm/ExecutionEngine/JITLink/JITLinkDylib.h and hence doesn't
build anywhere.
Lang Hames [Mon, 14 Dec 2020 00:14:25 +0000 (11:14 +1100)]
[JITLink] Add JITLinkDylib type, thread through JITLinkMemoryManager APIs.
JITLinkDylib represents a target dylib for a JITLink link. By representing this
explicitly we can:
- Enable JITLinkMemoryManagers to manage allocations on a per-dylib basis
(e.g by maintaining a seperate allocation pool for each JITLinkDylib).
- Enable new features and diagnostics that require information about the
target dylib (not implemented in this patch).
Lang Hames [Sun, 13 Dec 2020 23:41:07 +0000 (10:41 +1100)]
[JITLink] Fix include guard end comment.
Lang Hames [Sun, 13 Dec 2020 08:53:18 +0000 (19:53 +1100)]
[ORC] Prefer preincrement on iterator.
Nathan Ridge [Sun, 8 Nov 2020 07:58:17 +0000 (02:58 -0500)]
[clangd] Fix locateMacroAt() for macro definition outside preamble
Fixes https://github.com/clangd/clangd/issues/577
Differential Revision: https://reviews.llvm.org/D91025
Tony [Sun, 13 Dec 2020 00:38:40 +0000 (00:38 +0000)]
[NFC][AMDGPU] Reformat AMD GPU targets in cuda.cpp
Differential Revision: https://reviews.llvm.org/D93181
Craig Topper [Sun, 13 Dec 2020 20:35:24 +0000 (12:35 -0800)]
[X86] Add ExeDomain = SSEPackedSingle to cvtss2sd and cvtsd2ss instrutions.
Prep for D92993
Craig Topper [Sun, 13 Dec 2020 19:44:38 +0000 (11:44 -0800)]
[X86] Add isel patterns to form VPDPWSSD from (add (vpmaddwd X, Y), Z) when AVXVNNI is enabled.
We already have these patterns for AVX512VNNI.
Nikita Popov [Sun, 13 Dec 2020 19:56:20 +0000 (20:56 +0100)]
[AC] Handle (X+C1)<C2 assumes (PR48408)
InstCombine canonicalizes X>C && X<C' style comparisons into
(X+C1)<C2. This type of expression is recognized by some analyses
like LVI, but currently not when used inside assumptions, because
AssumptionCache does not track affected values for it.
Harald van Dijk [Sun, 13 Dec 2020 18:33:10 +0000 (18:33 +0000)]
[X86] Extend varargs test
This extends the existing x86-64-varargs test by passing enough
arguments that they need to be passed in memory, and by passing them in
reverse order, using va_arg for each argument to retrieve them and
restoring them to the correct order, and by using va_copy to have two
va_lists to use with va_arg.
Kazu Hirata [Sun, 13 Dec 2020 18:03:45 +0000 (10:03 -0800)]
[Analysis] Remove unused declaration replaceEdgeKey (NFC)
The declaration was introduced without a corresponding definition on
Feb 9, 2017 in commit
aaad9f84be2a6a3eb8202ed4eaa5e5e2021d055e.
Kazu Hirata [Sun, 13 Dec 2020 17:48:47 +0000 (09:48 -0800)]
[Transforms] Use llvm::erase_value (NFC)
Tony [Sun, 13 Dec 2020 01:06:18 +0000 (01:06 +0000)]
[NFC]{AMDGPU] Update AMDGPUUsage with AMD RDNA 2 reference
Differential Revision: https://reviews.llvm.org/D93172
Simon Pilgrim [Sun, 13 Dec 2020 17:18:07 +0000 (17:18 +0000)]
[X86][SSE] combineX86ShufflesRecursively - add basic handling for combining shuffles of different widths (PR45974)
If a faux shuffle uses smaller shuffle inputs, try to recursively combine with those inputs directly instead of widening them immediately. Then widen all smaller inputs at the bottom of the recursion.
This will still mean we're generating nodes on the fly (PR45974) even if we don't combine to a new shuffle but it does help AVX2+ targets combine across xmm/ymm/zmm types, mainly as variable shuffles.
Simon Pilgrim [Sun, 13 Dec 2020 16:43:17 +0000 (16:43 +0000)]
[X86][AVX] Add additional X86ISD::SUBV_BROADCAST_LOAD test case for D92645
Suggested by @yubing - to check whether we can reuse a single subvector broadcast for 128/256/512-bit vectors.
Florian Hahn [Sun, 13 Dec 2020 16:28:22 +0000 (16:28 +0000)]
[VPlan] Use interleaveComma in printOperands() (NFC).
Florian Hahn [Sun, 13 Dec 2020 15:46:13 +0000 (15:46 +0000)]
Recommit "[AArch64] Lower calls with rv_marker attribute."
This recommits
a87fccb3ff9c with a fix to mark the destination operand
of the marker instruction as def, to fix a machine verifier failure.
This reverts the revert commit
c0f2cea7c0afc7c9688e1633f2a9b25c8ea4a9bd.
Simon Pilgrim [Sun, 13 Dec 2020 15:37:35 +0000 (15:37 +0000)]
[X86] Convert fadd/fmul _mm_reduce_* intrinsics to emit llvm.reduction intrinsics (PR47506)
Followup to D87604, having confirmed on PR47506 that we can use the llvm codegen expansion for fadd/fmul as well.
Differential Revision: https://reviews.llvm.org/D92940
Simon Pilgrim [Sun, 13 Dec 2020 15:16:21 +0000 (15:16 +0000)]
[X86][SSE] combineReductionToHorizontal - add vXi8 ISD::MUL reduction handling (PR39709)
Default expansion leads to repeated extensions/truncations to/from vXi16 which shuffle combining and demanded elts can't completely unravel.
Better just to promote (any_extend) the input and perform a vXi16 reduction.
We'll be able to remove a lot of this if we ever get decent legalization support for reduction intrinsics in SelectionDAG.
Jacques Pienaar [Sun, 13 Dec 2020 15:21:32 +0000 (07:21 -0800)]
Don't emit on op diagnostic in reproducer emission
This avoids dumping the module post emitting a reproducer, which results in
many MB logs where a reproducer has already been neatly generated.
Differential Revision: https://reviews.llvm.org/D93165
ergawy [Sun, 13 Dec 2020 14:56:37 +0000 (09:56 -0500)]
[MLIR][SPIRV] Add support for GLSL F/U/SClamp.
Adds support for 3 ternary ops from SPIR-V extended instructions for
GLSL. Namely, adds support for FClamp, UClamp, and SClamp.
Reviewed By: antiagainst
Differential Revision: https://reviews.llvm.org/D92859
Simon Pilgrim [Wed, 9 Dec 2020 18:18:50 +0000 (18:18 +0000)]
[X86] Regenerate vector-reduce-mul.ll with common check prefixes. NFC.
Try to merge AVX1/AVX2/AVX512 codegen checks where possible
Björn Schäpers [Sat, 28 Nov 2020 04:58:58 +0000 (05:58 +0100)]
[clang-format] Remove double trim
Lines[i] is already trimmed 3 lines before
Differential Revision: https://reviews.llvm.org/D91996
Nikita Popov [Thu, 10 Dec 2020 21:29:33 +0000 (22:29 +0100)]
[BasicAA] Handle known non-zero variable index
BasicAA currently handles cases like Scale*V0 + (-Scale)*V1 where
V0 != V1, but does not handle the simpler case of Scale*V with
V != 0. Add it based on an isKnownNonZero() call.
I'm not passing a context instruction for now, because the existing
approach of always using GEP1 for context could result in symmetry
issues.
Differential Revision: https://reviews.llvm.org/D93162
Kazushi (Jam) Marukawa [Thu, 10 Dec 2020 08:53:07 +0000 (17:53 +0900)]
[VE] Optimize toolchain regression test
Optimize toolchain regression test for VE by removing not a useful test
(-fuse-init-array test) and merge several tests to one test which checks
default behavior of driver. Also add sysroot to reduce conflicts.
These are suggested in https://reviews.llvm.org/D92996.
Thank you so much.
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D93084
Michał Górny [Sun, 13 Dec 2020 08:18:41 +0000 (09:18 +0100)]
[lldb] [Process/FreeBSD] Add more 'override' keywords
Christian Sigg [Sat, 12 Dec 2020 09:50:41 +0000 (10:50 +0100)]
[mlir] Use mlir::OpState::operator->() to get to methods of mlir::Operation.
This is a preparation step to remove those methods from OpState.
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D93098
Chris Lattner [Sun, 13 Dec 2020 05:24:18 +0000 (21:24 -0800)]
[AsmParser] Fix support for zero bit integer types.
Zero bit integer types are supported by IntegerType for consistency,
but the asmparser never got updated. Allow them to be parsed, as
required to fix CIRCT issue #316
Differential Revision: https://reviews.llvm.org/D93089
kweisamx [Sun, 13 Dec 2020 03:06:32 +0000 (03:06 +0000)]
[mlir] Add Python binding for MLIR Dict Attribute
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D93004
Nico Weber [Sun, 13 Dec 2020 02:10:52 +0000 (21:10 -0500)]
[mac/arm] Deflake 3 check-llvm tests
On macOS/arm, signature verification has kill semantics by default.
Signature verification is cached with a file's inode (actually, vnode),
and if a new executable is copied over an existing file (which reuses
the inode), the cache isn't invalidated. So when the new executable
is executed, the kernel still has the old content's signature cached
and the kills the executable because the old signatue doesn't match
the new contents (https://openradar.appspot.com/
FB8914243).
As workaround, rm the desitnation files first, to ensure they have
a fresh vnode (and hence no stale cached signature) after the copy.
Part of PR46647. See also
e0e334a9c1ac for a similar change.
Chris Sears [Sat, 12 Dec 2020 15:23:55 +0000 (10:23 -0500)]
X86: Correcting X86OutgoingValueHandler typo (NFC)
https://reviews.llvm.org/D92631
Nico Weber [Sun, 13 Dec 2020 01:19:33 +0000 (20:19 -0500)]
fix typos to cycle bots
Nico Weber [Sun, 13 Dec 2020 01:16:14 +0000 (20:16 -0500)]
fix typo to cycle bots
Nico Weber [Sun, 13 Dec 2020 01:11:14 +0000 (20:11 -0500)]
mac/arm: XFAIL the last 2 failing check-llvm tests
We should fix them, but let's XFAIL them for now so that we can start
running check-llvm on bots and lock in the passing tests.
Part of PR46647.
Fangrui Song [Sun, 13 Dec 2020 00:50:25 +0000 (16:50 -0800)]
[ELF][test] Rewrite st_value=0 copy relocation tests
The original tests have unneeded symbols and copy-relocation-zero-abs-addr.s
does not actually test anything.
Rewrite them and add copy-relocation-zero-addr.s instead.
Add --soname=b so that the address 0x203400 will be stable. (When linking an
executable with %t.so, the path %t.so will be recorded in the DT_NEEDED entry if
%t.so doesn't have DT_SONAME. .dynstr will have varying lengths on different
systems.)
Nico Weber [Sun, 13 Dec 2020 00:44:10 +0000 (19:44 -0500)]
[mac/arm] skip MappedMemoryTest that try to map w+x
macOS/arm is w^x, so these tests don't work. Fixes these failures:
LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.AllocAndRelease/5
LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.AllocAndReleaseHuge/5
LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.BasicWrite/5
LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.DuplicateNear/5
LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.EnabledWrite/3
LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.EnabledWrite/4
LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.EnabledWrite/5
LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.MultipleAllocAndRelease/5
LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.MultipleWrite/5
LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.SuccessiveNear/5
LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.UnalignedNear/5
LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroNear/5
LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroSizeNear/5
Part of PR46647.
Craig Topper [Sun, 13 Dec 2020 00:37:28 +0000 (16:37 -0800)]
[X86] Autogenerate complete checks. NFC
Amara Emerson [Sat, 12 Dec 2020 22:57:36 +0000 (14:57 -0800)]
[[GlobalISel][IRTranslator] Fix a crash when the use of an extractvalue is a non-dominated metadata use.
We don't expect uses to come before defs in the CFG, so allocateVRegs() asserted.
Fixes PR48211
Roman Lebedev [Sat, 12 Dec 2020 12:48:58 +0000 (15:48 +0300)]
[SimplifyCFG] FoldBranchToCommonDest(): bonus instrns must only be used by PHI nodes in successors (PR48450)
In particular, if the successor block, which is about to get a new
predecessor block, currently only has a single predecessor,
then the bonus instructions will be directly used within said successor,
which is fine, since the block with bonus instructions dominates that
successor. But once there's a new predecessor, the IR is no longer valid,
and we don't fix it, because we only update PHI nodes.
Which means, the live-out bonus instructions must be exclusively used
by the PHI nodes in successor blocks. So we have to form trivial PHI nodes.
which will then be successfully updated to recieve cloned bonus instns.
This all works fine, except for the fact that we don't have access to
the dominator tree, and we don't ignore unreachable code,
so we sometimes do end up having to deal with some weird IR.
Fixes https://bugs.llvm.org/show_bug.cgi?id=48450
Zarko Todorovski [Sat, 12 Dec 2020 20:22:57 +0000 (15:22 -0500)]
[PPC] Check for PPC64 when emitting 64bit specific VSX nodes when pattern matching built vectors
Some of the pattern matching in PPCInstrVSX.td and node lowering involving vectors assumes 64bit mode. This patch disables some of the unsafe pattern matching and lowering of BUILD_VECTOR in 32bit mode.
Reviewed By: Xiangling_L
Differential Revision: https://reviews.llvm.org/D92789
Alexey Bader [Mon, 7 Dec 2020 19:47:48 +0000 (22:47 +0300)]
[CodeGen][AMDGPU] Fix ICE for static initializer IR generation
Differential Revision: https://reviews.llvm.org/D92782
Nico Weber [Sat, 12 Dec 2020 20:19:50 +0000 (15:19 -0500)]
[mac/arm] XFAIL two more tests on arm64-apple
Part of PR46644
Nikita Popov [Sat, 12 Dec 2020 19:34:45 +0000 (20:34 +0100)]
[CVP] Simplify and generalize switch handling
CVP currently handles switches by checking an equality predicate
on all edges from predecessor blocks. Of course, this can only
work if the value being switched over is defined in a different block.
Replace this implementation with a call to getPredicateAt(), which
also does the predecessor edge predicate check (if not defined in
the same block), but can also do quite a bit more: It can reason
about phi-nodes by checking edge predicates for incoming values,
it can reason about assumes, and it can reason about block values.
As such, this makes the implementation both simpler and more
powerful. The compile-time impact on CTMark is in the noise.
Nico Weber [Sat, 12 Dec 2020 20:08:19 +0000 (15:08 -0500)]
mac/arm: XFAIL the last 3 failing tests
We should fix them, but let's XFAIL them for now so that we can start
running check-clang on bots and lock in the passing tests.
Part of 46644.
Nikita Popov [Sat, 12 Dec 2020 19:47:23 +0000 (20:47 +0100)]
[CVP] Add additional switch tests (NFC)
These cover cases handled by getPredicateAt(), but not by the
current implementation:
* Assumes based on context instruction.
* Value from phi node in same block (using per-pred reasoning).
* Value from non-phi node in same block (using block-val reasoning).
Krzysztof Parzyszek [Sat, 12 Dec 2020 19:19:36 +0000 (13:19 -0600)]
[Hexagon] Reconsider getMask fix, return original mask, convert later
The getPayload/getMask/getPassThrough functions should return values
that could be composed into a masked load/store without any additional
type casts. The previous fix violated that.
Instead, convert scalar mask to a vector right before rescaling.
Tony [Thu, 10 Dec 2020 10:01:14 +0000 (10:01 +0000)]
[AMDGPU] Add missing targets to target-invalid-cpu-note.c
Differential Revision: https://reviews.llvm.org/D93018
Tony [Thu, 10 Dec 2020 09:59:16 +0000 (09:59 +0000)]
[AMDGPU] Add missing targets to amdgpu-features.cl
Differential Revision: https://reviews.llvm.org/D93017
Tony [Thu, 10 Dec 2020 03:38:32 +0000 (03:38 +0000)]
[NFC][AMDGPU] AMDGPUUsage updates
- Document which processors are supported by which runtimes.
- Add missing mappings for code object V2 note records
Differential Revision: https://reviews.llvm.org/D93016
Brian Gesiak [Fri, 11 Dec 2020 22:57:34 +0000 (17:57 -0500)]
[mlir] Print bad size in AttrSizedOperandSegments
When printing verification errors for ops with the incorrect number of
operand segments, print the required number as well as the actual
number. Split off from D93005.
Differential Revision: https://reviews.llvm.org/D93145
Kazu Hirata [Sat, 12 Dec 2020 18:09:35 +0000 (10:09 -0800)]
[Analysis/Interval] Remove isLoop (NFC)
The last use of isLoop was removed on Apr 29, 2002 in commit
09bbb5c015c6e40b3d45da057f955ddb7c8f8485 as part of an effort to
remove "old induction varaible cannonicalization pass built on top of
interval analysis".
Kazu Hirata [Sat, 12 Dec 2020 17:37:49 +0000 (09:37 -0800)]
[Transforms] Use is_contained (NFC)
Krzysztof Parzyszek [Sat, 12 Dec 2020 16:05:30 +0000 (10:05 -0600)]
[Hexagon] Create vector masks for scalar loads/stores
AlignVectors treats all loaded/stored values as vectors of bytes,
and masks as corresponding vectors of booleans, so make getMask
produce a 1-element vector for scalars from the start.
Harald van Dijk [Sat, 12 Dec 2020 17:11:13 +0000 (17:11 +0000)]
[UpdateTestChecks] Add --(no-)x86_scrub_sp option.
This makes it possible to use update_llc_test_checks to manage tests
that check for incorrect x86 stack offsets. It does not yet modify any
test to make use of this new option.
Harald van Dijk [Sat, 12 Dec 2020 17:05:24 +0000 (17:05 +0000)]
[X86] Avoid data16 prefix for lea in x32 mode
The ABI demands a data16 prefix for lea in 64-bit LP64 mode, but not in
64-bit ILP32 mode. In both modes this prefix would ordinarily be
ignored, but the instructions may be changed by the linker to
instructions that are affected by the prefix.
Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/D93157
David Green [Sat, 12 Dec 2020 15:26:32 +0000 (15:26 +0000)]
[ARM] Add basic masked load/store costs
This adds some basic MVE masked load/store costs, notably changing the
cost of legal loads/stores to the MVECostFactor and the cost of
scalarized instructions to 8*NumElts.
Differential Revision: https://reviews.llvm.org/D86538
David Green [Sat, 12 Dec 2020 14:21:40 +0000 (14:21 +0000)]
[LV] Fix scalar cost for tail predicated loops
When it comes to the scalar cost of any predicated block, the loop
vectorizer by default regards this predication as a sign that it is
looking at an if-conversion and divides the scalar cost of the block by
2, assuming it would only be executed half the time. This however makes
no sense if the predication has been introduced to tail predicate the
loop.
Original patch by Anna Welker
Differential Revision: https://reviews.llvm.org/D86452
Nikita Popov [Sat, 12 Dec 2020 12:23:49 +0000 (13:23 +0100)]
[BasicAA] Make non-equal index handling simpler to extend (NFC)
Nikita Popov [Sat, 12 Dec 2020 12:19:23 +0000 (13:19 +0100)]
[BasicAA] Add tests for non-zero var index (NFC)
Melanie Blower [Sat, 12 Dec 2020 13:18:00 +0000 (05:18 -0800)]
Create SPIRABIInfo to enable SPIR_FUNC calling convention.
Background: Call to library arithmetic functions for div is emitted by the
compiler and it set wrong “C” calling convention for calls to these functions,
whereas library functions are declared with `spir_function` calling convention.
InstCombine optimization replaces such calls with “unreachable” instruction.
It looks like clang lacks SPIRABIInfo class which should specify default
calling conventions for “system” function calls. SPIR supports only
SPIR_FUNC and SPIR_KERNEL calling convention.
Reviewers: Erich Keane, Anastasia
Differential Revision: https://reviews.llvm.org/D92721
Tatyana Krasnukha [Thu, 10 Dec 2020 16:30:04 +0000 (19:30 +0300)]
[lldb] Make CommandInterpreter's execution context the same as debugger's one.
Currently, the interpreter's context is not updated until a command is executed.
This has resulted in the behavior of SB-interface functions and some commands
depends on previous user actions. The interpreter's context can stay uninitialized,
point to a currently selected target, or point to one of previously selected targets.
This patch removes any usages of CommandInterpreter::UpdateExecutionContext.
CommandInterpreter::HandleCommand* functions still may override context temporarily,
but now they always restore it before exiting. CommandInterpreter saves overriden
contexts to the stack, that makes nesting commands possible.
Added test reproduces one of the issues. Without this fix, the last assertion fails
because interpreter's execution context is empty until running "target list", so,
the value of the global property was updated instead of process's local instance.
Differential Revision: https://reviews.llvm.org/D92164
Tatyana Krasnukha [Wed, 2 Dec 2020 15:52:50 +0000 (18:52 +0300)]
[lldb] Modernize TargetList for-loops, NFC
Replace loops with standard algorithms or range-based loops.
Tatyana Krasnukha [Fri, 11 Dec 2020 08:09:39 +0000 (11:09 +0300)]
[lldb] "target create" shouldn't save target if the command failed
TargetList::CreateTarget automatically adds created target to the list, however,
CommandObjectTargetCreate does some additional preparation after creating a target
and which can fail. The command should remove created target if it failed. Since
the function has many ways to return, scope guard does this work safely.
Changes to the TargetList make target adding and selection more transparent.
Other changes remove unnecessary SetSelectedTarget after CreateTarget.
Differential Revision: https://reviews.llvm.org/D93052