Commit Graph

411630 Commits

Author SHA1 Message Date
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
zhijian 3062a1469d [AIX] identify big archive magic as archive.
Summary:

  identify big archive magic as archive.

Reviewers: Hubert Tong
Differential Revision: https://reviews.llvm.org/D117511
2022-01-19 12:18:45 -05:00
John Ericson 5ad96992ef [mlir][cmake] Use `GNUInstallDirs` to support custom installation dirs
I am breaking apart D99484 so the cause of build failures is easier to
understand.

Differential Revision: https://reviews.llvm.org/D117540
2022-01-19 17:11:04 +00:00
Alex Zinenko 89a92fb3ba [mlir] Rework subclass construction in PybindAdaptors.h
The constructor function was being defined without indicating its "__init__"
name, which made it interpret it as a regular fuction rather than a
constructor. When overload resolution failed, Pybind would attempt to print the
arguments actually passed to the function, including "self", which is not
initialized since the constructor couldn't be called. This would result in
"__repr__" being called with "self" referencing an uninitialized MLIR C API
object, which in turn would cause undefined behavior when attempting to print
in C++. Even if the correct name is provided, the mechanism used by
PybindAdaptors.h to bind constructors directly as "__init__" functions taking
"self" is deprecated by Pybind. The new mechanism does not seem to have access
to a fully-constructed "self" object (i.e., the constructor in C++ takes a
`pybind11::detail::value_and_holder` that cannot be forwarded back to Python).

Instead, redefine "__new__" to perform the required checks (there are no
additional initialization needed for attributes and types as they are all
wrappers around a C++ pointer). "__new__" can call its equivalent on a
superclass without needing "self".

Bump pybind11 dependency to 3.8.0, which is the first version that allows one
to redefine "__new__".

Reviewed By: stellaraccident

Differential Revision: https://reviews.llvm.org/D117646
2022-01-19 18:09:05 +01:00
Jakob Bornecrantz bfed654e98 [LLVM-C] Use NameLen in LLVMGetNamedGlobalAlias
I tried to look over the file and didn't see any other non-use of *Len variables.

Reviewed By: deadalnix

Differential Revision: https://reviews.llvm.org/D116482
2022-01-19 08:58:57 -08:00
Stefan Pintilie 1324bb29f7 [PowerPC] Fix issue with strict float to int conversion.
When doing the float to int conversion the strict conversion also needs to
retun a chain. This patch fixes that.

Reviewed By: nemanjai, #powerpc, qiucf

Differential Revision: https://reviews.llvm.org/D117464
2022-01-19 10:57:22 -06:00
Nico Weber cc639dde8c [gn build] port c22329972f (lldb REPL/Clang)
Fixes `lldb-shell :: REPL/Basic.test` in the gn build, making
check-lldb pass (on Linux) again.
2022-01-19 11:32:53 -05:00
Arnamoy Bhattacharyya 9fbd33ad62 [OMPIRBuilder] Add support for simd (loop) directive.
This patch adds OMPIRBuilder support for the simd directive (without any clause).  This will be a first step towards lowering simd directive in LLVM_Flang.  The patch uses existing CanonicalLoop infrastructure of IRBuilder to add the support.  Also adds necessary code to add llvm.access.group and llvm.loop metadata wherever needed.

Reviewed By: Meinersbur

Differential Revision: https://reviews.llvm.org/D114379
2022-01-19 11:32:17 -05:00
Stanislav Gatev 8e53ae3d37 [clang][dataflow] Add a transfer function for conditional operator
This is part of the implementation of the dataflow analysis framework.
See "[RFC] A dataflow analysis framework for Clang AST" on cfe-dev.

Reviewed-by: xazax.hun

Differential Revision: https://reviews.llvm.org/D117667
2022-01-19 16:25:05 +00:00
Nico Weber 7260a926cf [gn build] link lldb-vscode against ws2_32.lib
Necessary after aaa50e54e6.
2022-01-19 11:06:55 -05:00
Masoud Ataei d261660af9 Fix the use of -fno-approx-func along with -Ofast or -ffast-math
Fix how -fapprox-func interact correctly with the other floating point options.
Reported bug Number 52565: https://bugs.llvm.org/show_bug.cgi?id=52565

Differential: https://reviews.llvm.org/D114564
Reviewer: @andrew.w.kaylor
2022-01-19 08:05:08 -08:00
Lukáš Zaoral 14a793ab05 [lit] Fix compatibility with upstream gtest
Upstream gtest now prints 'Running main() from FILE' instead of
plain 'Running main() from gtest_main.cc'. Thus, all such tests
ended-up being mistakenly marked as UNRESOLVED.

Patch by @lzaoral

Differential Revision: https://reviews.llvm.org/D100043
2022-01-19 08:02:28 -08:00
Jon Chesterfield 8baf4ba890 [openmp][amdgpu] Remove xfail from test using declare target variable 2022-01-19 15:55:37 +00:00
Nico Weber aaa50e54e6 [gn build] port b2a162e63b (liblldb.dll)
This requires making liblldb a dll on Windows.
Things still work with a static lib on non-Windows, so keep it a
static lib there for now.
2022-01-19 10:50:08 -05:00
Jon Chesterfield ca84c43d69 [openmp][amdgpu] Disable tests on old runtime, enable tests on new one 2022-01-19 15:49:47 +00:00
Matt Arsenault 052503979e AMDGPU/GlobalISel: Fix introducing f16 fmed3 for gfx8 2022-01-19 10:43:21 -05:00
Pavel Labath 4f89157b9d [lldb] Make StatsDuration thread-safe
std::chrono::duration types are not thread-safe, and they cannot be
concurrently updated from multiple threads. Currently, we were doing
such a thing (only) in the DWARF indexing code
(DWARFUnit::ExtractDIEsRWLocked), but I think it can easily happen that
someone else tries to update another statistic like this without
bothering to check for thread safety.

This patch changes the StatsDuration type from a simple typedef into a
class in its own right. The class stores the duration internally as
std::atomic<uint64_t> (so it can be updated atomically), but presents it
to its users as the usual chrono type (duration<float>).

Differential Revision: https://reviews.llvm.org/D117474
2022-01-19 16:42:53 +01:00
Jon Chesterfield e35c8f541c [openmp][amdgpu] Temporarily disable tests on old runtime 2022-01-19 15:39:00 +00:00
Fraser Cormack b8cb79404b [LangRef] Mangle all vector operands in insert/extract intrinsics
This better matches the canonical mangling of these intrinsics.

Reviewed By: peterwaller-arm

Differential Revision: https://reviews.llvm.org/D117675
2022-01-19 15:23:15 +00:00
Matt Arsenault adab71711e AMDGPU/GlobalISel: Fix legalize failure on i65 ctpop 2022-01-19 10:26:28 -05:00
Jay Foad 63eea41de6 [AMDGPU] Simplify SILoadStoreOptimizer::getSubRegIdxs. NFC. 2022-01-19 15:20:35 +00:00
Matt Arsenault b965617ccc GlobalISel: Fix assert on unmerge to different element of casted vector
This was failing if a G_UNMERGE_VALUES produced a different element
type than the cast result type.
2022-01-19 10:13:31 -05:00
Matt Arsenault 7f26a1027f AMDGPU/GlobalISel: Introduce pseudo to copy sp in call sequences
Arbitrary stack pointers are accessed using MUBUF instructions with
the voffset field, which is interpreted as the swizzled address. We
want to fold fold into the MUBUF form to use the SP in the SGPR
offset, and previously we were special casing the interpretation of
the pointer value if the access memory operand said it was relative to
the stack pointer.

690f5b7a01 removed this check, and moved
the DAG path to special casing copies from SGPRs. This is not an
entirely sound approach, since it's still changing the interpretation
of pointer values based the context.

Introduce a new pseudo which corresponds to the wave-to-vector address
transform. This way the memory instruction has consistent semantics
where the incoming pointer is always interpreted as a vector address,
and we're not obligated to optimize into the MUBUF offset-only
addressing mode. The DAG should probably have an equivalent pseudo.

This should fix some correctness issues, and folding this into
addressing modes will be a future optimization patch.
2022-01-19 10:13:31 -05:00
Haojian Wu 55b702c37b [clangd] NFC, emit source ranges in selection debug messages.
It will make the output more versbose, but I found that these are useful
information when debugging selection tree.

Differential Revision: https://reviews.llvm.org/D117475
2022-01-19 16:06:58 +01:00