Marco Antognini [Wed, 20 Apr 2022 09:56:19 +0000 (11:56 +0200)]
[Analyzer] Remove undefined function
This getLValue function was declared in
98db1f990fc2 ([Analyzer] [NFC]
Parameter Regions, 2020-05-11) but was never implemented.
Reviewed By: NoQ
Differential Revision: https://reviews.llvm.org/D124461
Ties Stuij [Thu, 28 Apr 2022 09:23:54 +0000 (10:23 +0100)]
[ARM] add Armv9 build attribute
The build attribute number can be found in the Arm ABI addenda32 document:
https://github.com/ARM-software/abi-aa/blob/main/addenda32/addenda32.rst#335target-related-attributes
Reviewed By: tmatheson
Differential Revision: https://reviews.llvm.org/D124090
Ilya Biryukov [Thu, 28 Apr 2022 08:39:47 +0000 (08:39 +0000)]
[AST] Improve traversal of concepts and concept requirements
- Do not traverse concept decl inside `AutoType`. We only traverse
declaration and definitions, not references to a declaration.
- Do not visit implicit AST node the relevant traversal mode.
- Add traversal extension points for concept requirements.
- Renamed `TraverseConceptReference` to mark as helper to share
the code. Having an extension point there seems confusing given that
there are many concept refences in the AST that do not call the
helper. Those are `AutoType`, `AutoTypeLoc` and constraint requirements.
Only clangd code requires an update.
There are no use-cases for concept requirement traversals yet, but
I added them in the earlier version of the patch and decided to keep
them for completeness.
Reviewed By: sammccall
Differential Revision: https://reviews.llvm.org/D124532
Krasimir Georgiev [Thu, 28 Apr 2022 09:01:27 +0000 (11:01 +0200)]
[clang-format] add a regression test for include sorting
This adds a regression test from the comments
on https://reviews.llvm.org/D121370.
Reviewed By: MyDeveloperDay, curdeius
Differential Revision: https://reviews.llvm.org/D124513
Krasimir Georgiev [Thu, 28 Apr 2022 08:58:46 +0000 (10:58 +0200)]
Revert "[clang-format] SortIncludes should support "@import" lines in Objective-C"
This reverts commit
d46fa023caa2db5a9f1e21dd038bcb626261d958.
Regressed include order in some cases with trailing comments, see the
comments on https://reviews.llvm.org/D121370. Will add a regression test
in a follow-up commit.
Pavel Labath [Thu, 28 Apr 2022 08:57:35 +0000 (10:57 +0200)]
[lldb] Reduce duplication in DWARFASTParserClang::CopyUniqueClassMethodTypes
Use lambdas to replace identical bits of code.
Lian Wang [Tue, 26 Apr 2022 01:46:27 +0000 (01:46 +0000)]
[RISCV] Support VP_SETCC mask operations
Support VP_SETCC mask operations, turn it to logical operation.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D124438
Javier Setoain [Tue, 26 Apr 2022 13:39:29 +0000 (14:39 +0100)]
[mlir][SparseTensor] Enable VLA ops in index value generation
Current index value generation uses fixed-length vector ops, this patch
adds an alterantive codegen path compatible with scalable vectors by
using `LLVM::StepVectorOp`.
Differential Revision: https://reviews.llvm.org/D124454
Jay Foad [Thu, 28 Apr 2022 08:06:36 +0000 (09:06 +0100)]
[CodeGen] Remove an outdated comment in MachinePointerInfo
This comment has been untrue since D39758 changed
MachinePointerInfo to store AddrSpace separately from V.
Nikita Popov [Wed, 27 Apr 2022 12:40:07 +0000 (14:40 +0200)]
[GVN] Encode GEPs in offset representation
When using opaque pointers, convert GEPs into offset representation
of the form P + V1 * Scale1 + V2 * Scale2 + ... + ConstantOffset.
This allows us to recognize equivalent address calculations even if
the GEPs don't use the same source element type.
This fixes an opaque pointer codegen regression seen in rustc.
Differential Revision: https://reviews.llvm.org/D124527
Luo, Yuanke [Mon, 25 Apr 2022 11:23:28 +0000 (19:23 +0800)]
[X86][AMX] combine tile cast and load/store instruction.
The `llvm.x86.cast.tile.to.vector` intrinsic is lowered to
`llvm.x86.tilestored64.internal` and `load <256 x i32>`. The
`llvm.x86.cast.vector.to.tile` is lowered to `store <256 x i32>` and
`llvm.x86.tileloadd64.internal`. When `llvm.x86.cast.tile.to.vector` is
used by `store <256 x i32>` or `load <256 x i32>` is used by
`llvm.x86.cast.vector.to.tile`, they can be combined by
`llvm.x86.tilestored64.internal` and `llvm.x86.tileloadd64.internal`.
Differential Revision: https://reviews.llvm.org/D124378
Brad Smith [Thu, 28 Apr 2022 04:17:48 +0000 (00:17 -0400)]
[Driver][Solaris] -r: imply -nostdlib like GCC
Similar to D116843 for Gnu.cpp
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D124356
Max Kazantsev [Thu, 28 Apr 2022 03:46:08 +0000 (10:46 +0700)]
[JumpThreading][NFC][CompileTime] Do not recompute BPI/BFI analyzes
They can already be available, and even if not, DT/LI can be available.
We should not recompute them. Old PM is unchanged because it would
require changing dependencies, and we don't care enough about it.
Differential Revision: https://reviews.llvm.org/D124439
Reviewed By: nikic, aeubanks
Wenju He [Thu, 28 Apr 2022 02:47:26 +0000 (10:47 +0800)]
[InferAddressSpaces] Check if AS are the same in isNoopPtrIntCastPair
isNoopAddrSpaceCast is expecting SrcAS is different from DestAS.
If the two AS are the same, consider ptrtoint/inttoptr as noop cast.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D123573
Liqin.Weng [Thu, 28 Apr 2022 02:06:27 +0000 (02:06 +0000)]
[XCORE][CodeGen][NFC] Use ArrayRef in TargetLowering functions
Reviewed By: nigelp-xmos
Differential Revision: https://reviews.llvm.org/D123661
Shengchen Kan [Tue, 26 Apr 2022 14:29:09 +0000 (22:29 +0800)]
[X86] Check the address in machine verifier
1. The scale factor must be 1, 2, 4, 8
2. The displacement must fit in 32-bit signed integer
Noticed by: https://github.com/llvm/llvm-project/issues/55091
Reviewed By: pengfei
Differential Revision: https://reviews.llvm.org/D124455
Arthur Eubanks [Wed, 27 Apr 2022 20:44:50 +0000 (13:44 -0700)]
[OpaquePtr][GlobalOpt] Don't attempt to evaluate global constructors with arguments
Previously all entries in global_ctors had to have the void()* type and
we'd skip evaluating bitcasted functions. With opaque pointers we may
see the function directly.
Fixes #55147.
Reviewed By: #opaque-pointers, nikic
Differential Revision: https://reviews.llvm.org/D124553
Peixin-Qiao [Thu, 28 Apr 2022 01:40:30 +0000 (09:40 +0800)]
[flang] Add lowering stubs for OpenMP/OpenACC declarative constructs
This patch provides the basic infrastructure for lowering declarative
constructs for OpenMP and OpenACC.
This is part of the upstreaming effort from the fir-dev branch in [1].
[1] https://github.com/flang-compiler/f18-llvm-project
Reviewed By: kiranchandramohan, shraiysh, clementval
Differential Revision: https://reviews.llvm.org/D124225
Aaron Puchert [Thu, 28 Apr 2022 01:05:09 +0000 (03:05 +0200)]
Drop '* text=auto' from .gitattributes and normalize
Git wants to check in 'text' files with LF endings, so this changes them
in the repository but not in the checkout, where they keep CRLF endings.
Differential Revision: https://reviews.llvm.org/D124563
Douglas Yung [Thu, 28 Apr 2022 00:28:57 +0000 (17:28 -0700)]
Fix test fail-file-open.test on Windows to hopefully fix the Windows buildbots.
Jonas Devlieghere [Wed, 27 Apr 2022 23:37:42 +0000 (16:37 -0700)]
[lldb] Fix escaping when launching in terminal with AppleScript
Fix escaping when launching in terminal with AppleScript. The invocation
we're building up is wrapped in single quotes when passed to bash and
wrapped in double quotes for AppleScript.
Here's an example invocation with the new escaping:
tell application "Terminal"
activate
do script "/bin/bash -c 'arch -arch arm64 'darwin-debug'
--unix-socket=/tmp/dL2jSh --arch=arm64 --working-dir
\"/private/tmp/with spaces\" --disable-aslr -- \"foo\"
\"bar\" \"baz\" ; echo Process exited with status $?';exit"
end tell
Previously we were using unescaped single quotes which resulted in the
whole bash invocation being passed in pieces. That works most of the
time but breaks when you have a space in your current working directory
for example.
rdar://
91870763
Differential revision: https://reviews.llvm.org/D124568
Jonas Devlieghere [Wed, 27 Apr 2022 23:32:38 +0000 (16:32 -0700)]
[dsymutil] Fix memory issue in the BinaryHolder
The BinaryHolder has two caches for object and archive entries. These
are implemented as StringMaps of ObjectEntry and ArchiveEntry
respectively. The fact that they're stored by value is problematic
because the BinaryHolder hands out references that become invalidate
when the data structure grows. This patch wraps those object instances
in unique pointers and changes the interface to hand out pointers. This
resulted in transient failures.
rdar://
90412671
Differential revision: https://reviews.llvm.org/D124567
Fangrui Song [Wed, 27 Apr 2022 23:25:41 +0000 (16:25 -0700)]
[LegacyPM] Remove ThreadSanitizerLegacyPass
Using the legacy PM for the optimization pipeline was deprecated in 13.0.0.
Following recent changes to remove non-core features of the legacy
PM/optimization pipeline, remove ThreadSanitizerLegacyPass.
Reviewed By: #sanitizers, vitalybuka
Differential Revision: https://reviews.llvm.org/D124209
Kirill Stoimenov [Wed, 27 Apr 2022 23:10:36 +0000 (23:10 +0000)]
Revert "[Debuginfo][LSR] Add salvaging variadic dbg.value intrinsics [2/2]"
This reverts commit
74273d575f9938d751a1c67862cffe553fe2de8b.
Buildbot: https://lab.llvm.org/buildbot/#/builders/5/builds/22795
Failing with memory leak.
Zequan Wu [Wed, 27 Apr 2022 23:05:09 +0000 (16:05 -0700)]
[llvm-symbolizer][native-pdb] Don't reset CurLineOffset if NextLineOffset is none
Matt Arsenault [Wed, 27 Apr 2022 23:01:24 +0000 (19:01 -0400)]
Revert "BranchFolder: Assert on SSA functions"
This reverts commit
6ff91d17d66da46572e97f9a0b042182762cbe9e.
Volodymyr Sapsai [Wed, 2 Mar 2022 04:08:01 +0000 (20:08 -0800)]
[modules] Merge equivalent extensions and diagnose ivar redeclarations for extensions loaded from different modules.
Emitting metadata for the same ivar multiple times can lead to
miscompilations. Objective-C runtime adds offsets to calculate ivar
position in memory and presence of duplicate offsets causes wrong final
position thus overwriting unrelated memory.
Such a situation is impossible with modules disabled as clang diagnoses
ivar redeclarations during sema checks after parsing
(`Sema::ActOnFields`). Fix the case with modules enabled by checking
during deserialization if ivar is already declared. We also support
a use case where the same category ends up in multiple modules. We
don't want to treat this case as ivar redeclaration and instead merge
corresponding ivars.
rdar://
83468070
Differential Revision: https://reviews.llvm.org/D121177
Matt Arsenault [Tue, 19 Apr 2022 17:51:20 +0000 (13:51 -0400)]
llvm-reduce: Fix incorrect cloning of MachineMemOperands
There were two problems with directly copying the MMOs from the old
function. The MMOs are owned by the function's Allocator, so need to
be reallocated anyways (surprisingly I didn't notice breakage on
this). Second, the PseudoSourceValues are also allocated per function
and need to be reallocated.
Matt Arsenault [Mon, 25 Apr 2022 12:12:32 +0000 (08:12 -0400)]
BranchFolder: Assert on SSA functions
We probably should have the opposite of getRequiredProperties for this
Paul Robinson [Wed, 27 Apr 2022 22:44:22 +0000 (15:44 -0700)]
[PS5] Enable dead-stripping globals in ASan
Bill Wendling [Wed, 27 Apr 2022 22:37:08 +0000 (15:37 -0700)]
[X86] Move target-generic code into CodeGen [NFC]
This code is the same for all platforms.
Differential Revision: https://reviews.llvm.org/D124566
Matt Arsenault [Fri, 22 Apr 2022 21:40:25 +0000 (17:40 -0400)]
llvm-reduce: Fix crashing on file opening error for mir path
Matt Arsenault [Tue, 19 Apr 2022 02:19:57 +0000 (22:19 -0400)]
llvm-reduce: Support multiple MachineFunctions
The current testcase I'm trying to reduce only reproduces with IPRA
enabled and requires handling multiple functions.
The only real difference vs. the IR is the extra indirect to look for
the underlying MachineFunction, so treat the ReduceWorkItem as the
module instead of the function.
The ugliest piece of this is really the ugliness of
MachineModuleInfo. It not only tracks actual module state, but has a
number of transient fields used for isel and/or the asm printer. These
shouldn't do any harm for the use here, though they should be
separated out.
Matt Arsenault [Wed, 27 Apr 2022 21:56:46 +0000 (17:56 -0400)]
llvm-reduce: Try to fix test on windows buildbots
Peter Steinfeld [Tue, 26 Apr 2022 22:21:03 +0000 (15:21 -0700)]
[flang] Fix MAXLOC/MINLOC when MASK is scalar .FALSE.
When passing a scalar .FALSE. as the MASK argument to MAXLOC, we were getting
bad memory references. We were falling into the code intended when the MASK
argument was missing.
I fixed this by checking for a scalar MASK with a .FALSE. value and
setting the result to all zeroes in that case. I also added tests for
MAXLOC and MINLOC with scalar values of .TRUE. and .FALSE. for the MASK
argument.
I also special cased situations where the MASK argument is a scalar with
a .TRUE. value and passed along a nullptr in such cases.
Along the way, I eliminated the unused "chars" argument from the constructor
for ExtremumLocAccumulator.
Differential Revision: https://reviews.llvm.org/D124484
Matt Arsenault [Mon, 18 Apr 2022 22:57:43 +0000 (18:57 -0400)]
llvm-reduce: Try to parse triple/datalayout from module
This saves needing to specify -mtriple on nearly every use for MIR
reduction.
David Blaikie [Wed, 27 Apr 2022 21:45:05 +0000 (21:45 +0000)]
DWP parsing: Use the index by hash when available
Rather than looking up by offset - actually use the hash table to
perform faster lookup where possible. (for DWARFv4 DWP compilation units
the hash isn't in the header - it's in the root DIE, but to parse the
DIE you need the abbrev section and to get the abbrev section you need
the index - so in that case lookup by offset is required)
Zequan Wu [Sat, 23 Apr 2022 01:35:00 +0000 (18:35 -0700)]
[llvm-pdbutil] Add options to only dump symbol record at specified offset and its parents or children with spcified depth.
Right now, if we want to dump symbol at specified offset, we need to use `grep`.
And it can only show surrounding symbols in layout (not in lexical scope sense).
This adds similar options to `dump` command as `llvm-dwarfdump` to allow users
to dump symbol record at specified offset and its parents or children with
spcified depth.
`--symbol-offset=` must be used with `--modi` to dump only one symbol at given
offset.
`--show-parents`/`--show-children` must be used with `--symbol-offset` to
dump all symbols that are parents/children of the symbol at given offset.
`--parent-recurse-depth`/`--children-recurse-depth` must be used with
`--show-parents`/`--show-children` to specify the max up/down depth.
Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D124317
Matt Arsenault [Wed, 27 Apr 2022 21:15:57 +0000 (17:15 -0400)]
llvm-reduce: Fix not cloning MachineInstr flags
owenca [Tue, 26 Apr 2022 13:47:36 +0000 (06:47 -0700)]
[clang-format] Adjust editor cursor position past #include blocks
Fixes #55027.
Differential Revision: https://reviews.llvm.org/D124452
David Blaikie [Wed, 27 Apr 2022 21:17:01 +0000 (21:17 +0000)]
DebugInfo: Use hash-based unit lookup when available in dwp files
Fix a test case that had a bogus (probably I hand crafted it at some
point) index that didn't point to the right data in the process.
Paul Robinson [Wed, 27 Apr 2022 20:45:15 +0000 (13:45 -0700)]
[PS5] Test sanitizer options/lib names
The functionality was added in 7726ad0, catching up on the tests now.
Florian Hahn [Wed, 27 Apr 2022 20:36:53 +0000 (21:36 +0100)]
[SimpleLoopUnswitch] Fix CHECK lines of tests added in
93182c9ff4c.
When generating the tests I accidentally had some other changes applied.
Fix the CHECK lines for current main.
Florian Hahn [Wed, 27 Apr 2022 20:19:13 +0000 (21:19 +0100)]
[SimpleLoopUnswitch] Add test cases where freeze of OR/AND cons needed.
Freezing just the result of the AND/OR here is not enough.
Simon Pilgrim [Wed, 27 Apr 2022 20:09:53 +0000 (21:09 +0100)]
[X86] setcc.ll - add bmi2 + tbm test coverage
As discussed on Issue #55138 - BMI2 (fast shrx) shouldn't always fold to BT
Simon Pilgrim [Wed, 27 Apr 2022 20:06:02 +0000 (21:06 +0100)]
[X86] setcc.ll - remove unnecessary cpu attributes
Simon Pilgrim [Wed, 27 Apr 2022 20:03:47 +0000 (21:03 +0100)]
[X86] Add test case for Issue #55138
Simon Pilgrim [Wed, 27 Apr 2022 20:03:25 +0000 (21:03 +0100)]
[X86] Use is128BitLaneRepeatedShuffleMask wrapper. NFC.
We don't need to know the actual repeated mask.
Chris Bieneman [Wed, 27 Apr 2022 14:26:56 +0000 (09:26 -0500)]
Update PGO and 3-stage cache files
These files are out of date and haven't been updated to work within the
monorepo. This change updates them appropriately so that they build
using the monorepo build infrastructure.
Peter Klausler [Tue, 26 Apr 2022 20:29:55 +0000 (13:29 -0700)]
[flang] Downgrade a fatal error to a warning
A non-CHARACTER expression in a CASE statement is allowed to have
a distinct kind (not type) from the expression in its SELECT CASE.
If a value in a CASE statement is out of range for the SELECT CASE
type, emit a warning, but it should not be a fatal error.
Differential Revision: https://reviews.llvm.org/D124544
Peter Klausler [Tue, 26 Apr 2022 20:01:00 +0000 (13:01 -0700)]
[flang] Allow for host association in ConvertTo(Object|Proc)Entity
Name resolution fails with a bogus "is not a variable" error message
when a host-associated object appears in a NAMELIST group. The root
cause is that ConvertToObjectEntity() returns false for host-associated
objects. Fix that, and also apply a similar fix to ConvertToProcEntity()
nearby.
Differential Revision: https://reviews.llvm.org/D124541
Blue Gaston [Tue, 26 Apr 2022 21:33:08 +0000 (14:33 -0700)]
[Darwin][UBSan][Sanitizer] abort_on_error ubsan test fix for arm64
The current darwin abort_on_error test specifically tests for a division
by zero undefined behavior. However arm does not trap by default for this
behavior. x86 signals the abort, which is why the test passes on x86.
This patch updates the test to test for a case where the ubsan runtime
specifically calls Die() to trigger an abort by default.
rdar://
92108564
Differential Revision: https://reviews.llvm.org/D124480
Petr Hosek [Wed, 27 Apr 2022 18:41:41 +0000 (11:41 -0700)]
Revert "[Driver] Support for compressed debug info on Fuchsia"
This reverts commit
2d0c897212d0551966b26eae986209ea31c4f032 which
is still breaking on the sanitizer bots.
Matt Arsenault [Tue, 19 Apr 2022 18:59:32 +0000 (14:59 -0400)]
llvm-reduce: Fix mangling types of generic registers
Petr Hosek [Wed, 17 Nov 2021 19:06:03 +0000 (11:06 -0800)]
[Driver] Support for compressed debug info on Fuchsia
Pass the --compress-debug-sections=zlib argument to the linker when
the use of compressed debug info is requested.
Differential Revision: https://reviews.llvm.org/D114115
Matt Arsenault [Tue, 19 Apr 2022 14:15:40 +0000 (10:15 -0400)]
llvm-reduce: Preserve subregisters and other fields for top block def
Nicolas Abram Lujan [Wed, 27 Apr 2022 17:41:25 +0000 (13:41 -0400)]
[InstCombine] C0 >> (X - C1) --> (C0 << C1) >> X
With the right pre-conditions, we can fold the offset
into the shifted constant:
https://alive2.llvm.org/ce/z/drMRBU
https://alive2.llvm.org/ce/z/cUQv-_
Fixes #55016
Differential Revision: https://reviews.llvm.org/D124369
Craig Topper [Wed, 27 Apr 2022 17:32:54 +0000 (10:32 -0700)]
[RISCV] Add isCommutable to scalar FMA instructions.
The default implementation of findCommutedOpIndices picks the
first two source operands. That's exactly what we want for the
scalar FMA instructions.
Reviewed By: reames
Differential Revision: https://reviews.llvm.org/D124463
Martin Sebor [Wed, 27 Apr 2022 18:01:35 +0000 (12:01 -0600)]
[InstCombine] Fold strnlen calls in equality to zero.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D123818
Alexey Bataev [Wed, 14 Apr 2021 14:49:32 +0000 (07:49 -0700)]
[COST]Improve cost model for shuffles in SLP.
Introduced masks where they are not added and improved target dependent
cost models to avoid returning of the incorrect cost results after
adding masks.
Differential Revision: https://reviews.llvm.org/D100486
Zequan Wu [Wed, 27 Apr 2022 17:46:51 +0000 (10:46 -0700)]
[LLDB][NativePDB] Minor fix ParseInlinesite.
- Don't reset cur_line_offset to llvm::None when we don't have next_line_offset, because we may need to reuse it in new range after a code end.
- Don't use CombineConsecutiveEntriesWithEqualData for inline_site_sp->ranges, because that will combine consecutive entries with same data in the vector regardless of the entry's range. Originally, I thought that it only combine consecutive entries if adjacent entries' ranges are adjoining or intersecting with each other.
Andrew Savonichev [Wed, 27 Apr 2022 16:36:54 +0000 (19:36 +0300)]
[lit] Support %if ... %else syntax for RUN lines
This syntax allows to modify RUN lines based on features
available. For example:
RUN: ... | FileCheck %s --check-prefix=%if windows %{CHECK-W%} %else %{CHECK-NON-W%}
CHECK-W: ...
CHECK-NON-W: ...
The whole command can be put under %if ... %else:
RUN: %if tool_available %{ %tool %} %else %{ true %}
or:
RUN: %if tool_available %{ %tool %}
If tool_available feature is missing, we'll have an empty command in
this RUN line. LIT used to emit an error for empty commands, but now
it treats such commands as nop in all cases.
Multi-line expressions are also supported:
RUN: %if tool_available %{ \
RUN: %tool \
RUN: %} %else %{ \
RUN: true \
RUN: %}
Background and motivation:
D121727 [NVPTX] Integrate ptxas to LIT tests
https://reviews.llvm.org/D121727
Differential Revision: https://reviews.llvm.org/D122569
Wei Wang [Mon, 25 Apr 2022 21:00:41 +0000 (14:00 -0700)]
[CHR] Skip region containing llvm.coro.id
When a block containing llvm.coro.id is cloned during CHR, it inserts an invalid
PHI node with token type to the beginning of the block containing llvm.coro.begin.
To avoid such case, we exclude regions with llvm.coro.id.
Reviewed By: ChuanqiXu
Differential Revision: https://reviews.llvm.org/D124418
Aart Bik [Wed, 27 Apr 2022 04:25:32 +0000 (21:25 -0700)]
[mlir][sparse] optimize COO index handling
By using a shared index pool, we reduce the footprint of each "Element"
in the COO scheme and, in addition, reduce the overhead of allocating
indices (trading many allocations of vectors for allocations in a single
vector only). When the capacity is known, this means *all* allocation
can be done in advance.
This is a big win. For example, reading matrix SK-2005, with dimensions
50,636,154 x 50,636,154 and 1,949,412,601 nonzero elements improves
as follows (time in ms), or about 3.5x faster overall
```
SK-2005 before after speedup
---------------------------------------------
read 305,086.65 180,318.12 1.69
sort 2,836,096.23 510,492.87 5.56
pack 364,485.67 312,009.96 1.17
---------------------------------------------
TOTAL 3,505,668.56 1,002,820.95 3.50
```
Reviewed By: bixia
Differential Revision: https://reviews.llvm.org/D124502
Vasileios Porpodas [Tue, 26 Apr 2022 15:31:19 +0000 (08:31 -0700)]
[NFC] Renamed /test/Analysis/CostModel/X86/splat-load.ll test and added more checks.
Renamed test/Analysis/CostModel/X86/splat-load.ll to shuffle-load.ll
to align it with AArch64's similar test.
Also added a complete list of checks for all vector combinations up to 512-bits.
Differential Revision: https://reviews.llvm.org/D124528
Min-Yih Hsu [Wed, 20 Apr 2022 17:40:37 +0000 (10:40 -0700)]
[mlir][LLVMIR] Do not cache llvm::Constant into instMap
Constants in MLIR are not globally unique, unlike that in LLVM IR.
Therefore, reusing previous-translated constants might cause the user
operations not being dominated by the constant (because the
previous-translated ones can be placed in arbitrary place)
This indeed misses some opportunities where we actually can reuse a
previous-translated constants, but verbosity is not our first priority
here.
Differential Revision: https://reviews.llvm.org/D124404
Min-Yih Hsu [Wed, 20 Apr 2022 17:30:43 +0000 (10:30 -0700)]
[mlir][LLVMIR] Do not cache Instruction generated on-the-fly
More specifically, the llvm::Instruction generated by
llvm::ConstantExpr::getAsInstruction. Such Instruction will be deleted
right away, but it's possible that when getAsInstruction is called
again, it will create a new Instruction that has the same address with
the one we just deleted. Thus, we shouldn't keep it in the `instMap` to
avoid a conflicting index that triggers an assertion in
processInstruction.
Differential Revision: https://reviews.llvm.org/D124402
Min-Yih Hsu [Wed, 20 Apr 2022 17:48:42 +0000 (10:48 -0700)]
[mlir][LLVMIR] Add support for importing struct-type ConstantAggregate(Zero)
And move importer test files from `test/Target/LLVMIR` into
`test/Target/LLVMIR/Import`.
We simply translate struct-type ConstantAggregate(Zero) into a
serious of `llvm.insertvalue` operations against a `llvm.undef` root.
Note that this doesn't affect the original logics on translating
vector/array-type ConstantAggregate values.
Differential Revision: https://reviews.llvm.org/D124399
Mike Kashkarov [Wed, 27 Apr 2022 13:14:10 +0000 (16:14 +0300)]
[flang] Fix UBOUND() folding for constant arrays
Similarly to LBOUND in https://reviews.llvm.org/D123237, fix UBOUND() folding
for constant arrays (for both w/ and w/o DIM=): convert
GetConstantArrayLboundHelper into common helper class for both lower/upper
bounds.
Reviewed By: jeanPerier
Differential Revision: https://reviews.llvm.org/D123520
Mathieu Fehr [Wed, 27 Apr 2022 15:43:37 +0000 (08:43 -0700)]
[mlir] Allow setting operation legality with an OperationName
This is necessary to handle conversions of operations defined at runtime in extensible dialects.
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D124353
Chris Bieneman [Wed, 27 Apr 2022 15:43:31 +0000 (10:43 -0500)]
[DXIL] [NFC] Remove dead attribute code paths
DXIL doesn't support attributes added after LLVM 3.7. The DXILPrepare
pass removes those attributes so they should never be present by the
time we reach the DXIL bitcode writer.
In the event that we somehow try to write a newer attribute in the DXIL
writer, we should fail hard (crash), because the output would be
invalid. This case should only be possible if the DXIL writer were
called without DXILPrepare being run first, which shouldn't be possible.
This patch also adds a default case to the switch statement over the
attribute list which covers all the removed cases and any new attribute
kinds that may be added in the future. The default case is handled like
other unsupported cases by a call to llvm_unreachable.
Hans Wennborg [Wed, 27 Apr 2022 12:14:39 +0000 (14:14 +0200)]
Remove the Visual Studio/MSBuild integration (llvm/tools/msbuild/)
This has been obsolete and abandoned since MS started including an
integration themselves in Visual Studio 2019.
See discussion at
https://discourse.llvm.org/t/building-the-llvm-with-msbuild/62053/
Differential revision: https://reviews.llvm.org/D124521
Jonas Devlieghere [Wed, 27 Apr 2022 01:23:10 +0000 (18:23 -0700)]
Remove Python 2 checks from the test suite
We dropped downstream support for Python 2 in the previous release. Now
that we have branched for the next release the window where this kind of
change could introduce conflicts is closing too. Remove Python 2 checks
from the test suite.
Differential revision: https://reviews.llvm.org/D124429
Jonas Devlieghere [Tue, 26 Apr 2022 03:14:44 +0000 (20:14 -0700)]
Remove Python 2 support from the ScriptInterpreter plugin
We dropped downstream support for Python 2 in the previous release. Now
that we have branched for the next release the window where this kind of
change could introduce conflicts is closing too. Start by getting rid of
Python 2 support in the Script Interpreter plugin.
Differential revision: https://reviews.llvm.org/D124429
Dmitry Vyukov [Wed, 27 Apr 2022 09:23:41 +0000 (11:23 +0200)]
tsan: avoid false positives related to epoll
An application can use the mere fact of epoll_wait returning an fd
as synchronization with the write on the fd that triggered the notification.
This pattern come up in an internal networking server (b/
229276331).
If an fd is added to epoll, setup a link from the fd to the epoll fd
and use it for synchronization as well.
Reviewed By: melver
Differential Revision: https://reviews.llvm.org/D124518
Simon Pilgrim [Wed, 27 Apr 2022 14:29:03 +0000 (15:29 +0100)]
[X86] collectConcatOps - add ability to collect from vector 'widening' patterns
Recognise insert_subvector(undef, x, lo/hi) patterns where we double the width of a vector - creating an UNDEF subvector on the fly.
David Green [Wed, 27 Apr 2022 14:36:15 +0000 (15:36 +0100)]
[AArch64] Attempt to fix bots by ensuring legalized type is a vector
Andrew Savonichev [Tue, 26 Apr 2022 19:41:10 +0000 (22:41 +0300)]
[NVPTX] Fix NVPTX DebugInfo tests on Windows
Lei Zhang [Wed, 27 Apr 2022 14:22:41 +0000 (10:22 -0400)]
[mlir][spirv] Add conversion from vector.reduction
Only supports addition and multiplication for now; other cases
to be implemented.
Reviewed By: hanchung
Differential Revision: https://reviews.llvm.org/D124380
Roman Lebedev [Wed, 27 Apr 2022 13:48:02 +0000 (16:48 +0300)]
[InstCombine] 'round up integer': if bias is just right, just reuse instructions
This is only useful if we can't create new instruction
because %x.aligned has other uses and already sticks around.
Roman Lebedev [Wed, 27 Apr 2022 11:44:03 +0000 (14:44 +0300)]
[InstCombine] Fold 'round up integer' pattern (when alignment is a power of two)
But don't deal with non-splats.
The test coverage is sufficiently exhaustive,
and alive is happy about the changes there.
Example with constants: https://alive2.llvm.org/ce/z/EUaJ5- / https://alive2.llvm.org/ce/z/Bkng2X
General proof: https://alive2.llvm.org/ce/z/3RjJ5A
Roman Lebedev [Tue, 26 Apr 2022 23:25:33 +0000 (02:25 +0300)]
[NFC][InstCombine] Add some tests for open-coded round-up of an integer w/ power-of-2 target alignment
Lei Zhang [Wed, 27 Apr 2022 14:13:17 +0000 (10:13 -0400)]
[mlir][spirv] Allow converting from index type in unsigned ops
`index` type is converted to `i32` in SPIR-V. This is fine to
support for all signed/unsigned ops.
Reviewed By: hanchung
Differential Revision: https://reviews.llvm.org/D124451
Shilei Tian [Wed, 27 Apr 2022 14:07:49 +0000 (10:07 -0400)]
[SLP] Fix a typo that causes redundant assertion and potential segment fault
Reviewed By: ABataev
Differential Revision: https://reviews.llvm.org/D124497
Pavel Labath [Wed, 27 Apr 2022 14:01:54 +0000 (16:01 +0200)]
[lldb] Remove sanity check from TestWithLimitDebugInfo
The trick with opening the .o file does not work on arm (unhandled
relocations), and I can't think of a quick fix for that.
Joseph Huber [Wed, 27 Apr 2022 13:56:37 +0000 (09:56 -0400)]
[OpenMP] Properly handle the `-f/-fno` veraints for the new driver
Summary:
We provide the `-f(no-)openmp-new-driver` option to allow users to use
the old or new driver. Previously this wasn't handled in the expected
way and only `-fno-openmp-new-driver` was checked. This patch fixes that
by using the `hasFlag` method as is standard.
Sanjay Patel [Wed, 27 Apr 2022 13:01:19 +0000 (09:01 -0400)]
[InstCombine] add tests for ashr/lshr of constant with shift amount offset; NFC
Baseline tests for D124369
LLVM GN Syncbot [Wed, 27 Apr 2022 13:44:43 +0000 (13:44 +0000)]
[gn build] Port
6ddf2a824da9
Nikita Popov [Wed, 27 Apr 2022 12:56:40 +0000 (14:56 +0200)]
[GVN] Add more tests for opaque pointer GEPs (NFC)
Some of these are equivalent when considering an offset encoding.
Ivan Kosarev [Wed, 27 Apr 2022 13:07:52 +0000 (14:07 +0100)]
[AMDGPU] Adjust wave priority based on VMEM instructions to avoid duty-cycling.
As older waves execute long sequences of VALU instructions, this may
prevent younger waves from address calculation and then issuing their
VMEM loads, which in turn leads the VALU unit to idle. This patch tries
to prevent this by temporarily raising the wave's priority.
Reviewed By: foad
Differential Revision: https://reviews.llvm.org/D124246
David Tenty [Wed, 27 Apr 2022 13:31:36 +0000 (09:31 -0400)]
[NFC] XFAIL tests which need visibility in XCOFF objectwriting
on AIX since this is currently unsupported and we added an error in D124392.
Anna Thomas [Tue, 26 Apr 2022 21:15:48 +0000 (17:15 -0400)]
[IRCE] Avoid computing potentially unnecessary analyses. NFC
IRCE is a function pass that operates on loops. If there are no loops in
the function (as seen through LI), we should avoid computing the
remaining expensive analyses (such as BPI). Reordered the analyses
requests and early return if there are no loops. This is an NFC with
compile time improvement.
The same will be done in a follow-up patch for the loop vectorizer.
Reviewed-By: nikic
Differential Revision: https://reviews.llvm.org/D124478
Biplob Mishra [Wed, 27 Apr 2022 13:17:54 +0000 (14:17 +0100)]
InstCombine: Add tests to show or-and scenarios which can be possibly be combined generically
Pavel Labath [Tue, 26 Apr 2022 14:13:48 +0000 (16:13 +0200)]
[lldb] Fix TestWithLimitDebugInfo.py
The test was broken (in the sense that it was not testing what it was
supposed to test) in two ways:
- a Makefile refactor caused it to stop being built with
-flimit-debug-info
- clang's constructor homing changed the "home" of the type
This patch fixes the Makefile, and modifies the source code to produce
the same result with both type homing strategies. Due to constructor
homing I had to use a different implicitly-defined function for the test
-- I chose the assignment operator.
I also added some sanity checks to the test to ensure that the test is
indeed operating on limited debug info.
Pavel Labath [Wed, 27 Apr 2022 13:01:01 +0000 (15:01 +0200)]
[lldb] Make test names unique
Florian Hahn [Wed, 27 Apr 2022 13:06:35 +0000 (14:06 +0100)]
[SimpleLoopUnswitch] Add trivial unswitching tests with selects.
Add tests with selects that match both logical AND and logical OR. Note
that some of the tests get miscompiled at the moment.
Also moves a related test to the newly added test file.
Denis Antrushin [Tue, 26 Apr 2022 10:52:43 +0000 (17:52 +0700)]
[StatepointLowering] Only export STATEPOINT results if used in nonlocal blocks.
Cuurently we always export STATEPOINT results (GC pointers lowered via VRegs)
to virtual registers. When processing gc.relocate instructions we have to
generate CopyFromRegs node and then export it to VReg again if gc.relocate
is used in other basic blocks. This results in generation of extra COPY MIR
instruction if statepoint and its gc.relocate are in the same BB, but gc.relocate
result is used in other blocks.
This patch changes this behavior to export statepoint results only if used
in other basic blocks. For local uses StatepointLoweringState.(get|set)Location()
API is used to communicate appropriate statepoint result from `LowerStatepoint()`
to `visitGCRelocate()`
This is NFC and is purely compile time optimization. On big methids it can improve
codegen compile time up to 10%.
Reviewed By: reames
Differential Revision: https://reviews.llvm.org/D124444
David Green [Wed, 27 Apr 2022 12:51:50 +0000 (13:51 +0100)]
[AArch64] Break up larger shuffle-masks into legal sizes in getShuffleCost
Given a larger-than-legal shuffle mask, the final codegen will split
into multiple sub-vectors. This attempts to model that in
AArch64TTIImpl::getShuffleCost, splitting masks up according to the size
of the legalized vectors. If the sub-masks have at most 2 input sources
we can call getShuffleCost on them and sum the costs, to get a more
accurate final cost for the entire shuffle. The call to
improveShuffleKindFromMask helps to improve the shuffle kind for the
sub-mask cost call.
Differential Revision: https://reviews.llvm.org/D123414
David Green [Wed, 27 Apr 2022 12:30:50 +0000 (13:30 +0100)]
[AArch64] Add some larger shuffle cost tests. NFC
Kiran Chandramohan [Wed, 27 Apr 2022 12:19:54 +0000 (12:19 +0000)]
[Flang] Lower the FailImage Statement
Lowering of FailImage statement generates a runtime call and the
unreachable operation. The unreachable operation cannot terminate
a structured operation like the IF operation, hence mark as
unstructured.
Note: This patch is part of upstreaming code from the fir-dev branch of
https://github.com/flang-compiler/f18-llvm-project.
Reviewed By: clementval
Differential Revision: https://reviews.llvm.org/D124520
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>