Commit Graph

437188 Commits

Author SHA1 Message Date
rkayaith 868a8fd88f [mlir] Add macro for enabling all generated pass declarations
Currently the generated pass declarations have to be enabled per-pass
using multiple `GEN_PASS_DECL_{PASSNAME}` defines. This adds
`GEN_PASS_DECL`, which enables the declarations for all passes in the
group with a single macro. This is convenient for cases where a single
header is used for all passes in the group.

Reviewed By: mehdi_amini, mscuttari

Differential Revision: https://reviews.llvm.org/D134766
2022-09-28 11:49:28 -04:00
Jon Chesterfield 35f2584ef9 [amdgpu] Error, instead of miscompile, anonymous kernels using lds
The association between kernel and struct is done by symbol name.
This doesn't work robustly for anonymous kernels as shown by the modified
test case.

An alternative association between function and struct can be constructed
if necessary, probably though metadata, but on the basis that we currently
miscompile anonymous kernels and that they are difficult to construct from
application code and difficult to call from the runtime, this patch makes
it a fatal error for now.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D134741
2022-09-28 16:30:04 +01:00
Sameer Sahasrabuddhe 3f078b308b [AAPointerInfo] OffsetInfo: Unassigned is distinct from Unknown
A User like the PHINode may be visited multiple times for the same pointer along
different def-use edges. The uninitialized state of OffsetInfo at the first
visit needs to be distinct from the Unknown value that may be assigned after
processing the PHINode. Without that, a PHINode with all inputs Unknown is never
followed to its uses. This results in incorrect optimization because some
interfering accessess are missed.

Differential Revision: https://reviews.llvm.org/D134704
2022-09-28 20:31:36 +05:30
Benjamin Kramer 0fb2676c24 Revert "[FunctionAttrs] Infer precise FMRB"
This reverts commit 97dfa53626.

It can make DSE crash. Reduced test case at
https://reviews.llvm.org/P8291
2022-09-28 16:57:43 +02:00
Daniel Bertalan f546165754
[lld-macho] Don't create entries in isecPriorities during sorting (NFC)
If a value for a given key is not present, `DenseMap::operator[]`
default-constructs one, which is wasteful when we don't do anything with
it afterwards. Fix it by calling `lookup()` instead which only returns
the default value, but does not modify the map.

This speeds up linking a fair bit when only a small portion of all
sections are specified in the order file, like in the case of Chromium
Framework:

      N           Min           Max        Median           Avg        Stddev
  x  25      3.727684     3.8808699      3.753552     3.7702461     0.0397282
  +  25     3.6469049     3.7523289     3.6764321     3.6841622   0.025525047
  Difference at 95.0% confidence
  	-0.0860839 +/- 0.0189924
  	-2.28324% +/- 0.503745%
  	(Student's t, pooled s = 0.0333906)

Differential Revision: https://reviews.llvm.org/D134811
2022-09-28 16:50:18 +02:00
Matt Arsenault 7a84624079 AMDGPU: Make various vector undefs legal
Surprisingly these were getting legalized to something
zero initialized.

This fixes an infinite loop when combining some vector types.
Also fixes zero initializing some undef values.

SimplifyDemandedVectorElts / SimplifyDemandedBits are not checking
for the legality of the output undefs they are replacing unused
operations with. This resulted in turning vectors into undefs
that were later re-legalized back into zero vectors.
2022-09-28 10:48:52 -04:00
Matt Devereau 0a4771a7e8 [AArch64][SVE] Expand gather index to 32 bits instead of 64 bits
For gathers which load in 8 and 16 bit data then use that data
as an index, the index can be extended to 32 bits instead of
64 bits

Differential Revision: https://reviews.llvm.org/D130692
2022-09-28 14:42:12 +00:00
Krzysztof Drewniak ae1f707366 [mlir] Use hip's config mode to find libraries
Instead of using find_package(HIP) to find FindHIP.cmake, which
doesn't seem to be the preferred way to find HIP anymore, use
find_package(hip CONFIG) to find the HIP configuration. Give
preference to ${ROCM_PATH} over ${ROCM_PATH}/hip in order to handle
the fact that newer ROCm versions prefer the include path to use
${ROCM_PATH}/include/hip over ${ROCM_PATH}/hip/innclude/hip (the
latter throws up a bunch of deprecation warnings)

Then, instead of trying to manually find the host-side headers and
runtime library by hand, use the hip::host and hip::amdhip64 libraries
that the config module defines.

This makes the CMake config much less error-prone and brings it in
line with the recommended approach to finding HIP.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D134753
2022-09-28 14:36:09 +00:00
Florian Hahn eba84971ae
Revert "[AARCH64][CostModel] Modified the cost of mask vector load/store"
This reverts commit 1c62af3e23.

The commit causes the test below to fail. Revert for now to get the bots
back to green.

Failing test:
lvm/test/Transforms/LoopVectorize/AArch64/masked-op-cost.ll
2022-09-28 15:35:13 +01:00
Nikita Popov 4ac4d6bc9f [cmake] Export GetHostTriple.cmake
GetHostTriple is used by the runtimes build, so this cmake file
must be exported. Otherwise it is not possible to build runtimes
against a previously built LLVM.

Differential Revision: https://reviews.llvm.org/D134730
2022-09-28 16:28:37 +02:00
Florian Hahn 2d3c260362
[AArch64] break non-temporal loads over 256 into 256-loads and a smaller load
Currently over 256 non-temporal loads are broken inefficently. For example, `v17i32` gets broken into 2 128-bit loads. It is better if we can use
256-bit loads instead.

Reviewed By: fhahn

Differential Revision: https://reviews.llvm.org/D133421
2022-09-28 15:20:26 +01:00
Jon Chesterfield 80ba432821 [amdgpu][nfc] Allocate kernel-specific LDS struct deterministically
A kernel may have an associated struct for laying out LDS variables.
This patch puts that instance, if present, at a deterministic address by
allocating it at the same time as the module scope instance.

This is relatively likely to be where the instance was allocated anyway (~NFC)
but will allow later patches to calculate where a given field can be found,
which means a function which is only reachable from a single kernel will be
able to access a LDS variable with zero overhead. That will be particularly
helpful for applications that instantiate a function template containing LDS
variables once per kernel.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D127052
2022-09-28 14:55:16 +01:00
Archibald Elliott dcc0048279 [AArch64] Correct v9.x-a Features
A change to D109517 during review stated it was disabling the crypto
extensions by default in armv9a, but it also ended up removing two other
non-crypto features: i8mm and bf16. This error was also made in D116158.

This patch re-adds those two extensions to the feature bitmaps for the
affected armv9a versions in the target parser.

Differential Revision: https://reviews.llvm.org/D134647
2022-09-28 14:52:44 +01:00
Archibald Elliott ff4027d152 [ARM] Support fp16/bf16 using t constraint
fp16 and bf16 values can be used in GCC's inline assembly using the "t"
constraint, which means "VFP floating-point registers s0-s31" - fp16 and
bf16 values are stored in S registers too.

This change ensures that LLVM is compatible with GCC for programs that
use fp16 and the 't' constraint.

Fixes 

Differential Revision: https://reviews.llvm.org/D134553
2022-09-28 14:48:21 +01:00
David Truby 8bd54409b1 [flang] Use libm over pgmath for complex number intrinsics
This patch changes the handling of complex number intrinsics that
have C libm equivalents to call into those instead of calling the
external pgmath library.

Currently complex numbers to integer powers are excluded as libm
has no powi equivalent function.

Differential Revision: https://reviews.llvm.org/D134655
2022-09-28 13:25:10 +00:00
Anubhab Ghosh 5ccadb48c9 [llvm-jitlink] Remove JITLinkSlabAllocator class
This class was used for testing JITLink with -noexec option and
also included slab allocation support. Its functionality has been
replaced with InProcessDeltaMapper and MapperJITLinkMemoryManager.

Differential Revision: https://reviews.llvm.org/D134781
2022-09-28 18:48:20 +05:30
David Spickett 0c1a3da8ea [LLDB] Remove the bool + RegisterInfo& version of GetRegisterInfo
All callers have been converted to the optional version.

Depends on D134540

Reviewed By: clayborg

Differential Revision: https://reviews.llvm.org/D134541
2022-09-28 12:30:34 +00:00
David Spickett c87f1f5bfb [LLDB][AArch64] Move instruction emulation to optional GetRegisterInfo
Depends on D134539

Reviewed By: clayborg

Differential Revision: https://reviews.llvm.org/D134540
2022-09-28 12:26:50 +00:00
Louis Dionne ee8dd43c24 [libc++] Remove MSVC tests checked into the libc++ test suite
We should strive to have our own tests, except when there is overwhelming
value in using another standard library's existing tests. The reason is
that it ensures that implementations don't all start relying on the same
interpretation of the Standard.

The unique_ptr tests did not add any test coverage AFAICT, and the
forward_like tests were moved to the style used everywhere in the
libc++ test suite.

Note that I got to this because this actually broke a downstream
configuration where we use -ffreestanding. The signature of main()
was not consistent with the signature we (need to) use everywhere
in the test suite.

Differential Revision: https://reviews.llvm.org/D134767
2022-09-28 08:03:01 -04:00
liqinweng 1c62af3e23 [AARCH64][CostModel] Modified the cost of mask vector load/store
Reviewed By: david-arm

Differential Revision: https://reviews.llvm.org/D134413
2022-09-28 19:40:29 +08:00
Florian Hahn ed47bc8b58
[SCEVExpander] Remove dead Root argument from expandCodeForImpl (NFC).
The argument is unused and can be removed.
2022-09-28 12:08:36 +01:00
Carl Ritson 266b5dbc5d [AMDGPU] Add MIMG NSA threshold configuration attribute
Make MIMG NSA minimum addresses threshold an attribute that can
be set on a function or configured via command line.
This enables frontend tuning which allows increased NSA usage
where beneficial.

Reviewed By: foad

Differential Revision: https://reviews.llvm.org/D134780
2022-09-28 20:03:18 +09:00
David Spickett ebe71605fa [LLDB][MIPS] Move instruction emulation to optional GetRegisterInfo
Depends on D134538

Reviewed By: clayborg

Differential Revision: https://reviews.llvm.org/D134539
2022-09-28 10:59:47 +00:00
David Spickett 0a339b3aeb [LLDB][ARM] Move instruction emulation to optional GetRegisterInfo
Depends on D134537

Reviewed By: clayborg

Differential Revision: https://reviews.llvm.org/D134538
2022-09-28 10:53:22 +00:00
liqinweng 0516ad8706 [RISCV] Add and update reverse mask tests, NFC
Reviewed By: Jimerlife

 Differential Revision: https://reviews.llvm.org/D134520
2022-09-28 18:44:46 +08:00
David Spickett 247714f0a6 [LLDB] Move MIPS64/PPC64 and misc. to optional GetRegisterInfo
Depends on D134536

Reviewed By: clayborg

Differential Revision: https://reviews.llvm.org/D134537
2022-09-28 10:36:31 +00:00
Florian Hahn 2b23a58924
[LoopDeletion] Forget block and loop dispositions after deleting loop.
After deleting a loop, the block and loop dispositions need to be
cleared. As we don't know which SCEVs in the loop/blocks may be
impacted, completely clear the cache. This should also fix some cases
where deleted loops remained in the LoopDispositions cache.

This fixes a verification failure surfaced by D134531.

Reviewed By: mkazantsev

Differential Revision: https://reviews.llvm.org/D134613
2022-09-28 11:33:43 +01:00
Hui Xie 83ead2bbc5 [libc++] implement "pair" section of P2321R2 `zip`
Differential Revision: https://reviews.llvm.org/D131495
2022-09-28 11:24:54 +01:00
Simon Pilgrim 926ccfef03 [SLP] ScalarizationOverheadBuilder - demand all elements for scalarization if the extraction index is unknown / out of bounds
Workaround for a chromium bug reported on D134605 - test case will be added later
2022-09-28 11:03:37 +01:00
Kristof Beyls 4f4c44c580 Document use of Co-author-by git tag.
We are already using the Co-author-by git tag, but don't have documentation in
our developer policy about it. Fix that.

Differential Revision: https://reviews.llvm.org/D134740
2022-09-28 12:00:20 +02:00
Alvin Wong 8a67a05e93 [lldb][COFF] Map symbols without base+complex type as 'Data' type
Both LLD and GNU ld write global/static variables to the COFF symbol
table with `IMAGE_SYM_TYPE_NULL` and `IMAGE_SYM_DTYPE_NULL` type. Map
these symbols as 'Data' type in the symtab to allow these symbols to be
used in expressions and printable.

Reviewed By: labath, DavidSpickett

Differential Revision: https://reviews.llvm.org/D134585
2022-09-28 12:57:12 +03:00
Alvin Wong acf7d08119 [lldb][COFF] Add note to forwarder export symbols in symtab
Forwarder exports do not point to a real function or variable. Instead
they point to a string describing which DLL and symbol to forward to.
Any imports which uses them will be redirected by the loader
transparently. These symbols do not have much use in LLDB, but keep them
just in case someone find it useful. Also set a synthesized name with
the forwarder string for informational purpose.

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D134518
2022-09-28 12:57:11 +03:00
Alvin Wong 7ebff6ab26 [lldb][COFF] Load absolute symbols from COFF symbol table
Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D134517
2022-09-28 12:57:11 +03:00
Alvin Wong 20c2f94c3c [lldb][COFF] Match symbols from COFF symbol table to export symbols
If a symbol is the same as an export symbol, mark it as 'Additional' to
prevent the duplicated symbol from being repeated in some commands (e.g.
`disas -n func`). If the RVA is the same but exported with a different
name, only synchronize the symbol types.

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D134426
2022-09-28 12:57:11 +03:00
Alvin Wong 0870afc68e [lldb][COFF] Improve info of symbols from export table
- Skip dummy/invalid export symbols.
- Make the export ordinal of export symbols visible when dumping the
  symtab.
- Stop setting the 'Debug' flag and set the 'External' flag instead to
  better match the meaning of export symbols.
- Try to guess the type (code vs data) of the symbol from section flags.

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D134265
2022-09-28 12:57:10 +03:00
Alvin Wong bf0cda9ed2 [lldb][COFF] Rewrite ParseSymtab to list both export and symbol tables
This reimplements `ObjectFilePECOFF::ParseSymtab` to replace the manual
data extraction with what `COFFObjectFile` already provides. Also use
`SymTab::AddSymbol` instead of resizing the SymTab then assigning each
elements afterwards.

Previously, ParseSymTab loads symbols from both the COFF symbol table
and the export table, but if there are any entries in the export table,
it overwrites all the symbols already loaded from the COFF symbol table.
Due to the change to use AddSymbols, this no longer happens, and so the
SymTab now contains all symbols from both tables as expected.

The export symbols are now ordered by ordinal, instead of by the name
table order.

In its current state, it is possible for symbols in the COFF symbol
table to be duplicated by those in the export table. This behaviour will
be modified in a separate change.

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D134196
2022-09-28 12:57:10 +03:00
Simon Pilgrim 759bedade5 Fix MSVC "not all control paths return a value" warning. NFCI. 2022-09-28 10:56:37 +01:00
wanglei 983a0ae5cf [LoongArch] Specify registers used in DWARF exception handling
Defines LoongArch registers for getExceptionPointerRegister() and
getExceptionSelectorRegister().

Differential Revision: https://reviews.llvm.org/D134709
2022-09-28 17:53:16 +08:00
River Riddle c1e27d2989 [vscode-mlir] Bump to version 0.0.11
Since version 0.10 we've:

* Added support for viewing/editing bytecode files
2022-09-28 02:50:24 -07:00
Muhammad Omair Javaid b816895b0e [LLVM] Fix GetErrcMessages.cmake module for WoA
GetErrcMessages.cmake module makes use of cmake's try_run which by
default builds its sources in debug mode unless configured with
CMAKE_TRY_COMPILE_CONFIGURATION. Debug builds on Windows sometimes fail
when appropraite DLLs are not included in path. Also on Windows on Arm
machines debug builds sometimes fail to link the correct debug DLLs.

To fix this I am setting CMAKE_TRY_COMPILE_CONFIGURATION to active build
configuration of currently configured LLVM project. This makes sure we
select same build type for try_run/try_compile cmake modules as
currently configured LLVM project.

Reviewed By: zero9178

Differential Revision: https://reviews.llvm.org/D133482
2022-09-28 14:41:09 +05:00
Igor Kirillov 2d60d7ba1a [LoopVectorize][Fix] Crash when invariant store address is calculated inside loop
Fixes 

Generally LICM pass is responsible for sinking out code that calculates
invariant address inside loop as it only needed to be calculated once.
But in rare case it does not happen we will not be vectorizing the
loop.

Differential Revision: https://reviews.llvm.org/D133687
2022-09-28 10:33:50 +01:00
jacquesguan 465ac0b96e [LegalizeTypes] Use getVectorElementCount to avoid crash of scalable vector.
Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D134718
2022-09-28 17:31:29 +08:00
Cullen Rhodes 3918ef07c4 [AArch64][SVE] Remove redundant ptest after match/nmatch
These instructions are flag setting so the ptest is redundant, the
TableGen class wasn't setting the element size for the predicate causing
the checks in AArch64InstrInfo::optimizePTestInstr to fail.
2022-09-28 08:23:23 +00:00
Cullen Rhodes e36ffdf42e [AArch64][SVE] Precommit tests for redundant ptest after match/nmatch 2022-09-28 08:23:23 +00:00
Christian Sigg 720dd814ba [MLIR] Fix after 4b27825.
The 'RUN' command was missing the input file argument.
2022-09-28 10:15:41 +02:00
River Riddle 1e6905f13d [TableGen] Only track reference locations if asked
Normal compilation doesn't care about tracking references,
and shouldn't pay the compilation time cost.
2022-09-28 00:47:57 -07:00
Chenbing Zheng 8346f7e84b [InstCombine] Add one more test for shl_trunc_icmp. nfc 2022-09-28 15:39:52 +08:00
Fraser Cormack daf51682b4 [RISCV] Rename vp.ceil test functions
These look like they were copy/pasted from vfabs-vp.ll

Reviewed By: eopXD

Differential Revision: https://reviews.llvm.org/D134789
2022-09-28 08:13:22 +01:00
Vitaly Buka 8410823835 [test][StackLifetime] Add simple cycle test 2022-09-28 00:11:06 -07:00
Fangrui Song 62e7c5b4e2 Revert "[ELF] --pack-dyn-relocs=android: scan relocation serially after D133003"
This reverts commit bce6416775.

The workaround is unneeded after 7dac9f4e48.
2022-09-28 07:06:49 +00:00