Commit Graph

411803 Commits

Author SHA1 Message Date
Dominik Grewe 1e09f0a972 Preserve function argument locations.
Previously the optional locations of function arguments were dropped in
`parseFunctionArgumentList`. This CL adds another output argument to the
function through which they are now returned. The values are then plumbed
through as an array of optional locations in the various places.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D117604
2022-01-20 00:01:12 +00:00
River Riddle d75c3e8396 [mlir] Don't print `// no predecessors` on entry blocks
Entry blocks can never have predecessors, so this is unnecessary.

Fixes #53287

Differential Revision: https://reviews.llvm.org/D117713
2022-01-19 15:57:58 -08:00
Lang Hames fabbe8d5fd [ORC] Fix typo in comment. 2022-01-20 10:55:31 +11:00
Mehdi Amini 4b12f4b2b1 Fix crash in MLIR opaque attribute parser
An assertion is triggered when the dialect is malformed.

Differential Revision: https://reviews.llvm.org/D117709
2022-01-19 23:35:48 +00:00
Adrian Prantl 24bc072edb Fix modules build by moving implementation into .cpp file 2022-01-19 15:33:59 -08:00
Konstantina c7b71acef2 [AMDGPU][NFC] Add autogenerated tests for vgpr-tuple-allocation.ll
Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D117692
2022-01-19 15:06:16 -08:00
Richard 058d212379 [clang-tidy] Use literal block instead of code block (NFC)
I used a C++ code block in check documentation to show example
output from clang-tidy, but since the example output isn't
kosher C++, sphinx didn't like that when it went to syntax
highlight the block.  So switch to a literal block instead
and forego any highlighting.

Fixes build error
<https://lab.llvm.org/buildbot/#/builders/115/builds/21145>
2022-01-19 15:23:48 -07:00
Jonas Devlieghere 742bfb3581 [lldb] Fix LLDB_FULL_VERSION_STRING
Currently LLDB_FULL_VERSION_STRING is set to "LLDB_VERSION_STRING"
rather than the content of the CMake variable with that name.
2022-01-19 14:20:22 -08:00
Siva Chandra Reddy 75d2fcb03f [libc] Add a naming rule for global constants.
Reviewed By: michaelrj

Differential Revision: https://reviews.llvm.org/D117645
2022-01-19 22:11:16 +00:00
Jon Chesterfield ce8f365884 [openmp] Always pass valid triple to openmp-targets when using newRTL
Previously, we sometimes pass fopenmp-targets=nvptx64-nvidia-cuda-newRTL

Reviewed By: jhuber6

Differential Revision: https://reviews.llvm.org/D117715
2022-01-19 22:07:22 +00:00
John Ericson 429a717ea5 [cmake] Move HandleOutOfTreeLLVM to common cmake utils
This is better than libunwind and libcxxabi fishing it out of libcxx's
module directory.

It is done in prepartion for a better version of D117537 which deduplicates
CMake logic instead of just renaming to avoid a name clash.

Reviewed By: phosek, #libunwind, #libc_abi, Ericson2314

Differential Revision: https://reviews.llvm.org/D117617
2022-01-19 22:05:23 +00:00
Luís Marques a767ae2c5c [RISCV] Fix incomplete asm statement parsing
For instructions without operands, the final `AsmToken::EndOfStatement`
wasn't being consumed. In the context of inline assembly, the resulting
empty statements would cause extraneous empty lines to be emitted. Fix
the issue by consuming the `EndOfStatement` token.

Differential Revision: https://reviews.llvm.org/D117565
2022-01-19 21:56:21 +00:00
Eli Friedman 86cdff0e21 [OpenMPOpt] Use SetVector to store list of kernels.
Fixes test failures on reverse-iteration buildbot.
2022-01-19 13:55:32 -08:00
Luís Marques 771613295d [docs][lli] Fix lli rst docs formatting
Differential Revision: https://reviews.llvm.org/D109092
2022-01-19 21:54:15 +00:00
Keith Smiley 3f38dc5c04 [lld-macho] Silence XAR deprecation warning
If you're building this on macOS 12.x+ this produces a deprecation
warning. I'm not sure what this means for the bitcode format going
forward, but it seems safe to silence for now.

Do we need to worry about GCC for this?

Differential Revision: https://reviews.llvm.org/D117718
2022-01-19 13:51:55 -08:00
Keith Smiley 67090e3446 [lld-macho] Implement -noall_load
This flag is the default, so in ld64 it is not implemented, but it can
be useful to negate previous -all_load arguments. Specifically if your
build system has some global linker flags, that you may want to negate
for specific links. We use something like this today to make sure some
C++ symbols are automatically discovered for all links, which passing
-all_load hides.

Differential Revision: https://reviews.llvm.org/D117629
2022-01-19 13:12:18 -08:00
Mehdi Amini e7ab36f191 Change elided large constant syntax to make it more explicit
When the printer is requested to elide large constant, we emit an opaque
attribute instead. This patch fills the dialect name with
"elided_large_const" instead of "_" to remove some user confusion when
they later try to consume it.

Differential Revision: https://reviews.llvm.org/D117711
2022-01-19 20:41:42 +00:00
Fangrui Song 5bd38a2826 [ELF] Fix split-stack caller with hidden non-split-stack callee
Fix a regression after aabe901d57 (`[ELF] Remove
one redundant computeBinding`): isLocal() does not indicate that the symbol is
originally local. For simplicity, just drop this optimization.
2022-01-19 12:25:01 -08:00
Stella Stamenova 438f805145 [mlir] Configure mlir so that it can be directly included in a parent cmakelists.txt
The goal is to allow a project to directly include the `CMakeLists.txt` of mlir via something such as `add_directory`. This currently doesn't work because the exported targets then end up being imported in the same top-level project and `cmake` is not happy. LLVM works around this by guarding the exports based on the existence of the `LLVMSupport` library. This change does the same using `MLIRSupport`. In our experience, no targets need to be added to the export in the case.

If there's a preferred way of doing this or a better lib to use as the main target to check for, please let me know.

Reviewed By: stellaraccident

Differential Revision: https://reviews.llvm.org/D117599
2022-01-19 12:02:22 -08:00
Mircea Trofin 073e09683d Fix build break introduced by D117147 2022-01-19 11:43:51 -08:00
Casey Carter 3a1b178a0b [libcxx][test] Portably test that `{w,}format_context` is a specialization of `basic_format_context`
Differential Revision: https://reviews.llvm.org/D117606
2022-01-19 11:36:29 -08:00
Richard d83ecd77cc [clang-tidy] Narrow cppguidelines-macro-usage to actual constants
Previously, any macro that didn't look like a varargs macro
or a function style macro was reported with a warning that
it should be replaced with a constexpr const declaration.
This is only reasonable when the macro body contains constants
and not expansions like ",", "[[noreturn]]", "__declspec(xxx)",
etc.

So instead of always issuing a warning about every macro that
doesn't look like a varargs or function style macro, examine the
tokens in the macro and only warn about the macro if it contains
only comment and constant tokens.

Differential Revision: https://reviews.llvm.org/D116386

Fixes #39945
2022-01-19 12:28:22 -07:00
wren romano c4017f9d0c [mlir][sparse] Simplifying assertions in fromCOO
Hoisting invariant assertions to the top

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D117408
2022-01-19 11:25:41 -08:00
natashaknk b9b10c0e61 [tosa][mlir] Lowering for dynamic shapes in the reduce_x ops in tosa-to-linalg
Reviewed By: rsuderman

Differential Revision: https://reviews.llvm.org/D117691
2022-01-19 11:15:14 -08:00
Joseph Huber a9935b5db7 [openmp] Unconditionally set march commandline argument
Extracted from D117246. This reflects the march value used by the
compile back into the toolchain arguments, letting downstream processes
such as LTO rely on it being present. Subsequent patches should also be able
to remove the two other calls to checkSystemForAMDGPU.

Reviewed By: jonchesterfield

Differential Revision: https://reviews.llvm.org/D117706
2022-01-19 19:14:47 +00:00
Vladislav Khmelevsky bb8e7ebaad [BOLT] Remove unreachable uncond branch after return
This patch fixes the removal of unreachable uncondtional branch located
after return instruction.

Vladislav Khmelevsky,
Advanced Software Technology Lab, Huawei

Reviewed By: Amir

Differential Revision: https://reviews.llvm.org/D117677
2022-01-19 22:06:26 +03:00
Mircea Trofin e67430cca4 [MLGO] ML Regalloc Eviction Advisor
The bulk of the implementation is common between 'release' mode (==AOT-ed
model) and 'development' mode (for training), the main difference is
that in development mode, we may also log features (for training logs),
inject scoring information (currently after the Virtual Register
Rewriter) and then produce the log file.

This patch also introduces the score injection pass, 'Register
Allocation Pass Scoring', which is trivially just logging the score in
development mode.

Differential Revision: https://reviews.llvm.org/D117147
2022-01-19 11:00:32 -08:00
Wenlei He 7cca13bc3a [PartialInline] Bail out on asm-goto/callbr
Fixing ICE when partial inline tries to deal with blockaddress uses of function which is typical for asm-goto/callbr. We ran into this with PGO multi-region partial inline.

Differential Revision: https://reviews.llvm.org/D117509
2022-01-19 10:57:57 -08:00
Thomas Raoux d9edc1a585 [mlir][spirv] Add math.fma lowering to spirv
Differential Revision: https://reviews.llvm.org/D117704
2022-01-19 10:57:05 -08:00
Craig Topper 4060b81e76 [RISCV] Obey -riscv-v-fixed-length-vector-elen-max when lowering mask BUILD_VECTORs.
We may not be allowed to use vXiXLen vectors. Consult ELEN to
determine what is allowed. This will become even more important
when Zve32 is added.

Reviewed By: frasercrmck, arcbbb

Differential Revision: https://reviews.llvm.org/D117518
2022-01-19 10:47:37 -08:00
Jonas Devlieghere c167fa4a4f [dsymutil] Print the swift interface modification time in warning
The warning was printing the timestamp from the debug map twice rather
than both the file system modification time and debug map modification
time.

rdar://86036385

Differential revision: https://reviews.llvm.org/D117331
2022-01-19 10:44:13 -08:00
Yannic Bonenberger a01523ea99 [libc] improve error message for unsupported target platforms
Reviewed By: michaelrj

Differential Revision: https://reviews.llvm.org/D116888
2022-01-19 10:39:34 -08:00
Ellis Hoag ccb09a4889 Fix broken comment in InstrProfData.inc
This comment was introduced in https://reviews.llvm.org/D117631

Differential Revision: https://reviews.llvm.org/D117705
2022-01-19 10:38:13 -08:00
Nathan James a4bdeb9a56
[clang-tidy][NFC] replace some redundant std::string creations 2022-01-19 18:36:35 +00:00
Jean Perier 81c6693329 [flang] Prevent any non constant result extent to be inlined on caller side
UBOUND, SIZE, and SHAPE folding was still creating expressions that are
invalid on the caller side without the call expression context.
A previous patch intended to deal with this situation (https://reviews.llvm.org/D116933)
but it assumed the return expression would be a descriptor inquiry to
the result symbol, which is not the case if the extent expression is
"scope invariant" inside the called subroutine (e.g., referring to
intent(in) dummy arguments). Simply prevent folding from inlining non
constant extent expression on the caller side.

Folding could be later improved by having ad-hoc folding for UBOUND, SIZE, and
SHAPE on function references where it could try replacing the dummy symbols
by the actual expression, but this is left as a possible later improvement.

Differential Revision: https://reviews.llvm.org/D117686
2022-01-19 19:15:49 +01:00
Fangrui Song 0aae2bf373 [lld-macho] Add --start-lib --end-lib
In ld.lld, when an ObjFile/BitcodeFile is read in --start-lib state, the file is
given archive semantics. --end-lib closes the previous --start-lib. A build
system can use this feature as an alternative to archives. This patch ports
the feature to lld-macho.

--start-lib and --end-lib are positional, unlike usual ld64 options.
I think the slight drawback does not matter as (a) reusing option names
make build systems convenient (b) `--start-lib a.o b.o --end-lib` conveys more
information than an alternative design: `-objlib a.o -objlib b.o` because
--start-lib makes it clear which objects are in the same conceptual archive.
This provides flexibility (c) `-objlib`/`-filelist` interaction may be weird.

Close https://github.com/llvm/llvm-project/issues/52931

Reviewed By: #lld-macho, Jez Ng, oontvoo

Differential Revision: https://reviews.llvm.org/D116913
2022-01-19 10:14:49 -08:00
Richard Howell 4f61749e16 [clang] support relative roots to vfs overlays
This diff adds support for relative roots to VFS overlays. The directory root
will be made absolute from the current working directory and will be used to
determine the path style to use. This supports the use of VFS overlays with
remote build systems that might use a different working directory for each
compilation.

Reviewed By: benlangmuir

Differential Revision: https://reviews.llvm.org/D116174
2022-01-19 10:13:06 -08:00
Ellis Hoag 88d81770f1 [InstrProf] Restore InstrProfData.inc to fix Fuchsia builds
https://reviews.llvm.org/D116179 introduced some changes to
`InstrProfData.inc` which broke some downstream builds. This commit
reverts those changes since they only changes two field names.

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D117631
2022-01-19 10:10:58 -08:00
Petr Hosek fd0782a37b [DebugInfod] Prefix debuginfod cache directory
This prevents the debuginfod client from dumping files directly into the
default cache directory (e.g., ~/.cache). Instead, these files are
placed in a subdirectory (e.g., ~/.cache/llvm-debuginfod/client).
Behavior is unaffected if the cache directory is provided by the
DEBUGINFO_CACHE_PATH environment variable.

Patch By: mysterymath

Differential Revision: https://reviews.llvm.org/D117619
2022-01-19 10:09:00 -08:00
Peter Klausler f2dac557f5 [flang] Intrinsic assignment of distinct but "same" derived types
Subclause 7.5.2.4 lists conditions under which two distinct derived
types are to be considered the same type for purposes of argument
association, assignment, and so on.  These conditions are implemented
in evaluate::IsTkCompatibleWith(), but assignment semantics doesn't
use it for testing for intrinsic assignment compatibility.  Fix that.

Differential Revision: https://reviews.llvm.org/D117621
2022-01-19 10:08:17 -08:00
Yaxun (Sam) Liu 15f54dd5e4 AMDGPU: Account for usage HIP-style dynamic LDS
Disable promote alloca to LDS when HIP-style dynamic LDS since the size
is unknown at compile time.

Patch by: Siu Chi Chan

Reviewed by: Matt Arsenault, Yaxun Liu

Differential Revision: https://reviews.llvm.org/D117494
2022-01-19 13:05:29 -05:00
Fangrui Song d838bf2adc [ELF] Allow non-bitcode archive with an empty index
When an archive with an empty index contains only bitcode files, it is
handled as a group of lazy (--start-lib) object files. If there is a
non-bitcode file, there will be a diagnostic a la GNU ld.

For some programs, the archive member extraction ratio is high (e.g. for chrome,
79% archive members are extracted according to --print-archive-stats=). Because
symbol interning is cached for ObjFile::parseLazy but not for ArchiveFile,
parsing an archive as a group of --start-lib object files may be faster.

If the linker speculatively creates section representations for archive members,
the archive index will not be used.

If we take the above view, the archive index is essentially useless. If a user
wants a fast build without using --start-lib, they may just build thin archives
without index (`ar rcS --thin`).

Therefore, I suggest that we no longer treat the code as a hack, instead as a
supported feature. I believe we will do this anyway if we add parallel symbol
interning (parallel symbol interning for lazy object files is simpler than that
for archives).

Ecosystem issues:

* parseLazy actually has nearly the same behavior as ArchiveFile::parse, but the symbol order may be different.
* users may get addicted to the behavior and build archives not working with GNU ld and gold. I think it is easy to rebuild archives to be compatible.

Reviewed By: ikudrin

Differential Revision: https://reviews.llvm.org/D117284
2022-01-19 10:01:53 -08:00
Nicolas Vasilache d492a7b2ca [mlir][Linalg] Add a useLinalgCopy option to Linalg bufferization.
Benchmarks show that memref::CopyOp is curently up to 200x slower than
tiled and vectorized versions of linalg::Copy.
Add a temporary flag to allow comprehensive bufferize to generate a
linalg::GenericOp that implements a copy until this performance bug is
resolved.

Differential Revision: https://reviews.llvm.org/D117696
2022-01-19 13:00:11 -05:00
David Blaikie baa9b7c3c8 unique_ptrify the ModuleManager's VisitState linked list 2022-01-19 09:57:46 -08:00
Jonas Devlieghere eb5c0ea681 [lldb] Initialize Python exactly once
We got a few crash reports that showed LLDB initializing Python on two
separate threads. Make sure Python is initialized exactly once.

rdar://87287005

Differential revision: https://reviews.llvm.org/D117601
2022-01-19 09:56:55 -08:00
Yaxun (Sam) Liu 85c2bd2a0e Prevent adding module flag amdgpu_hostcall multiple times
HIP program with printf call fails to compile with -fsanitize=address
option, because of appending module flag - amdgpu_hostcall twice, one
for printf and one for sanitize option. This patch fixes that issue.

Patch by: Praveen Velliengiri

Reviewed by: Yaxun Liu, Roman Lebedev

Differential Revision: https://reviews.llvm.org/D116216
2022-01-19 12:52:33 -05:00
John Brawn 32842c1bc9 [CMake] Add explicit return to GetErrcMessages test program 2022-01-19 17:42:56 +00:00
Simon Pilgrim d6fee6c3b0 [DAG] SelectionDAG::computeKnownBits - add mul(x,x) self-multiply handling (PR48683)
Pass the SelfMultiply flag to KnownBits::mul() - added at D108992

https://alive2.llvm.org/ce/z/NN_eaR
2022-01-19 17:39:32 +00:00
Simon Pilgrim ce9f2ab0cc [X86] Add mul(x,x) self-multiply known bits test coverage (PR48683)
D108992 added self-multiply handling to KnownBits::mul but we don't use it yet..
2022-01-19 17:39:32 +00:00
Fraser Cormack 5fa826f4e2 [RISCV] Test expected inst opcode in sink-splat test
The function's name suggests it should be testing 'sub' rather than
'add'. We test 'add' in an earlier test so we're not losing any coverage
here.
2022-01-19 17:18:24 +00:00