Mirko Brkusanin [Fri, 10 Mar 2023 12:29:33 +0000 (13:29 +0100)]
[AMDGPU][MachineVerifier] Fix vdata reg count for MIMG d16
Differential Revision: https://reviews.llvm.org/D145785
Nikita Popov [Fri, 10 Mar 2023 10:36:14 +0000 (11:36 +0100)]
[Clang] Convert some tests to opaque pointers (NFC)
Hans Wennborg [Fri, 10 Mar 2023 13:34:45 +0000 (14:34 +0100)]
Revert "[SLP]Initial support for reshuffling of non-starting buildvector/gather nodes."
This caused verifier errors:
Instruction does not dominate all uses!
%8 = insertelement <2 x i64> %7, i64 %pgocount1330, i64 1
%15 = shufflevector <2 x i64> %8, <2 x i64> poison, <2 x i32> <i32 1, i32 1>
in function ?NearestInclusiveAncestorAssignedToSlot@SlotScopedTraversal@blink@@SAPAVElement@2@ABV32@@Z
(or register allocator crash when the verifier was disabled).
See comment on the code review.
> Previously only the very first gather/buildvector node might be probed for reshuffling of other nodes.
> But the compiler may do the same for other gather/buildvector nodes too, just need to check the
> dependency and postpone the emission of the dependent nodes, if the origin nodes were not emitted yet.
>
> Part of D110978
>
> Differential Revision: https://reviews.llvm.org/D144958
This reverts commit
a611b3f3059e4c3b9e7b914091c3edaef099fd5d.
It also reverts
7a4061ae372b3262703ffeea3b64db89187db611 which depended on the above.
Krasimir Georgiev [Fri, 10 Mar 2023 13:08:36 +0000 (14:08 +0100)]
Revert "[Modules] Remove unnecessary check when generating name lookup table in ASTWriter"
This reverts commit
db987b9589be1eb604fcb74c85b410469e31485f.
We're seeing failures in modules-enabled builds from within stdlib after
this commit. Errors look like:
In module '...stl_cc_library':
...optional:560:38: error: 'std::__optional_copy_assign_base<unsigned
long>::__optional_copy_assign_base' from module '...optional' is not
present in definition of 'std::__optional_copy_assign_base<unsigned
long>' in module '...optional'
using __optional_move_base<_Tp>::__optional_move_base;
In module '...stl_cc_library':
...optional:771:11: error: no matching constructor for initialization of '__optional_move_assign_base<unsigned long>'
: __base(in_place, _VSTD::forward<_Up>(__v)) {}
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
llvm-project/clang/include/clang/Basic/CodeGenOptions.h:448:57: note: in instantiation of function template specialization 'std::optional<unsigned long>::optional<int, 0>' requested here
std::optional<uint64_t> DiagnosticsHotnessThreshold = 0;
I don't have a self-contained reproducer at this point. I'm hoping that
we may be able to share more information about these issues later, if
necessary.
Ricardo Jesus [Fri, 24 Feb 2023 10:51:39 +0000 (10:51 +0000)]
[AArch64] Fix N2 SchedModel for arithmetic and logic ops with cheap LSL
According to the N2 Software Optimization Guide, arithmetic ops with LSL
≤ 4, no flagset logical ops, and flagset logical ops with LSL = 0 have a
latency of 1 and use pipeline group I. However, most of these ops were
being modelled as having a latency of 2 and using pipeline M. The
affected instructions include the "unshifted" versions of ADD/SUB, among
others.
Differential Revision: https://reviews.llvm.org/D145370
Nikolas Klauser [Tue, 31 Jan 2023 18:23:30 +0000 (19:23 +0100)]
[libc++] Granularize <atomic> includes
Reviewed By: ldionne, Mordante, #libc
Spies: arichardson, libcxx-commits
Differential Revision: https://reviews.llvm.org/D144255
Michael Buch [Fri, 10 Mar 2023 12:16:30 +0000 (12:16 +0000)]
[lldb][test] TestInlineNamespaceAlias.py: skip on older compiler versions
This was failing with versions of clang that didn't support the
dsymutil (D143458) and llvm (D143397) changes that are needed for this test.
Remove unused parameters that we tried passing for the `dwarf` variant, which
is an NFC change. LLDB doesn't yet support `-gdwarf-5` debugging yet so
passing it to the `Makefile` would actually cause the test to fail.
Max Kazantsev [Fri, 10 Mar 2023 10:43:10 +0000 (17:43 +0700)]
[LICM] Support logical AND/OR when hoisting min/max
We can handle logical AND/OR in the same way as arithmetic AND/OR, it only
takes us freezing `RHS2` for which we may introduce a new use which didn't
exist before dynamically.
Differential Revision: https://reviews.llvm.org/D145771
Reviewed By: nikic
Haojian Wu [Fri, 10 Mar 2023 07:57:27 +0000 (08:57 +0100)]
[clangd] UnusedIncludes: Strict config now uses the include-cleaner-library implementation.
And remove the classical clangd-own unused-include implementation.
Differential Revision: https://reviews.llvm.org/D145773
Matthias Springer [Fri, 10 Mar 2023 10:25:15 +0000 (11:25 +0100)]
[mlir][NFC] reifyResultShapes: Add extra error checking
This change adds a new helper function `mlir::reifyResultShapes` that calls the corresponding interface method and also checks the result produced by the implementation when running in debug mode. Bugs due to incorrect interface implementations can be difficult to debug.
This helper function also reduces the amount of code needed at call sites: the cast to `ReifyRankedShapedTypeOpInterface` is done in the helper function.
Differential Revision: https://reviews.llvm.org/D145777
Matthias Springer [Fri, 10 Mar 2023 10:24:43 +0000 (11:24 +0100)]
[mlir][tensor/linalg] Fix bug in reifyResultShapes
`reifyResultShapes` should return an IntegerAttr if and only if the corresponding dimension is static.
Differential Revision: https://reviews.llvm.org/D145702
Max Kazantsev [Mon, 20 Feb 2023 10:24:49 +0000 (17:24 +0700)]
[LICM] Simplify (X < A && X < B) into (X < MIN(A, B)) if MIN(A, B) is loop-invariant
We don't do this transform in InstCombine in general case for arbitrary values, because cost of
AND and 2 ICMP's isn't higher than of MIN and ICMP. However, LICM also has a notion
about the loop structure. This transform becomes profitable if `A` and `B` are loop-invariant and
`X` is not: by doing this, we can compute min outside the loop.
Differential Revision: https://reviews.llvm.org/D143726
Reviewed By: nikic
Markus Böck [Fri, 10 Mar 2023 10:24:41 +0000 (11:24 +0100)]
Reland "[mlir] Enable opaque pointers in LLVM conversion passes by default"
This reverts commit
cdd914a959528cd7abf36c096b4a0644c1721214.
Max Kazantsev [Fri, 10 Mar 2023 10:15:00 +0000 (17:15 +0700)]
[Test] Rename some negative tests into positive with required freeze
In fact, we can optimize this cases, it will just take us insertion of freeze.
Markus Böck [Fri, 10 Mar 2023 09:49:16 +0000 (10:49 +0100)]
[mlir][GPUToLLVM] Fix regression introduced with opaque-pointers when generate GPU launch func parameters
This has caused build failures when enabling opaque pointers for the GPU integration tests as could be seen here:
https://lab.llvm.org/buildbot/#/builders/220/builds/16946 and here https://lab.llvm.org/buildbot/#/builders/61/builds/40822
The gist of the issue was the use of a wrong pointer base type within a GEP. There sadly was no test coverage for either the generating of that GEP, nor is LLVM Dialects GEP verifier currently capable of catching such issues, so it went unnoticed until the integration tests actually attempted to convert it to LLVM IR.
Differential Revision: https://reviews.llvm.org/D145774
Nikita Popov [Fri, 10 Mar 2023 09:34:27 +0000 (10:34 +0100)]
[InstSimplify] Adjust context instruction when threading phi (PR61312)
When threading operations over phis, we need to adjust the context
instruction to the terminator of the incoming block. This was
handled when threading icmps, but not when threading binops.
Fixes https://github.com/llvm/llvm-project/issues/61312.
Nikita Popov [Fri, 10 Mar 2023 09:29:28 +0000 (10:29 +0100)]
[InstSimplify] Add test for PR61312 (NFC)
Alexander Shaposhnikov [Fri, 10 Mar 2023 09:10:37 +0000 (09:10 +0000)]
[Clang][Sema] Start fixing handling of out-of-line definitions of constrained templates
This diff starts fixing our handling of out-of-line definitions of constrained templates.
Initially it was motivated by https://github.com/llvm/llvm-project/issues/49620 and
https://github.com/llvm/llvm-project/issues/60231.
In particular, this diff adjusts Sema::computeDeclContext to work properly in the case of
constrained template parameters.
Test plan:
1/ ninja check-all
2/ Bootstrapped Clang passes all the tests
3/ Internal testing
Differential revision: https://reviews.llvm.org/D145034
chenglin.bi [Fri, 10 Mar 2023 08:58:05 +0000 (16:58 +0800)]
[InstCombine] Add precommit tests for strong order compare patterns; NFC
Sameer Sahasrabuddhe [Fri, 10 Mar 2023 07:14:20 +0000 (12:44 +0530)]
[llvm][Uniformity] consistently handle always-uniform instructions
An instruction that is "always uniform" is so even if it occurs in an
irreducible cycle. The output produced by such an instruction may depend on the
implementation defined cycle hierarchy, but that does not affect the uniformity
of the output. In other words, an "always uniform" instruction is uniform even
if it is not m-converged.
Reviewed By: ruiling, ronlieb
Differential Revision: https://reviews.llvm.org/D145572
Valentin Clement [Fri, 10 Mar 2023 08:49:12 +0000 (09:49 +0100)]
[flang] Handle unlimited polymorphic with intrinsic dynamic type in extends_type_of
Unlimited polymorphic entities can have an intrinsic dynamic type. Update the
code of extends_type_of to compare the CFI_type in these case.
Reviewed By: PeteSteinfeld
Differential Revision: https://reviews.llvm.org/D145722
Max Kazantsev [Fri, 10 Mar 2023 08:33:27 +0000 (15:33 +0700)]
[Test] Add missing noundef in positive test
Craig Topper [Fri, 10 Mar 2023 08:02:04 +0000 (00:02 -0800)]
[RISCV] Use binary search for RISCVLoadFPImm::getLoadFPImm.
The table is sorted so we can use a binary search instead of a
linear scan.
Markus Böck [Fri, 10 Mar 2023 07:51:17 +0000 (08:51 +0100)]
Revert "[mlir] Enable opaque pointers in LLVM conversion passes by default"
This reverts commit
552522bef66c56dc4336d5948662f295dd733c0d.
There are test failures in integration tests for GPU builds
Markus Böck [Fri, 10 Mar 2023 07:33:21 +0000 (08:33 +0100)]
[mlir] Enable opaque pointers in LLVM conversion passes by default
Part of https://discourse.llvm.org/t/rfc-switching-the-llvm-dialect-and-dialect-lowerings-to-opaque-pointers/68179
When this patch lands any downstream users with custom LLVM conversion passes not yet using opaque pointers will start either experiencing assertions being triggered, null pointer dereferences or at the very least verifier errors. These can be either fixed by switching to opaque pointers or simply disabling opaque pointers in both pass options of any upstream conversion passes and any uses of `LLVMTypeConverter` via the `LowerToLLVMOptions`.
Users using just MLIRs conversion passes to the LLVM Dialect should not experience any change in functionality except when inspecting the output from the passes.
Differential Revision: https://reviews.llvm.org/D145585
Lang Hames [Fri, 10 Mar 2023 07:21:35 +0000 (23:21 -0800)]
[JITLink][docs] Update docs for generic link algorithm and memory manager apis.
These sections were out of date.
Chuanqi Xu [Fri, 10 Mar 2023 07:25:26 +0000 (15:25 +0800)]
Revert "[NFC] Don't recompute Linkage for Decl in Release Modes"
This reverts commit
87ba95aa212a4fd363a4dd52677e9eea5224a4e7.
Chuanqi Xu [Fri, 10 Mar 2023 07:16:39 +0000 (15:16 +0800)]
[NFC] Don't recompute Linkage for Decl in Release Modes
In the assertion enabled mode we will test if the computed linkage of
Declaration is consistent with the cached linkage. But we shouldn't
compuate it if we have cached linkage in the release modes.
Craig Topper [Fri, 10 Mar 2023 07:09:27 +0000 (23:09 -0800)]
[RISCV] Move some RISCVLoadFPImm out of line. NFC
This moves the LoadFPImmArr array to the cpp file. Being in the header
meant it was duplicated in every translation unit that includes the
header.
Move the 2 functions that use the array out of line.
Rong Xu [Fri, 10 Mar 2023 06:43:08 +0000 (22:43 -0800)]
[FSAFDO] Improve FS discriminator encoding
This change improves FS discriminators in the following ways:
(1) use call-stack debug information in the the to generate
discriminators: the same (src/line) DILs can now have same
discriminator value if they come from different call-stacks.
This effectively increases the usable discriminator values
for each round of FS discriminator pass.
(2) don't generate the FS discriminator for meta instructions
(i.e. instructions not emitted). This reduces the number
discriminators conflicts (for the case we run out of discriminator
bits for that pass).
(3) use less expensive hashing of xxHash64.
These improvements should bring better performance for FSAFDO
and they should be used by default. But this change creates
incompatible FS discriminators. For the iterative profile users,
they might see a performance drop in the first release with
this change (due to the fact that the profiles have the old
discriminators and the compiler uses the new discriminator).
We have measured that this is not more than 1.5% on several
benchmarks. Note the degradation should be gone in the second
release and one should expect a performance gain over the binary
without this change.
One possible solution to the iterative profile issue would be
separating discriminators for profile-use and the ones emitted to
the binary. This would require a mechanism to allow two sets of
discriminators to be maintained and then phasing out the first
approach. This is too much churn in the compiler and the
performance implications do not seem to be worth the effort.
Instead, we put the changes under an option so iterative profile
users can do a gradual rollout of this change. We will make the
option default value to true in a later patch and eventually
purge this option from the code base.
Differential Revision: https://reviews.llvm.org/D145171
Chuanqi Xu [Fri, 10 Mar 2023 06:15:08 +0000 (14:15 +0800)]
[C++20] [Modules] Don't load declaration eagerly for named modules
Close https://github.com/llvm/llvm-project/issues/61064.
The root cause of the issue is that we will deserilize some declarations
eagerly when reading the BMI. However, many declarations in the BMI are
not necessary for the importer. So it wastes a lot of time.
Jie Fu [Fri, 10 Mar 2023 06:52:28 +0000 (14:52 +0800)]
[libfuzzer] Fix build error due to out-of-line definition of 'Fuzzer' does not match any declaration in 'fuzzer::Fuzzer' (NFC)
/data/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:138:9: error: out-of-line definition of 'Fuzzer' does not match any declaration in 'fuzzer::Fuzzer'
Fuzzer::Fuzzer(UserCallback CB, InputCorpus &Corpus, MutationDispatcher &MD,
^~~~~~
/data/llvm-project/compiler-rt/lib/fuzzer/FuzzerInternal.h:35:10: note: type of 4th parameter of member declaration does not match definition ('fuzzer::FuzzingOptions &' vs 'const fuzzer::FuzzingOptions &')
FuzzingOptions &Options);
^
1 error generated.
Max Kazantsev [Fri, 10 Mar 2023 06:13:14 +0000 (13:13 +0700)]
[Test] Add some corner cases negative tests for D143726
- No common loop-variant;
- One comparison against loop-variant;
Max Kazantsev [Fri, 10 Mar 2023 06:04:28 +0000 (13:04 +0700)]
[Test] Add negative and positive tests with extra uses for D143726
Max Kazantsev [Fri, 10 Mar 2023 05:59:01 +0000 (12:59 +0700)]
[Test] Add negative eq/ne tests for D143726
Max Kazantsev [Fri, 10 Mar 2023 05:55:32 +0000 (12:55 +0700)]
[Test] Add negative and positive mismatched predicates tests for D143726
Max Kazantsev [Fri, 10 Mar 2023 05:40:01 +0000 (12:40 +0700)]
[Test] Add negative and positive logical or/and tests for D143726
Max Kazantsev [Fri, 10 Mar 2023 05:11:16 +0000 (12:11 +0700)]
[Test] Add swapped tests for D143726
Wu, Yingcong [Fri, 10 Mar 2023 06:10:07 +0000 (22:10 -0800)]
[libfuzzer] avoid unneccessary copy
Avoid some unneccessary copy
Reviewed By: fmayer
Differential Revision: https://reviews.llvm.org/D145758
sgokhale [Fri, 10 Mar 2023 05:28:18 +0000 (10:58 +0530)]
[CodeGen][AArch64] Generate Pseudo instructions for integer MLA/MAD/MLS/MSB
Differential Revision: https://reviews.llvm.org/D145488
Max Kazantsev [Fri, 10 Mar 2023 04:33:30 +0000 (11:33 +0700)]
[Test] Regenerate tests using update_llc_test_checks.py
Lang Hames [Fri, 10 Mar 2023 04:01:44 +0000 (20:01 -0800)]
[JITLink] Use unique_function rather than std::function for JITLink passes.
Passes aren't expected to be copied, and switching to unique_function allows
them to capture values with move-only types.
Eugene Zhulenev [Wed, 1 Feb 2023 21:48:50 +0000 (13:48 -0800)]
[mlir] Add support for f8 data types to LLVM dialect types
This change allows using fp8 pointers when exporting to LLVM, because we anyway export them as opaque pointers, however full support of fp8 types is not yet implemented on the LLVM side.
Differential Revision: https://reviews.llvm.org/D143008
Yaxun (Sam) Liu [Tue, 7 Mar 2023 05:25:01 +0000 (00:25 -0500)]
[HIP] Fix temporary files
Currently HIP toolchain uses Driver::GetTemporaryDirectory to
create a temporary directory for some temporary files during
compilation. The temporary directories are not automatically
deleted after compilation. This slows down compilation
on Windows.
Switch to use GetTemporaryPath which only creates temporay
files which will be deleted automatically.
Keep the original input file name convention for Darwin host
toolchain since it is needed for deterministic binary
(https://reviews.llvm.org/D111269)
Fixes: SWDEV-386058
Reviewed by: Artem Belevich
Differential Revision: https://reviews.llvm.org/D145509
Sam Clegg [Mon, 6 Mar 2023 17:55:00 +0000 (09:55 -0800)]
[lld][WebAssembly] Use C++17 nested namespace syntax in most places. NFC
Like D131405, but for wasm-ld.
Differential Revision: https://reviews.llvm.org/D145399
wanglian [Wed, 1 Mar 2023 03:05:45 +0000 (11:05 +0800)]
[Codegen][NFC] Replace 'RegisterRegAlloc::FunctionPassCtor'
with 'RegisterRegAllocBase<T>::FunctionPassCtor'.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D145032
Jim Lin [Fri, 10 Mar 2023 01:03:28 +0000 (09:03 +0800)]
[RISCV] Set how many bytes load from or store to stack slot
Refer from: https://reviews.llvm.org/D44782
After https://reviews.llvm.org/D130302, LW+SEXT.B can be folded into LB
as partially reload stack slot. This gains incorrect optimization result
from `StackSlotColoring` without given the number of bytes exactly load
from stack. LB+SW are mis-interpreted as fully reload/restore from stack
slot without the sign-extension. SW would be considered as a redundant store.
The testcase is copied from llvm/test/CodeGen/X86/pr30821.mir.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D145471
Jim Lin [Fri, 10 Mar 2023 01:03:03 +0000 (09:03 +0800)]
[RISCV] Pre-commit test case for D140460
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D145549
Vitaly Buka [Fri, 10 Mar 2023 02:18:29 +0000 (18:18 -0800)]
[ConstraintElimination] Fix UB after D145677
Igor Zhukov [Fri, 10 Mar 2023 02:01:52 +0000 (09:01 +0700)]
[libc++][ranges] Implement LWG-3865 Sorting a range of pairs
Reviewed By: Mordante, philnik, ldionne, #libc
Differential Revision: https://reviews.llvm.org/D144262
Luke Lau [Thu, 9 Mar 2023 14:35:57 +0000 (14:35 +0000)]
[RISCV] Model interleave and deinterleave shuffles in cost model
Interleave and deinterleave shuffles are lowered by a more efficient
sequence if the element size is smaller than ELEN.
Reviewed By: reames
Differential Revision: https://reviews.llvm.org/D145678
Kirill Stoimenov [Fri, 10 Mar 2023 01:07:43 +0000 (01:07 +0000)]
[HWASAN][LSAN] Fix buildbot failure.
Paul Walker [Fri, 10 Mar 2023 00:39:39 +0000 (00:39 +0000)]
[SVE] Precommit multiuse predicated compare tests.
Kirill Stoimenov [Mon, 6 Mar 2023 23:55:32 +0000 (23:55 +0000)]
[HWASAN][LSAN] Disable tests which don't pass in HWASAN+LSAN mode
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D145727
Michael Buch [Wed, 8 Mar 2023 11:32:06 +0000 (11:32 +0000)]
[lldb][InstrumentationRuntime] Make 'data' struct anonymous in order to avoid collisions with types in the debuggee
The `UBSAN`/`ASAN` plugins would previously call the internal helper
structure injected into the source expression `struct data { ... };`
This occasionally collided with user-defined types of the same (quite
common) name. In the presence of varibale with the same name LLDB would
simply fail to run the injected `InstrumentationRuntime` expressions
with:
```
warning: cannot evaluate AddressSanitizer expression:
expression failed to parse:
error: <user expression 2>:2:5: must use 'struct' tag to refer to type 'data' in this scope
data t;
```
In the presence of another type called 'data', LLDB would most likely
crash with something like:
```
0x00000001198de614 clang::ASTNodeImporter::ImportDeclContext(clang::DeclContext*, bool) + 1088
0x00000001198de614 clang::ASTNodeImporter::ImportDeclContext(clang::DeclContext*, bool) + 1088
0x0000000119907930 clang::ASTImporter::ImportDefinition(clang::Decl*) + 596
0x00000001163db928 lldb_private::ClangASTImporter::ASTImporterDelegate::ImportDefinitionTo(clang::Decl*, clang::Decl*) + 100
0x00000001163da070 (anonymous namespace)::CompleteTagDeclsScope::~CompleteTagDeclsScope() + 572
...
```
...because it got the types confused.
This patch makes these structures anonymous so there's no
chance of clashing with other types in the program. This is
already the approach taken in `UBSan/InstrumentationRuntimeABSan.cpp`.
**Testing**
- API tests still pass
- Tested manually that the `memory history` command now works in the presence of a local called `data`
Differential Revision: https://reviews.llvm.org/D145569
Jun Zhang [Fri, 10 Mar 2023 00:00:41 +0000 (08:00 +0800)]
[InstCombine] Reduce absolute diff from min+max+sub
This patch implements fold: max(a,b) nsw/nuw - min(a,b) --> abs(a nsw - b)
Alive2: https://alive2.llvm.org/ce/z/4yLp7D
Fixes: https://github.com/llvm/llvm-project/issues/61228
Signed-off-by: Jun Zhang <jun@junz.org>
Differential Revision: https://reviews.llvm.org/D145540
Arthur Eubanks [Thu, 9 Mar 2023 23:42:27 +0000 (15:42 -0800)]
[llvm-c] Remove pointee support from LLVMGetElementType
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D145717
Ben Shi [Wed, 8 Mar 2023 10:03:49 +0000 (18:03 +0800)]
[RISCV][NFC] Add tests for SLP vectorization of math functions
RISCV has "vfabs.v" and "vfsqrt.v" so math functions abs and sqrt
can be SLP vectorized. But others exp/log/sin/asin/sinh/asinh/...
can not.
Reviewed By: reames
Differential Revision: https://reviews.llvm.org/D145562
Renaud-K [Thu, 9 Mar 2023 02:39:40 +0000 (18:39 -0800)]
Break circular dependency between FIR dialect and utilities
Emilio Cota [Thu, 9 Mar 2023 22:08:00 +0000 (17:08 -0500)]
[mlir][vector] remove unnecessary VectorTransformOps include
While at it, add a dep that we missed in https://reviews.llvm.org/D145638.
Reviewed By: kuhar, dcaballe
Differential Revision: https://reviews.llvm.org/D145731
Jason Molenda [Thu, 9 Mar 2023 22:53:14 +0000 (14:53 -0800)]
Slight refinement to a change yesterday in metadata-added binaries
When ObjectFileMachO::LoadCoreFileImages load a binary into the
target with a valid load address, we don't need to re-load its
segments into the Target's SectionLoadList again. But we should
still call ModulesDidLoad on these modules so breakpoints can be
inserted etc.
Bruno Cardoso Lopes [Tue, 7 Mar 2023 20:51:34 +0000 (12:51 -0800)]
[Coroutines] Fix premature conversion of return object
Fix https://github.com/llvm/llvm-project/issues/56532
Effectively, this reverts behavior introduced in https://reviews.llvm.org/D117087,
which did two things:
1. Change delayed to early conversion of return object.
2. Introduced RVO possibilities because of early conversion.
This patches fixes (1) and removes (2). I already worked on a follow up for (2)
in a separated patch. I believe it's important to split these two because if the RVO
causes any problems we can explore reverting (2) while maintaining (1).
Notes on some testcase changes:
- `pr59221.cpp` changed to `-O1` so we can check that the front-end honors
the value checked for. Sounds like `-O3` without RVO is more likely
to work with LLVM optimizations...
- Comment out delete members `coroutine-no-move-ctor.cpp` since behavior
now requires copies again.
Differential Revision: https://reviews.llvm.org/D145639
Christopher Ferris [Thu, 9 Mar 2023 00:56:24 +0000 (16:56 -0800)]
[scudo] Add a fast get time version.
On Android, the _COARSE version of clock_gettime is about twice as fast.
Therefore, add a getMonotonicTimeFast function that is used in the
releaseToOSMaybe functions.
Reviewed By: Chia-hungDuan
Differential Revision: https://reviews.llvm.org/D145636
bzcheeseman [Thu, 9 Mar 2023 19:02:21 +0000 (11:02 -0800)]
[ORC] Fix name shadowing issue, NFC.
Testing the COFFPlatform on MSVC, a name shadowing issue surfaced where `LoadDynLibrary` inside the constructor was actually using the moved-from function argument. This patch simply renames the argument to avoid that shadowing.
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D145710
Aart Bik [Thu, 9 Mar 2023 18:44:46 +0000 (10:44 -0800)]
[sparse][mlir] test transposition on sorted COO
DO NOT SUBMIT YET, test exposes bug
Reviewed By: Peiming
Differential Revision: https://reviews.llvm.org/D145708
Peiming Liu [Wed, 8 Mar 2023 23:24:16 +0000 (23:24 +0000)]
[mlir][sparse] deduplicate non-unique coordinates unconditionally
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/D145621
Leonard Chan [Thu, 9 Mar 2023 21:42:04 +0000 (21:42 +0000)]
[hwasan] Suppress leaks from dlsym with hwasan+lsan just like with
asan+lsan
We should follow suite with how asan handles this now that lsan also
works with hwasan.
Differential Revision: https://reviews.llvm.org/D145613
Nikolas Klauser [Thu, 9 Mar 2023 21:35:40 +0000 (22:35 +0100)]
[libc++] Fix include order in <optional>
Nadeem, Usman [Wed, 1 Feb 2023 23:09:23 +0000 (15:09 -0800)]
[Flang] Add support to use LTO specific pipelines
Thin and full LTO modes use different pre-link pipelines compared to
regular compilation. This patch adds support for calling those pipelines.
This patch closely mimics Clang's implementation with the exception that I
changed the codegen option name from `PrepareForLTO` to `PrepareForFullLTO`
to be more precise.
With this patch:
- Compilation for full LTO should be as we expect (except possibly
missing optimizations enabled by module summaries which we do not
produce yet).
- thinLTO uses the correct prelink pipeline but will use the postlink
backend for fullLTO due to missing metadata and summary in the llvm
module. I have added a warning regarding this: `flang-new: warning: the
option '-flto=thin' is a work in progress`.
Differential Revision: https://reviews.llvm.org/D142420
Change-Id: I6b94b775b5b8e93340e520c5cd4bf60834b2e209
Jez Ng [Wed, 8 Mar 2023 04:48:25 +0000 (20:48 -0800)]
[LTO] Add debug logging for module ID <-> path mapping
It's helpful
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D145541
Peiming Liu [Thu, 9 Mar 2023 21:22:59 +0000 (21:22 +0000)]
[mlir][sparse] add a check test for foreach operation on constant sparse tensor
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/D145728
Arthur Eubanks [Thu, 9 Mar 2023 19:27:52 +0000 (11:27 -0800)]
[docs] Mention LLVM_USE_LINKER/LLVM_PARALLEL_{COMPILE,LINK}_JOBS in GettingStarted
As requested in D145413.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D145714
Peiming Liu [Thu, 9 Mar 2023 20:46:04 +0000 (20:46 +0000)]
[mlir][sparse] fix bugs when convert coo to coo but with different dim ordering
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/D145723
Joshua Batista [Thu, 9 Mar 2023 19:31:31 +0000 (11:31 -0800)]
Add codegen for llvm exp/exp2 elementwise builtins
Add codegen for llvm exp/exp2 elementwise builtin
The exp/exp2 elementwise builtins are necessary for HLSL codegen.
Tests were added to make sure that the expected errors are encountered when these functions are given inputs of incompatible types.
The new builtins are restricted to floating point types only.
Reviewed By: fhahn
Differential Revision: https://reviews.llvm.org/D145270
Jakub Kuderski [Thu, 9 Mar 2023 20:13:28 +0000 (15:13 -0500)]
[mlir][vector] Add missing build dependencies for VectorToGPU
Post-commit fix for https://reviews.llvm.org/D145638.
Jakub Kuderski [Thu, 9 Mar 2023 19:56:20 +0000 (14:56 -0500)]
[mlir][vector][nvgpu] Move MMA contraction preparation to VectorUtils
This pattern is not specific to nvgpu; I intend to use in SPIR-V codegen. `VectorTransforms` seems like a more generally useful place.
In addition:
- Fix a bug in the second condition (the dimensions were swapped for RHS).
- Add tests.
- Add support for externally provided filter functions, similar to other vector transforms.
- Prefer to transpose before zero/sign-extending inputs.
Reviewed By: ThomasRaoux
Differential Revision: https://reviews.llvm.org/D145638
Snehasish Kumar [Thu, 9 Mar 2023 03:55:39 +0000 (03:55 +0000)]
[memprof] Add scripts to automate testdata regeneration.
The memprof profiles and binaries need to be updated in case of version
updates. This change adds three scripts for llvm-profdata, clang and
llvm tests where memprof profiles are used as inputs. Also update the
tests, profiles and binaries in this change. Change based on the review
suggestions in D145023.
Reviewed By: tejohnson
Differential Revision: https://reviews.llvm.org/D145644
Jonas Devlieghere [Thu, 9 Mar 2023 19:32:17 +0000 (11:32 -0800)]
[lldb] Skip TestSymbolFileJSON on Windows
Disable the test as Windows (or at least the bot) doesn't have 'strip':
'strip' is not recognized as an internal or external command
Jennifer Yu [Thu, 9 Mar 2023 16:14:56 +0000 (08:14 -0800)]
Revert "Revert "Add map info for dereference pointer.""
This reverts commit
8cf85a0cadb033fed3d96aa5283deb4bfbbaf2c8.
This is add back change of "Add map info for dereference pointer."
In addition turn off test run on amdgpu, since I don't know the way to
reprodue the problem.
Fehr Mathieu [Thu, 9 Mar 2023 18:27:50 +0000 (18:27 +0000)]
[mlir] Add setters for Dynamic[Type|Attr]Definition
Add functions to set the verifier, printer, and parser of
dynamic attributes definitions, and dynamic type definitions.
This feature was already implemented for dynamic operations, but
is missing for attributes and types. This is necessary to define
attributes and types verifiers that refer to each others in a cyclic way.
Differential Revision: https://reviews.llvm.org/D144690
Michael Jones [Thu, 9 Mar 2023 00:39:45 +0000 (16:39 -0800)]
[libc][docs] update list of completed stdio funcs
Reviewed By: lntue
Differential Revision: https://reviews.llvm.org/D145633
Jonas Devlieghere [Thu, 9 Mar 2023 18:26:21 +0000 (10:26 -0800)]
[lldb] Add nullptr check to SymbolVendorWasm
Add the same nullptr check to SymbolVendorWasm that was added to
SymbolVendorELF.
Jonas Devlieghere [Thu, 9 Mar 2023 18:20:41 +0000 (10:20 -0800)]
[dsymutil] Fix offset calculation for universal binaries
The Mach-O file format uses 32-bit values to encodes offsets which they
cannot exceed UIN32_MAX (4GB). The Mach-O file itself can be larger than
4GB as long as none of the offsets fall within this limit.
For universal binaries, dsymutil determines if the offset is going to
exceed the 4GB limit by computing the size of the header and adding it
to the size of all the slices. This is incorrect because it computes the
end offset of the final slice. For the purpose of the 4GB limit, only
the starting offset matters. The size of the last slice is irrelevant as
long as it itself is a valid Mach-O.
rdar://
104435018
Differential revision: https://reviews.llvm.org/D145637
Michal Paszkowski [Thu, 9 Mar 2023 16:22:33 +0000 (17:22 +0100)]
[SPIR-V] Report modifying IR in SPIRVPrepareFunctions
This change fixes "Pass modifies its input and doesn't
report it" error when running SPIRVPrepareFunctions
pass with LLVM_ENABLE_EXPENSIVE_CHECKS enabled.
Differential Revision: https://reviews.llvm.org/D145121
Zain Jaffal [Thu, 9 Mar 2023 18:16:19 +0000 (18:16 +0000)]
[ConstraintElimination] Fix undefined behaviour in shl decomposition
Add checks to prevent decomposing constants bigger than 64.
relates to https://github.com/llvm/llvm-project/issues/61127
Reviewed By: fhahn
Differential Revision: https://reviews.llvm.org/D145677
Peiming Liu [Tue, 7 Mar 2023 21:52:03 +0000 (21:52 +0000)]
[mlir][sparse] deduplicate non-unique coordinates when coiterating collapsed COO tensors.
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/D145532
Hanhan Wang [Thu, 9 Mar 2023 18:03:31 +0000 (10:03 -0800)]
[mlir][tensor] Expose padding requirement of pack ops to a static method
It also simplifies the implementation of the method. The map is not needed in the check.
Reviewed By: chelini
Differential Revision: https://reviews.llvm.org/D145522
Ed Maste [Wed, 14 Dec 2022 21:03:56 +0000 (16:03 -0500)]
[libc++] Add CI job testing on FreeBSD
Reviewed by: ldionne, Mordante
Differential Revision: https://reviews.llvm.org/D128084
Peter Klausler [Fri, 3 Mar 2023 17:52:41 +0000 (09:52 -0800)]
[flang] Ensure "dtv" args passed by descriptor when polymorphic
The predicate used to determine whether the initial "dtv" argument
to a user-defined derived type I/O procedure specified by a generic
interface that is not in the derived type definition is wrong.
The "dtv" argument must be passed via a descriptor whenever it is
polymorphic.
Differential Revision: https://reviews.llvm.org/D145255
Peter Klausler [Fri, 3 Mar 2023 16:17:31 +0000 (08:17 -0800)]
[flang] Ensure that CLASS(*) component descriptors have addenda
In the calculation of derived type component byte sizes, ensure
that CLASS(*) unlimited polymorphic components have space allocated
for their addenda.
Differential Revision: https://reviews.llvm.org/D145248
Luke Lau [Thu, 9 Mar 2023 16:14:25 +0000 (16:14 +0000)]
[RISCV][NFC] Add tests for interleaved accesses in loop vectorizer
Precommit test for D145155
Reviewed By: reames
Differential Revision: https://reviews.llvm.org/D145697
Paul Robinson [Thu, 9 Mar 2023 17:26:17 +0000 (09:26 -0800)]
[PS4/PS5] Remove C_INCLUDE_DIRS handling
We don't configure this way and don't intend to.
Alexey Lapshin [Tue, 7 Mar 2023 12:46:21 +0000 (13:46 +0100)]
[DebugInfo][DWARF] Add doesFormBelongToClass function.
The result of DWARFFormValue::isFormClass depends on DWARF version in some cases.
The current implementation takes DWARF version from the stored DWARFUnit.
If there is no stored DWARFUnit then the current behavior is to assume
DwarfVersion <= 3. This patch adds new function which has a DWARF version as a
parameter so it is possible to check form class for various DWARF versions.
Differential Revision: https://reviews.llvm.org/D145499
Aiden Grossman [Thu, 9 Mar 2023 17:20:18 +0000 (17:20 +0000)]
[ELF] Fix build after getSectionAndRelocations Refactoring
Didn't fail locally for some reason with my gcc toolchain.
Erich Keane [Wed, 8 Mar 2023 20:12:33 +0000 (12:12 -0800)]
Revert two patches to fix GH58452 regression
GH58452 is a regression in the 16.0 release branch caused by both:
b8a1b698afb2fc84819c7596090aabf4d826b436 and
3a0309c53674be56b5cfce038d78a0c2c6e2a98c
This patch reverts both of those to make the 'valid' code stop
diagnosing
at the expense of crashes on invalid + unclear diagnostics.
This patch also adds the tests from GH58452 to prevent any
re-application from breaking this again.
Revert "[clang] Improve diagnostics for expansion length mismatch"
This reverts commit
3a0309c53674be56b5cfce038d78a0c2c6e2a98c.
Revert "[clang] fix missing initialization of original number of expansions"
This reverts commit
b8a1b698afb2fc84819c7596090aabf4d826b436.
Differential Revision: https://reviews.llvm.org/D145605
Aiden Grossman [Sat, 25 Feb 2023 10:18:34 +0000 (10:18 +0000)]
[ELF] Move getSectionAndRelocations to ELF.cpp from ELFDumper.cpp
This refactoring will allow for this utility function to be used in
other places in the codebase outside of the llvm-readobj tool.
Reviewed By: jhenderson, rahmanl
Differential Revision: https://reviews.llvm.org/D144783
Siva Chandra [Thu, 9 Mar 2023 16:53:31 +0000 (16:53 +0000)]
[libc] Extend the linux thread implementation for riscv64.
Also, added riscv64 startup code for static linking which is used
by the integration tests. Functions from the C standard threads
library have been enabled.
Reviewed By: mikhail.ramalho
Differential Revision: https://reviews.llvm.org/D145670
Michael Kruse [Thu, 9 Mar 2023 16:48:02 +0000 (10:48 -0600)]
[Polly] Fix plugin build.
The target_link_libraries call was accidentially removed in
D142580 (Remove Polly-ACC).
Florian Hahn [Thu, 9 Mar 2023 16:52:22 +0000 (17:52 +0100)]
[VPlan] Replace invariance fields from VPWidenGEPRecipe.
There is no need to store information about invariance in the recipe.
Replace the fields with checks of the operands using
isDefinedOutsideVectorRegions.
Reviewed By: Ayal
Differential Revision: https://reviews.llvm.org/D144487
Philip Reames [Thu, 9 Mar 2023 16:36:45 +0000 (08:36 -0800)]
[ASAN] Address a style issue noticed during review of D145175 [nfc]