Commit Graph

437253 Commits

Author SHA1 Message Date
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 #57572

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
Fangrui Song 7dac9f4e48 [ELF] Make --pack-dyn-relocs=android compatible with parallel relocation scanning 2022-09-28 06:58:58 +00:00
River Riddle f90c2acb5d [mlir:LSP] Add bullet for tablegen hover in the vscode section
This allows hover documentation to show up in the vscode extension.
2022-09-27 23:57:00 -07:00
Siva Chandra Reddy 3367539010 [libc] Add implementation of pthread_once.
The existing thrd_once function has been refactored so that the
implementation can be shared between thrd_once and pthread_once
functions.

Reviewed By: michaelrj

Differential Revision: https://reviews.llvm.org/D134716
2022-09-28 06:54:48 +00:00
River Riddle 18f954e715 [mlir:LSP] Add a doc blurb for bytecode editing support
This was missed when bytecode support was originally added.
2022-09-27 23:48:17 -07:00
River Riddle 99e24123e9 [TableGen:LSP] Resolve "go-to-def" on a let field to the base definition
This allows for go-to-def on the a `let` field to resolve to the definition
of the base class. This is kind of like how C++ works with go-to-def
from use->def->decl, with the decl in this case being the base definition
of the field.

Differential Revision: https://reviews.llvm.org/D134264
2022-09-27 23:48:16 -07:00
River Riddle 3e2ad37679 [TableGen:LSP] Add hover support for records and recordvals
This provides hover information for classes, defs, fields, and template
arguments. Like PDLL, this pulls documentation from the source code
when hovering over fields and records.

Differential Revision: https://reviews.llvm.org/D134259
2022-09-27 23:48:16 -07:00
River Riddle 50d96f59d0 [TableGen] Track reference locations of Records/RecordVals
This is extremely useful for language tooling as it allows
for providing go-to-def/find-references/etc. for many
more situations than what is currently possible.

Differential Revision: https://reviews.llvm.org/D134087
2022-09-27 23:48:16 -07:00
jacquesguan 67bce07964 [RISCV][NFC] Add test for extractelt of vector types that should be split.
Reviewed By: reames

Differential Revision: https://reviews.llvm.org/D134720
2022-09-28 14:43:57 +08:00
Tobias Hieta 12ba7f27b8
[Release] Add bump-version script.
There are many files that needs to be updated when you
bump the version of LLVM. This script tries to automate
that in order to make the release managers job easier.

Reviewed By: kwk, hans, ldionne

Differential Revision: https://reviews.llvm.org/D133923
2022-09-28 08:41:29 +02:00
Jean Perier 9fc79ae628 [flang] Move main variables static promotion from lowering into IsSaved
Currently, lowering is promoting main program array and character
variables that are not saved into static memory.

This causes issues with equivalence initial value images because
semantics is relying on IsSaved to build the initial value of variables
in static memory. It seems more robust to have IsSaved be the place
deciding if a variable needs to be in static memory (except for common
block members).

Move the logic to decide if a main program variable must be in static
memory into evaluate::IsSaved and add two options to semantics to
replace the llvm options that were used in lowering:
 - SaveMainProgram (off by default): save all main program variables.
 - SaveBigMainProgramVariables (on by default): save all main program
   variables that are bigger than 32 bytes.

The first options is required to run a few old programs that expect all
main program variables to be in bss (and therefore zero initialized).

The second option is added to allow performance testing: placing big
arrays in static memory seems a sane default to avoid blowing up the
stack with old programs that define big local arrays in the main
program, but since it is easier to prove that an alloca does not
escape/is not modified by calls, keeping big arrays on the stack could
yield improvements.

The logic of SaveBigMainProgramVariables is slightly changed compared to what
it was doing in lowering. The old code was placing all arrays and all
explicit length characters in static memory.
The new code is placing everything bigger than 32 bytes in static
memory. This has the advantages of being a simpler logic, and covering
the cases of scalar derived type with big array components or many
components. Small strings and arrays are now left on the stack (after
all, a character(1) can fit in register).

Note: I think it could have been nicer to add a single "integer" option
to set a threshold to place main program variables in static memory so
that this can be fine tuned by the drivers (SaveMainProgram would be
implemented by setting it to zero). But the language feature options are
not meant to carry integer options. Extending it for this seems an
overkill precedent, and placing it in SemanticsContext is weird (it is
a too low level option to be a bare member of SemanticsContext in my
opinion). So I just rolled my own dices and picked 32 for the sake of
simplicity.

Differential Revision: https://reviews.llvm.org/D134735
2022-09-28 08:37:22 +02:00
Serge Pavlov 5ddde5f80a Revert "[Support] Class for response file expansion (NFC)"
This reverts commit 6e491c48d6.
There are missed changes in flang.
2022-09-28 13:33:28 +07:00
Christian Sigg 0a14f73126 [Bazel] NFC: Move ParseUtilities.h from 'hdrs' to 'srcs'.
This is slightly cleaner.
2022-09-28 08:30:08 +02:00
Vitaly Buka 07cf1a25a3 [NFC][StackLifetime] Rename local variable
The next patch will require more generic name.
2022-09-27 23:25:39 -07:00
Christian Sigg 39bf517e01 [Bazel] Fix after 4b27825ba3. 2022-09-28 08:18:30 +02:00
Vitaly Buka fee1a4aa59 [test][StackLifetime] Add new test created debugging an issue
The issue is not confirmened, but tests can stay.
2022-09-27 23:13:43 -07:00
Vitaly Buka c1bf3df576 [NFC][StackLifetime] Remove local variable 2022-09-27 23:07:03 -07:00
Serge Pavlov 6e491c48d6 [Support] Class for response file expansion (NFC)
Functions that implement expansion of response and config files depend
on many options, which are passes as arguments. Extending the expansion
requires new options, it in turn causes changing calls in various places
making them even more bulky.

This change introduces a class ExpansionContext, which represents set of
options that control the expansion. Its methods implements expansion of
responce files including config files. It makes extending the expansion
easier.

No functional changes.

Differential Revision: https://reviews.llvm.org/D132379
2022-09-28 11:47:59 +07:00
Jun Zhang 89e56e732d
[Clang] Don't warn if deferencing void pointers in unevaluated context
After https://reviews.llvm.org/D134461, Clang will diagnose a warning if
trying to deference void pointers in C mode. However, this causes a lot
of noises when compiling a 5.19.11 Linux kernel.

This patch reduces the warning by marking deferencing void pointers in
unevaluated context OK, like `sizeof(*void_ptr)`, `typeof(*void_ptr)`
and etc.

Fixes https://github.com/ClangBuiltLinux/linux/issues/1720

Signed-off-by: Jun Zhang <jun@junz.org>

Differential Revision: https://reviews.llvm.org/D134702
2022-09-28 12:30:02 +08:00
eopXD eb53416d0f [LangRef][Doc] Fix warning for too short title underline 2022-09-27 19:53:28 -07:00
eopXD 9677d70eb2 [VP][RISCV] Add vp.floor, vp.round, vp.roundeven and their RISC-V support
Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D134759
2022-09-27 19:45:58 -07:00
gonglingqin 95d2367647 [LoongArch] Expand FSIN/FCOS/FSINCOS/FPOW/FREM
Differential Revision: https://reviews.llvm.org/D134628
2022-09-28 09:42:41 +08:00
Anlun Xu fad84c3dbe [mlir][sparse] Support sparse2sparse collapse for dynamic sizes
This patch implements sparse2sparse collapse for operands with dynamic shape.

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D131599
2022-09-27 18:40:59 -07:00
Haowei Wu a759477222 Revert "[clang-doc] Add typedef/using information."
This reverts commit eed22583fd, which
breaks clang build with -Werror.
2022-09-27 18:35:34 -07:00
Florian Mayer 979db5343f [HWASan] [NFC] use auto* over auto& for pointers 2022-09-27 18:19:25 -07:00
rkayaith 4b27825ba3 [mlir-opt] Support parsing operations other than 'builtin.module' as top-level
This adds a `--no-implicit-module` option, which disables the insertion
of a top-level `builtin.module` during parsing. In this mode any op may
be top-level, however it's required that there be exactly one top-level
op in the source.

`parseSource{File,String}` now support `Operation *` as the container op
type, which disables the top-level-op-insertion behaviour.

Following patches will add the same option to the other tools as well.

Depends on D133644

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D133645
2022-09-27 21:13:47 -04:00
rkayaith 7e22179d38 [mlir-opt] Delay pass manager creation until after parsing
Currently the pass manager is created before parsing, which requires an
assumption that the top-level operation will be `builtin.module`.
Delaying the creation allows for using the parsed top-level operation as
the PassManager operation instead.

A followup change will allow for parsing top-level operations other than
`builtin.module`.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D133644
2022-09-27 20:34:20 -04:00
Han-Kuan Chen c595c874cb [RISCV] Lower BUILD_VECTOR to RISCVISD::VID_VL if it is floating-point type.
Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D133688
2022-09-27 17:25:34 -07:00
Nico Weber 697550ac2a [gn build] re-add hlsl.h after e432108bf2 2022-09-27 20:16:56 -04:00
Nemanja Ivanovic f0ec83eb0a [PowerPC][NFC] Pre-commit test case for an upcoming atomics patch
Just a new test case with auto generated checks.
2022-09-27 18:52:41 -05:00
Lang Hames 9eefc9a0c5 [llvm-jitlink] Remove stray global.
This was accidentally introduced in an earlier commit.
2022-09-27 16:46:58 -07:00
Yuanfang Chen c4b79bf083 Fix the test added in 55cd5bc509
It is hard to test the functionality for multiple platforms. Just test it
on Linux as similar patches did in the past.
2022-09-27 16:42:55 -07:00
Aart Bik a3610359b5 [mlir][sparse] change memref argument to proper SSA components
The indices for insert/compress were previously provided as
a memref<?xindex> with proper rank, since that matched the
argument for the runtime support libary better. However, with
proper codegen coming, providing the indices as SSA values
is much cleaner. This also brings the sparse_tensor.insert
closer to unification with tensor.insert, planned in the
longer run.

Reviewed By: Peiming

Differential Revision: https://reviews.llvm.org/D134404
2022-09-27 16:37:37 -07:00
Brett Wilson eed22583fd [clang-doc] Add typedef/using information.
Read typedef and "using" type alias declarations and serialize into the internal structures. Emit this information in the YAML output. The HTML and MD generators are unchanged.

Separate out the logic to create the parent namespace or record object and insert the newly created child into it. This logic was previously duplicated for every "info" type and is now shared.

To help this, a struct containing the child vectors was separated out so children can be added generically and without having too many templates.

A small change was made to populateParentNamespaces() to allow using types that aren't themselves DeclContexts (typedefs are the first example of this).

Reviewed By: paulkirth, haowei

Differential Revision: https://reviews.llvm.org/D134371
2022-09-27 23:35:16 +00:00
Brett Wilson 0afc60858e [clang-doc] Clean up *Info constructors.
The *Info object (for the copy of the AST") constructors had many duplicated variants. Many of the variants seemed to be in an attempt to avoid default arguments. But default arguments are not prohibited and using them allows most of the variants to be removed which improves readability.

Remove the IsInGlobalNamespace flag on a Reference. This is set when the path is empty, and only read once in the HTML generator with the identical condition. The constructor cleanup exposed a problem where this was set to false when the constructor with no path was used, but true when the path was set to empty.

There should be no observable change with the exception that IsInGlobalNamespace is no longer emitted in YAML.

Reviewed By: paulkirth, haowei

Differential Revision: https://reviews.llvm.org/D134235
2022-09-27 23:31:41 +00:00
Jason Molenda 1fee25629d Clear old section-to-addr entry when loading Section at new addr
SectionLoadList has a section-to-address map (m_sect_to_addr) and
an address-to-section map (m_addr_to_sect).  When the load address
of a section is updated, the old entry from m_addr_to_sect would
never be cleared, resulting in incorrect address-to-section address
lookups from that point forward.

Differential Revision: https://reviews.llvm.org/D130534
rdar://97308773
2022-09-27 16:20:26 -07:00