Matt Arsenault [Tue, 18 Jan 2022 19:10:26 +0000 (14:10 -0500)]
OpenMP: Remove -fno-experimental-isel flag from testing
This effectively reverts
6f9e25d3824fb7b03dc6a403e1962d80a9c88ebe.
I didn't follow the complete history, but it seems this was added due
to AArch64's output changing in some fallback. Blockaddress definitely
works now, so just remove this.
Matt Arsenault [Wed, 16 Nov 2022 00:52:32 +0000 (16:52 -0800)]
AutoUpgrade: Fix assertion on invalid name mangling usage
This was trying to auto-upgrade a read_register call with missing type
mangling. This first would break since getCalledFunction checks the
callee type is consistent, so this would assert there. After that,
the replacement code would die on the type mismatch. Be more
defensive and let the verifier code produce an error that the IR
is broken.
Zequan Wu [Tue, 15 Nov 2022 01:23:18 +0000 (17:23 -0800)]
[AST] Fix class layout when using external layout under MS ABI.
Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D137806
Zequan Wu [Thu, 3 Nov 2022 23:13:59 +0000 (16:13 -0700)]
[LLDB][NativePDB] Forcefully complete a record type if it has empty debug info and is required to have complete type.
It's required in following situations:
1. As a base class.
2. As a data member.
3. As an array element type.
Reviewed By: labath
Differential Revision: https://reviews.llvm.org/D134066
David Goldman [Tue, 15 Nov 2022 18:50:25 +0000 (10:50 -0800)]
Fix use of dangling stack allocated string in IncludeFixer
IncludeFixer uses this BuildDir string later on if given relative paths.
Differential Revision: https://reviews.llvm.org/D138047
Krzysztof Parzyszek [Wed, 16 Nov 2022 18:31:44 +0000 (10:31 -0800)]
[Hexagon] Rearrange bits in TSFlags, NFC
Alexey Bataev [Wed, 16 Nov 2022 17:56:07 +0000 (09:56 -0800)]
[SLP]Fix PR58766: deleted value used after vectorization.
If same instruction is reduced several times, but in one graph is part
of buildvector sequence and in another it is vectorized, we may loose
information that it was part of buildvector and must be extracted from
later vectorized value.
Tomas Matheson [Mon, 14 Nov 2022 12:36:23 +0000 (12:36 +0000)]
[ARM][AArch64] Move common code into ARMTargetParserCommon
Differential Revision: https://reviews.llvm.org/D138017
Joseph Huber [Wed, 16 Nov 2022 17:22:28 +0000 (11:22 -0600)]
[libc] Fix assert.h and ctype.h not being built
The `assert.h` and `ctype.h` headers are never built despite their
entrypoints being present in the generated library. This patch adds a
dependency on these headers so that they will be built properly.
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D138142
Brett Werling [Wed, 16 Nov 2022 16:16:11 +0000 (08:16 -0800)]
[ELF] Handle GCC collect2 -plugin-opt= on Windows
Follows up on commit
cd5d5ce235081005173566c99c592550021de058 by
additionally ignoring relative paths ending in "lto-wrapper.exe" as
can be the case for GCC cross-compiled for Windows.
Reviewed By: tejohnson
Differential Revision: https://reviews.llvm.org/D138065
Muhammad Omair Javaid [Wed, 16 Nov 2022 17:41:41 +0000 (21:41 +0400)]
[llvm-objcopy] XFAIL ELF/update-section.test on 32-bit arm
ELF/update-section.test is failing on 32-bit arm targets. It was
enabled by commit
4f0a1201a462. I am marking it as XFAIL for now.
Simon Pilgrim [Wed, 16 Nov 2022 17:46:18 +0000 (17:46 +0000)]
[X86] Remove unnecessary override GFNI AFFINE reg-reg overrides from AlderlakeP model
Now matches the default SchedWriteVecIMul values used for the instruction.
NOTE: The folded variant overrides are still there as the latency differs by 1cy
Teresa Johnson [Wed, 16 Nov 2022 15:05:11 +0000 (07:05 -0800)]
Restore "[MemProf] ThinLTO summary support" with more fixes
This restores commit
98ed423361de2f9dc0113a31be2aa04524489ca9 and
follow on fix
00c22351ba697dbddb4b5bf0ad94e4bcea4b316b, which were
reverted in
5d938eb6f79b16f55266dd23d5df831f552ea082 due to an
MSVC bot failure. I've included a fix for that failure.
Differential Revision: https://reviews.llvm.org/D135714
Sander de Smalen [Wed, 16 Nov 2022 17:19:09 +0000 (17:19 +0000)]
[AArch64] NFC: Fix broken test sve-fixed-ld2-alloca.ll
There were several issues with this test, the most obvious being
that %strided.vec wasn't used and therefore could be deadcoded.
I've verified that the updated test still covers the code-changes
from its original patch.
Nick Desaulniers [Wed, 16 Nov 2022 17:19:16 +0000 (09:19 -0800)]
[LangRef] remove callbr references from Addresses of BasicBlock section
Since D129288, we no longer use BlockAddress constants as operands of
callbr.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D138080
Matt Arsenault [Wed, 16 Nov 2022 15:46:52 +0000 (07:46 -0800)]
MemoryBuiltins: Don't check for unsized allocas
The verifier rejects these.
Simon Pilgrim [Wed, 16 Nov 2022 16:58:16 +0000 (16:58 +0000)]
[MCA][X86] Add test coverage for VBMI instructions
Guray Ozen [Wed, 16 Nov 2022 16:23:43 +0000 (17:23 +0100)]
[mlir] Introduce `replaceUsesOfWith` to `RewriterBase`
Finding uses of a value and replacing them with a new one is a common method. I have not seen an safe and easy shortcut that does that. This revision attempts to address that by intoroducing `replaceUsesOfWith` to `RewriterBase`.
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D138110
Sander de Smalen [Wed, 16 Nov 2022 15:03:03 +0000 (15:03 +0000)]
[SME] Store buffer to the correct pointer when setting up lazy-save.
This fixes a bug in 'allocateLazySaveBuffer' that led to the
buffer pointer being stored to the wrong address.
Reviewed By: david-arm
Differential Revision: https://reviews.llvm.org/D137734
Mahesh Ravishankar [Wed, 16 Nov 2022 02:51:53 +0000 (02:51 +0000)]
[mlir][Linalg] Move patterns to remove dead arguments and results out of canonicalization.
The patterns to remove dead arguments and results of `linalg.generic`
operations are not necessarily canonicalizations. Instead a new entry
point `populateEraseUnusedOperandsAndResults` is added to allow using
these patterns when needed. The transformations that rely on this
pattern for cleanup now include these patterns explicitly.
Differential Revision: https://reviews.llvm.org/D138085
Aart Bik [Wed, 16 Nov 2022 05:11:31 +0000 (21:11 -0800)]
[mlir][sparse] bring CHECK tests back (but disabled)
We have a strange nondeterministic failure on windows
by not getting the desired fill statement in the resulting
IR. Probably something wrong with our option passing or
pass construction?
https://github.com/llvm/llvm-project/issues/59016#issuecomment-
1316410249
Reviewed By: bixia
Differential Revision: https://reviews.llvm.org/D138089
Kadir Cetinkaya [Wed, 16 Nov 2022 14:49:47 +0000 (15:49 +0100)]
[include-cleaner] Defer decl->stdlib conversion into decl->location conversion
We preserve decls for stdlib symbols after this patch in symbol. That
way we have a more unified view of stdlib and regular decls and can provide
reacher information in applications.
Differential Revision: https://reviews.llvm.org/D138134
Matt Arsenault [Wed, 16 Nov 2022 01:49:53 +0000 (17:49 -0800)]
GlobalISel: Fold some idempotent operations
This makes the existing fabs_fabs fold redundant, which
I thought was using more tablegen matching, but apparently not.
I'm not sure how to make match work with multiple opcodes. There
are a few more this could handle, but these are the ones that
legalization are more likely to introduce.
Alexey Bataev [Wed, 16 Nov 2022 14:30:47 +0000 (06:30 -0800)]
[SLP]Fix PR58956: fix insertpoint for reduced buildvector graphs.
If the graph is only the buildvector node without main operation, need
to inherit insrtpoint from the redution instruction. Otherwise the
compiler crashes trying to insert instruction at the entry block.
zhongyunde [Wed, 16 Nov 2022 15:32:47 +0000 (23:32 +0800)]
[NFC] Fix typo in comment
Address comment in https://reviews.llvm.org/D137936
Differential Revision: https://reviews.llvm.org/D138124
Erich Keane [Wed, 16 Nov 2022 15:00:55 +0000 (07:00 -0800)]
[Concepts] Fix friend-checking to include NTTPs
More work for temp.friend p9, this fixes a previous bug where we didn't
properly consider a friend to depend on the enclosing template if it
only did so via an NTTP.
LLVM GN Syncbot [Wed, 16 Nov 2022 15:19:13 +0000 (15:19 +0000)]
[gn build] Port
332c4af35db9
Muhammad Omair Javaid [Wed, 16 Nov 2022 15:09:49 +0000 (19:09 +0400)]
Revert "[NFC] Make format() more amenable to format attributes"
This reverts commit
cf239c2f1777eb94a4801a086acf1332a7d3cccf.
It has broken tools/llvm-dwarfdump/X86/simplified-template-names.s on
following buildbot:
https://lab.llvm.org/buildbot/#/builders/178/builds/3148
serge-sans-paille [Wed, 9 Nov 2022 22:13:51 +0000 (23:13 +0100)]
[Lexer] Speedup LexTokenInternal
Only reset "NeedsCleaning" flag in case of re-entrant call.
Do not needlessly blank IdentifierInfo. This information will be set
once the token type is picked.
This yields a nice 1% speedup when pre-processing sqlite amalgamation
through:
valgrind --tool=callgrind ./bin/clang -E sqlite3.c -o/dev/null
Differential Revision: https://reviews.llvm.org/D137960
Jay Foad [Wed, 16 Nov 2022 14:57:01 +0000 (14:57 +0000)]
[AMDGPU] Reinstate some dwordx3 tests
Nicholas Guy [Tue, 15 Nov 2022 11:58:04 +0000 (11:58 +0000)]
[AArch64][CodeGen] Add AArch64 support for complex deinterleaving
Differential Revision: https://reviews.llvm.org/D129066
Joseph Huber [Wed, 16 Nov 2022 13:52:14 +0000 (07:52 -0600)]
[OMPT] Fix debug prefix not being defined
Summary:
This header file uses the `DP` prefixes but does not define
`DEBUG_PREFIX`. This patch adds a simple fix, but realistically the `DP`
system isn't ideal. Now that we have access to LLVM libraries and other
utilities we should consider rewriting all of the debugging and error
handling glue.
Paul Robinson [Fri, 4 Nov 2022 13:08:35 +0000 (06:08 -0700)]
[lit] Add `target=<triple>` as a feature keyword
As proposed first in D107162 and later in discourse at
https://discourse.llvm.org/t/rfc-lits-requires-and-triples/66041
Modified a couple of lit's own tests to use this; left others as-is,
because for now triple substrings still work in UNSUPPORTED/XFAIL.
Differential Revision: https://reviews.llvm.org/D137434
Dmitry Preobrazhensky [Wed, 16 Nov 2022 13:26:48 +0000 (16:26 +0300)]
[AMDGPU][GFX11] Refactor VOPD operands handling
Differential Revision: https://reviews.llvm.org/D137952
David Green [Wed, 16 Nov 2022 13:22:48 +0000 (13:22 +0000)]
[AArch64][MachineCombiner] Use MIMetadata to copy pcsections metadata to reassociated instructions.
D134260/D138107 exposed that the MachineCombiner was not copying
pcsections metadata where it should. This patch switches the MIBuild
methods to use MIMetadata that can copy the debug loc and pcsections at
the same time.
Differential Revision: https://reviews.llvm.org/D138112
Kevin Sala [Wed, 16 Nov 2022 13:11:00 +0000 (07:11 -0600)]
[Libomptarget] Build plugins-nextgen/common/PluginInterface with protected visibility
Summary:
This commit sets the default visibility of PluginInterface's symbols (in
nextgen plugins) as protected. This prevents symbols from a plugin
library to be preempted by another plugin library's symbol. It applies
the same fix introduced by D136365.
Issue reported by @ggeorgakoudis.
Differential Revision: https://reviews.llvm.org/D138002
Simon Pilgrim [Wed, 16 Nov 2022 13:11:04 +0000 (13:11 +0000)]
[DAG] simplifySelect - add support for vselect(0, T, F) -> F fold
We still need to add handling for the non-zero T fold (which requires getBooleanContents handling)
Guillaume Chatelet [Wed, 16 Nov 2022 11:01:02 +0000 (11:01 +0000)]
[libc][benchmark] Fix wrong BatchSize leading to data not fitting in L1.
Differential Revision: https://reviews.llvm.org/D138111
Lorenzo Chelini [Tue, 15 Nov 2022 09:39:07 +0000 (10:39 +0100)]
[MLIR][Tensor] Clean-up `ops.mlir` test (NFC)
Split input file was not used.
Reviewed By: springerm
Differential Revision: https://reviews.llvm.org/D138009
David Green [Wed, 16 Nov 2022 12:39:13 +0000 (12:39 +0000)]
[AArch64] Add GPR rr instructions to isAssociativeAndCommutative
This adds some more scalar instructions that are both associative and
commutative to isAssociativeAndCommutative, allowing the machine
combiner to reassociate them to reduce critical path length.
Differential Revision: https://reviews.llvm.org/D134260
John Brawn [Fri, 5 Nov 2021 10:11:00 +0000 (10:11 +0000)]
[AArch64] Mark all instructions that read/write FPCR as doing so
All instructions that can raise fp exceptions also read FPCR, with the
only other instructions that interact with it being the MSR/MRS to
write/read FPCR.
Introducing an FPCR register also requires adjusting
invalidateWindowsRegisterPairing in AArch64FrameLowering.cpp to use
the encoded value of registers instead of their enum value, as the
enum value is based on the alphabetical order of register names and
now FPCR is placed between FP and LR.
This change unfortunately means a large number of mir tests need to
be adjusted due to instructions now requiring an implicit fpcr operand
to be present.
Differential Revision: https://reviews.llvm.org/D121929
OCHyams [Wed, 16 Nov 2022 12:20:12 +0000 (12:20 +0000)]
[Assignment Tracking][11/*] Update RemoveRedundantDbgInstrs
The Assignment Tracking debug-info feature is outlined in this RFC:
https://discourse.llvm.org/t/
rfc-assignment-tracking-a-better-way-of-specifying-variable-locations-in-ir
Update the RemoveRedundantDbgInstrs utility to avoid sometimes losing
information when deleting dbg.assign intrinsics.
removeRedundantDbgInstrsUsingBackwardScan - treat dbg.assign intrinsics that
are not linked to any instruction just like dbg.values. That is, in a block of
contiguous debug intrinsics, delete all other than the last definition for a
fragment. Leave linked dbg.assign intrinsics in place.
removeRedundantDbgInstrsUsingForwardScan - Don't delete linked dbg.assign
intrinsics and don't delete the next intrinsic found even if it would otherwise
be eligible for deletion.
remomveUndefDbgAssignsFromEntryBlock - Delete undef and unlinked dbg.assign
intrinsics encountered in the entry block that come before non-undef
non-unlinked intrinsics for the same variable.
Reviewed By: jmorse
Differential Revision: https://reviews.llvm.org/D133294
Michał Górny [Wed, 16 Nov 2022 12:20:02 +0000 (13:20 +0100)]
[clang][Driver] allow tilde in user config dir
This patch allows users to configure clang with option
e.g. `-DCLANG_CONFIG_FILE_USER_DIR=~/.config/clang` or invoke clang
with `--config-user-dir=~/.config/clang`.
Patch merged on behalf of @paperchalice (LJC)
Differential Revision: https://reviews.llvm.org/D136940
luxufan [Wed, 16 Nov 2022 11:27:17 +0000 (19:27 +0800)]
[JITLink][RISCV] Add R_RISCV_LO12_S relocation support
Fixes: https://github.com/llvm/llvm-project/issues/58979
Reviewed By: Hahnfeld
Differential Revision: https://reviews.llvm.org/D138030
Simon Pilgrim [Wed, 16 Nov 2022 11:44:09 +0000 (11:44 +0000)]
[X86] combineConcatVectorOps - don't concat(vselect,vselect) if the concatenated selection mask isn't legal
One of the crash regression tests now exposes an existing issue with SelectionDAG::simplifySelect not folding vselect with constant masks
Fixes #59003
Benjamin Maxwell [Wed, 16 Nov 2022 11:20:48 +0000 (11:20 +0000)]
[AArch64] Lower fixed-length vector_shuffle to SVE splat if possible
This adds an extra case to check if a vector_shuffle for a fixed-length
vector that's being lowered to SVE, is just a splat. Doing this avoids
a round trip to the stack and back for a few cases.
Reviewed By: c-rhodes
Differential Revision: https://reviews.llvm.org/D137966
Jeremy Morse [Wed, 16 Nov 2022 10:24:53 +0000 (10:24 +0000)]
Revert "Restore "[MemProf] ThinLTO summary support" with fixes"
This reverts commit
00c22351ba697dbddb4b5bf0ad94e4bcea4b316b.
This reverts commit
98ed423361de2f9dc0113a31be2aa04524489ca9.
Seemingly MSVC has some kind of issue with this patch, in terms of linking:
https://lab.llvm.org/buildbot/#/builders/123/builds/14137
I'll post more detail on D135714 momentarily.
Pavel Labath [Wed, 16 Nov 2022 10:51:47 +0000 (11:51 +0100)]
Revert "Send statistics in initialized event"
The test is failing on linux.
This reverts commits
7fe3586cda5b683766ec6b6d5ca2d98c2baaf162 and
d599ac41aabddeb2442db7b31faacf143d63abe4.
Benjamin Maxwell [Wed, 16 Nov 2022 10:45:48 +0000 (10:45 +0000)]
[AArch64][CodeGen] Remove redundant vector negations before concat
This adds a new canonicalization rule to replace concats of truncated
negations with a negation of the concatenated truncates, e.g.
(concat_vectors (v4i16 (truncate (not (v4i32)))),
(v4i16 (truncate (not (v4i32)))))
->
(not (concat_vectors (v4i16 (truncate (v4i32))),
(v4i16 (truncate (v4i32)))))
Doing this allows avoiding redundant negations being emitted in
certain cases.
Reviewed By: peterwaller-arm
Differential Revision: https://reviews.llvm.org/D137433
Simon Pilgrim [Wed, 16 Nov 2022 11:12:15 +0000 (11:12 +0000)]
[X86] vselect-avx.ll - add AVX512 test coverage
Ensure we test predicate selects as well
Guillaume Chatelet [Tue, 25 Oct 2022 14:36:06 +0000 (14:36 +0000)]
[libc][NFC] move memmove implementation
Moving memmove implementation to its own file for symmetry with other mem functions.
Differential Revision: https://reviews.llvm.org/D136687
Guillaume Chatelet [Tue, 25 Oct 2022 15:18:46 +0000 (15:18 +0000)]
[libc] deprecate LLVM_LIBC_MEMCPY_X86_USE_ONLY_REPMOVSB
Differential Revision: https://reviews.llvm.org/D136693
Guillaume Chatelet [Tue, 25 Oct 2022 11:09:59 +0000 (11:09 +0000)]
[libc] remove mem functions dead code
Let's wait a bit for https://reviews.llvm.org/D136595 to settle before
cleaning up. Just in case we would need to revert.
Differential Revision: https://reviews.llvm.org/D136673
Ties Stuij [Wed, 16 Nov 2022 09:47:55 +0000 (09:47 +0000)]
[AArch64][ARM] add Armv8.9-a/Armv9.4-a identifier support
For both ARM and AArch64 add support for specifying -march=armv8.9a/armv9.4a to
clang. Add backend plumbing like target parser and predicate support.
For a summary of Amv8.9/Armv9.4 features, see:
https://community.arm.com/arm-community-blogs/b/architectures-and-processors-blog/posts/arm-a-profile-architecture-2022
For detailed information, consult the Arm Architecture Reference Manual for
A-profile architecture:
https://developer.arm.com/documentation/ddi0487/latest/
People who contributed to this patch:
- Keith Walker
- Ties Stuij
Reviewed By: tmatheson
Differential Revision: https://reviews.llvm.org/D138010
OCHyams [Wed, 16 Nov 2022 10:10:24 +0000 (10:10 +0000)]
[NFC][SelectionDAG][DebugInfo] Refactor DanglingDebugInfo class
Hide the underlying DbgValueInst by adding methods to extract the necessary
information and by adding a raw_ostream &operator<< overload to print it.
Remove the DebugLoc field as this is always the same as the DbgValueInst's
DebugLoc (see D136247).
Reviewed By: StephenTozer
Differential Revision: https://reviews.llvm.org/D136249
OCHyams [Wed, 16 Nov 2022 09:59:35 +0000 (09:59 +0000)]
[NFC][SelectionDAG][DebugInfo] Remove duplicate parameter from handleDebugValue
handleDebugValue has two DebugLoc parameters that appear to always take the
same value. Remove one of the duplicate parameters. See phabricator review for
more detail.
Reviewed By: StephenTozer
Differential Revision: https://reviews.llvm.org/D136247
Reed [Wed, 16 Nov 2022 09:24:24 +0000 (10:24 +0100)]
Add Float8E4M3FN type to MLIR.
The paper https://arxiv.org/abs/2209.05433 introduces two new FP8 dtypes: E5M2 (called Float8E5M2 in LLVM) and E4M3 (called Float8E4M3FN in LLVM). Support for Float8E5M2 in APFloat and MLIR was added in https://reviews.llvm.org/D133823. Support for Float8E4M3FN in APFloat was added in https://reviews.llvm.org/D137760. This change adds Float8E4M3FN to MLIR as well.
There is an RFC for adding the FP8 dtypes here: https://discourse.llvm.org/t/rfc-add-apfloat-and-mlir-type-support-for-fp8-e5m2/65279.
This change is identical to the MLIR changes in the patch that added Float8E5M2, except that Float8E4M3FN is added instead.
Reviewed By: stellaraccident, bkramer, rriddle
Differential Revision: https://reviews.llvm.org/D138075
Vladislav Vinogradov [Thu, 10 Nov 2022 10:23:44 +0000 (13:23 +0300)]
[mlir][linalg] Fix bug in InferStaticShapeOfOperands pattern
The pattern tries to deduce static shape from `tensor.cast` producer of linalg operation operands.
The original code unconditionally casts type of the `tensor.cast` source to `RankedTensorType`.
But the `tensor.cast` can also operate on `UnrankedTensorType`, so this cast either fail on assertion
in debug build or introduce UB in release build.
The patch replaces unconditional cast with `dyn_cast` and check for the cast result.
Reviewed By: mravishankar
Differential Revision: https://reviews.llvm.org/D137775
Timm Bäder [Wed, 16 Nov 2022 08:28:48 +0000 (09:28 +0100)]
[clang][Parse][NFC] Remove unused DenseMap
Timm Bäder [Mon, 14 Nov 2022 15:35:23 +0000 (16:35 +0100)]
[clang][NFC] Remove unused CastForMoving parameter
Nothing ever passes a third parameter to CastForMoving.
Samuel Parker [Tue, 15 Nov 2022 09:15:32 +0000 (09:15 +0000)]
[WebAssembly] multivalue stackify fix
Don't attempt to move a multivalue def past one of it's prior uses.
Differential Revision: https://reviews.llvm.org/D137824
Timm Bäder [Wed, 9 Nov 2022 11:48:43 +0000 (12:48 +0100)]
[clang][Interp][NFC] Use constexpr if in OffsetHelper
Add here is a template parameter, so we can do this.
Guray Ozen [Tue, 15 Nov 2022 17:49:35 +0000 (18:49 +0100)]
[mlir] [transform] Fix for RAUW error in transform gpu dialect
The given test fails due to error below.
The following error is why the test is failing. One `memref.store` and two `memref.load` are consumers of the loop index for which I do RAUW. `memref.store` is first in the list. If I RAUW on this the loop of `llvm::make early inc range(threadIdx.getUsers())` does not return two `memref.load` as users. They remain unchanged. I'm not really certain why.
This change applies RAUW after collecting the users. If a better solution exists, I would be happy to implement it.
```
mlir-opt: ...llvm-project/mlir/include/mlir/IR/UseDefLists.h:175: mlir::IRObjectWithUseList<mlir::OpOperand>::~IRObjectWithUseList() [OperandType = mlir::OpOperand]: Assertion `use_empty() && "Cannot destroy a value that still has uses!"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
```
Reviewed By: springerm
Differential Revision: https://reviews.llvm.org/D138029
Youling Tang [Wed, 16 Nov 2022 07:52:27 +0000 (15:52 +0800)]
[MC][LoongArch] Fix needsRelocateWithSymbol() implementation
LoongArch should be `section plus offset`, so use the generic implementation
of `llvm/lib/MC/MCELFObjectTargetWriter.cpp` to return `false` directly, like
x86 and aarch64.
```
$ cat test.c
static int __attribute__((section(".text.another"))) test(int a, int b)
{
return a + b;
}
static int a = 1, b = 2;
int foo()
{
test(a, b);
return 0;
}
$ gcc -c test.c
$ readelf -Wr test.o
Relocation section '.rela.text' at offset 0x2a0 contains 5 entries:
Offset Info Type Symbol's Value Symbol's Name + Addend
0000000000000010 0000000300000047 R_LARCH_PCALA_HI20
0000000000000000 .data + 0
0000000000000014 0000000300000048 R_LARCH_PCALA_LO12
0000000000000000 .data + 0
0000000000000018 0000000300000047 R_LARCH_PCALA_HI20
0000000000000000 .data + 4
000000000000001c 0000000300000048 R_LARCH_PCALA_LO12
0000000000000000 .data + 4
0000000000000028 0000000500000042 R_LARCH_B26
0000000000000000 .text.another + 0
Relocation section '.rela.eh_frame' at offset 0x318 contains 2 entries:
Offset Info Type Symbol's Value Symbol's Name + Addend
000000000000001c 0000000500000063 R_LARCH_32_PCREL
0000000000000000 .text.another + 0
000000000000003c 0000000200000063 R_LARCH_32_PCREL
0000000000000000 .text + 0
```
Reviewed By: SixWeining, MaskRay
Differential Revision: https://reviews.llvm.org/D137384
Matt Arsenault [Mon, 14 Nov 2022 23:13:21 +0000 (15:13 -0800)]
AMDGPU/GlobalISel: Fix shift tests using out of bounds offsets
Matt Arsenault [Sat, 12 Nov 2022 19:33:29 +0000 (11:33 -0800)]
DAG: Fix assert on load casted to vector with attached range metadata
AMDGPU legalizes i64 loads to loads of <2 x i32>, leaving the
i64 MMO with attached range metadata alone. The known bit width
was using the scalar element type, and asserting on a mismatch.
Jay Foad [Fri, 6 Aug 2021 12:09:47 +0000 (13:09 +0100)]
[AMDGPU][GISel] Smaller code for scalar 32 to 64-bit extensions
Differential Revision: https://reviews.llvm.org/D107639
gonglingqin [Wed, 16 Nov 2022 05:59:52 +0000 (13:59 +0800)]
[LoongArch] Add immediate operand validity check for __builtin_loongarch_dbar
Differential Revision: https://reviews.llvm.org/D137809
Muhammad Omair Javaid [Wed, 16 Nov 2022 06:36:31 +0000 (10:36 +0400)]
[LLDB] Xfail TestVSCode_eventStatistic.py on Arm/AArch64 Linux
This patch marks TestVSCode_eventStatistic.py as xfail on Arm/AArch64
Linux platform. test_initialized_event testcase is failing. See buildbot
logs below:
https://lab.llvm.org/buildbot/#/builders/17/builds/30199
https://lab.llvm.org/buildbot/#/builders/96/builds/31528
Differential Revision: https://reviews.llvm.org/D138077
Christudasan Devadasan [Sat, 12 Nov 2022 13:29:48 +0000 (18:59 +0530)]
[AMDGPU] Remove the assertion for MUBUF instruction with voffset
Currently, there is an assertion that limits the MUBUF instruction
with voffset used for a VGPR spill inside kernel functions when
the frame pointer is really used. It seemed more like an unwanted
limitation and hence removing the assertion.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D137892
Serge Pavlov [Thu, 20 Oct 2022 05:24:50 +0000 (12:24 +0700)]
[Driver] Enable nested configuration files
Users may partition parameters specified by configuration file and put
different groups into separate files. These files are inserted into the
main file using constructs `@file`. Relative file names in it are
resolved relative to the including configuration file and this is not
convenient in some cases. A configuration file, which resides in system
directory, may need to include a file with user-defined parameters and
still provide default definitions if such file is absent.
To solve such problems, the option `--config=` is allowed inside
configuration files. Like `@file` it results in insertion of
command-line arguments but the algorithm of file search is different and
allows overriding system definitions with user ones.
Differential Revision: https://reviews.llvm.org/D136354
Matt Arsenault [Wed, 16 Nov 2022 02:18:21 +0000 (18:18 -0800)]
InstSimplify: Fold arithmetic_fence as idempotent
Matt Arsenault [Wed, 16 Nov 2022 02:24:26 +0000 (18:24 -0800)]
IR: Make arithmetic_fence a DefaultAttrs intrinsic
LLVM GN Syncbot [Wed, 16 Nov 2022 06:08:50 +0000 (06:08 +0000)]
[gn build] Port
617277e7cbda
Yeting Kuo [Wed, 9 Nov 2022 01:40:24 +0000 (09:40 +0800)]
[VP][RISCV] Add vp.nearbyint and RISC-V support.
nearbyint has the property to execute without exception.
For not modifying fflags, the patch added new machine opcode
PseudoVFROUND_NOEXCEPT_V that expands vfcvt.x.f.v and vfcvt.f.x.v between a pair
of frflags and fsflags.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D137685
Björn Schäpers [Sat, 12 Nov 2022 04:51:19 +0000 (05:51 +0100)]
[clang-format][NFC] Improve documentation of FixNamespaceComments
Fixes https://github.com/llvm/llvm-project/issues/55162
Björn Schäpers [Fri, 11 Nov 2022 21:19:03 +0000 (22:19 +0100)]
[clang-format][NFC] Improve documentation on ReflowComments
Fixes https://github.com/llvm/llvm-project/issues/58403
Differential Revision: https://reviews.llvm.org/D137865
Björn Schäpers [Fri, 11 Nov 2022 08:00:49 +0000 (09:00 +0100)]
[clang-format][NFC] Moved configuration parsing tests in own file
I want to reduce the size of ForatTest.cpp with its still wopping 25k
lines it is a burden on the compiler and editor (mine is clangd
powered).
This are tests which are really serving a different purpose than
formatting.
I've copied the code and made the following changes:
- Dropped the ; at the end of some macros, all macro "invocations"
already have their own ;.
- Dropped the _F, we don't need a fxiture here.
Differential Revisison: https://reviews.llvm.org/D137823
Woody Lin [Wed, 2 Nov 2022 10:51:14 +0000 (18:51 +0800)]
[AArch64InstPrinter] Print TargetAddress as an uint64_t
Outputs readable addresses by printed 'TargetAddress' as an uint64_t
value.
`bl -0x37efd56628` => `bl 0xffffffc8102a99d8`
Reviewed By: dmgreen
Differential Revision: https://reviews.llvm.org/D137260
Aart Bik [Tue, 15 Nov 2022 23:37:31 +0000 (15:37 -0800)]
[mlir][sparse] avoid single small vector, set exact number 3
Reviewed By: wrengr
Differential Revision: https://reviews.llvm.org/D138071
Paul Kirth [Wed, 16 Nov 2022 03:36:54 +0000 (03:36 +0000)]
Revert "[pgo] Avoid introducing relocations by using private alias"
This reverts commit
2b8917f8ad792c4c484975b82039bbdebe556881.
This breaks with lld and gold
Yeting Kuo [Mon, 14 Nov 2022 09:58:18 +0000 (17:58 +0800)]
[VP][RISCV] Add vp.bswap and RISC-V support.
The patch also added function expandVPBSWAP to expand ISD::VP_BSWAP nodes.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D137928
Craig Topper [Wed, 16 Nov 2022 02:59:12 +0000 (18:59 -0800)]
[RISCV] Improve formatting of Sched lists in tablegen. NFC
George Hu [Wed, 16 Nov 2022 00:29:54 +0000 (16:29 -0800)]
Send statistics in initialized event
Differential Revision: https://reviews.llvm.org/D138077
Mahesh Ravishankar [Tue, 20 Sep 2022 00:49:01 +0000 (00:49 +0000)]
[mlir][Transforms] CSE of ops with a single block.
Currently CSE does not support CSE of ops with regions. This patch
extends the CSE support to ops with a single region.
Differential Revision: https://reviews.llvm.org/D134306
Depends on D137857
Luo, Yuanke [Mon, 14 Nov 2022 02:20:15 +0000 (10:20 +0800)]
[X86][AMX] Fix the shape dependency issue.
AMX shape should be defined before AMX intrinsics. However for below
case, the shape a.row is defined after tile load of b. If we transform
`load b` to `@llvm.x86.tileloadd64 intrinsic`, the shape dependency
doesn't meet.
```
void test_tile_dpbsud(__tile1024i a, __tile1024i b, __tile1024i c) {
__tile_dpbsud(&c, a, b);
}
```
This patch is to store the tile b to stack and reloaded it after the
def of b.row. It would cause redundant store/load, but it is simple
to avoid generating invalid IR.
The better way may hoist `def b.row` before tile load instruction,
but it seems more complicated to recursively hoist its operands.
Differential Revision: https://reviews.llvm.org/D137923
wangpc [Wed, 16 Nov 2022 02:42:18 +0000 (10:42 +0800)]
[RISCV] Don't use zero-stride vector load for gather if not optimized
We may form a zero-stride vector load when lowering gather to strided
load. As what D137699 has done, we use `load+splat` for this form if
there is no optimized implementation.
We restrict this to unmasked loads currently in consideration of the
complexity of hanlding all falses masks.
Reviewed By: reames
Differential Revision: https://reviews.llvm.org/D137931
Craig Topper [Wed, 16 Nov 2022 02:00:22 +0000 (18:00 -0800)]
[RISCV] Remove some unneeded widening FP vector pseudo instructions. NFC
We don't need LMUL=8 versions of these.
Reviewed By: michaelmaitland
Differential Revision: https://reviews.llvm.org/D137439
Han-Kuan Chen [Mon, 14 Nov 2022 03:08:46 +0000 (19:08 -0800)]
[RISCV] Refactor getDefaultVLOps. NFC.
Current getDefaultVLOps can only deduce VL from a MVT. However,
sometimes users have already known VL value. This commit will provide a
uniform interface to get VL instead of calling DAG.getConstant.
Differential Revision: https://reviews.llvm.org/D138003
Qiu Chaofan [Wed, 16 Nov 2022 01:59:39 +0000 (09:59 +0800)]
[PowerPC] Fix strict load-conversion recognition
Direct-move instructions are usually more efficient than load then store
for conversion. But direct moves are not needed when the source register
was just loaded from some address.
The pattern has already been recognized, but the source value of strict
nodes are not the first (that's the chain), but the second.
Reviewed By: shchenz
Differential Revision: https://reviews.llvm.org/D138011
Michael Maitland [Wed, 16 Nov 2022 02:01:19 +0000 (18:01 -0800)]
Revert "[RISCV][llvm-mca] Use LMUL Instruments to provide more accurate reports on RISCV"
This reverts commit
b88b8307bf9e24f53e7ef3052abf2c506ff55fd2.
wren romano [Wed, 16 Nov 2022 00:31:01 +0000 (16:31 -0800)]
[mlir][sparse] move SparseTensorReader functions into the _mlir_ciface_ section
This is a reposting of D137737, which got reverted when D137735 did. There are no changes other than rebasing.
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/D138000
Michael Maitland [Fri, 4 Nov 2022 15:51:39 +0000 (08:51 -0700)]
[RISCV][llvm-mca] Use LMUL Instruments to provide more accurate reports on RISCV
On x86 and AArch, SIMD instructions encode all of the scheduling information in the instruction
itself. For example, VADD.I16 q0, q1, q2 is a neon instruction that operates on 16-bit integer
elements stored in 128-bit Q registers, which leads to eight 16-bit lanes in parallel. This kind
of information impacts how the instruction takes to execute and what dependencies this may cause.
On RISCV however, the data that impacts scheduling is encoded in CSR registers such as vtype or
vl, in addition with the instruction itself. But MCA does not track or use the data in these
registers. This patch fixes this problem by introducing Instruments into MCA.
* Replace `CodeRegions` with `AnalysisRegions`
* Add `Instrument` and `InstrumentManager`
* Add `InstrumentRegions`
* Add RISCV Instrument and `InstrumentManager`
* Parse `Instruments` in driver
* Use instruments to override schedule class
* RISCV use lmul instrument to override schedule class
* Fix unit tests to pass empty instruments
* Add -ignore-im clopt to disable this change
A prior version of this patch was commited in. It was reverted in
5e82ee5373211db8522181054800ccd49461d9d8.
2323a4ee610f5e1db74d362af4c6fb8c704be8f6 reverted
that change because the unit test files caused build errors. This commit adds the original changes
and the fixed test files.
Differential Revision: https://reviews.llvm.org/D137440
River Riddle [Tue, 15 Nov 2022 02:16:28 +0000 (18:16 -0800)]
[mlir][Translation] Allow specifying an expected input alignment for "ToMLIR" translations
This allows for ensuring that alignment requirements on translation
inputs are satisfied.
Differential Revision: https://reviews.llvm.org/D137999
Akira Hatanaka [Wed, 16 Nov 2022 01:13:33 +0000 (17:13 -0800)]
[Sema] Use the value category of the base expression when creating an
ExtVectorElementExpr
This fixes a bug where an lvalue ExtVectorElementExpr was created when
the base expression was an ObjC property dot operator.
This reverts
220d08d942ab0df3211388e602ed34fa6139ca61.
Differential Revision: https://reviews.llvm.org/D138058
Arthur Eubanks [Mon, 7 Nov 2022 21:07:26 +0000 (13:07 -0800)]
[lldb] Fix simple template names and template params with scope qualifiers
Followup to D134378.
With PrintingPolicy::SuppressScope, we'd also not print the scope in template params. The intention was only to skip the scope for the class because we expect template params to be fully qualified when comparing them for simple template names.
Instead, use `NamedDecl::getNameForDiagnostic` if we're dealing with a tag, which is what we actually use when emitting debug info in clang. That already has an option to suppress the scope on the base name.
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D137583
Peiming Liu [Wed, 16 Nov 2022 00:00:33 +0000 (00:00 +0000)]
[mlir][sparse] fix memory leakage in concatenate rewriter.
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/D138074
Benjamin Kramer [Tue, 15 Nov 2022 23:35:12 +0000 (00:35 +0100)]
[bazel] Remove reference to file removed in
70dc3b811e4926fa2c88bd3b53b29c46fcba1a90
Raman Tenneti [Tue, 15 Nov 2022 23:26:36 +0000 (15:26 -0800)]
[libc] [Obvious] Cleanup.
+ Avoid the `clockid` var and just passed `long(CLOCK_REALTIME)`
to the syscall.
Reviewed By: rtenneti
Differential Revision: https://reviews.llvm.org/D138070
Wanyi Ye [Sat, 10 Sep 2022 18:27:09 +0000 (11:27 -0700)]
[lldb-vscode] Send Selected Statistics Dump in Terminated Event
This patch will gather debug info & breakpoint info from the statistics dump (from `(SBTarget.GetStatistics())` func) and send to DAP in terminated event.
The statistics content can be huge (especially the `modules`) and dumping in full JSON can create delay in the IDE's debugging UI. (For more details, please read: https://github.com/llvm/llvm-project/commit/
7bbd0fba986c241162b77b7e424ad82bc7e17b41 ). Hence, we will filter out large contents before returning it in terminated event.
It will keep all the metadata fields (those starts with "total"). For large contents, it uses the opt-out strategy. Currently it only removes the "modules" field. This way every time a new top-level field being added, we will be able to capture them from DAP log without changing lldb-vscode.
The DAP terminated event should look like
```
{
"event":"terminated",
"seq":0,
"statistics": {
"memory": <JSON string>
"targets": <JSON string>, // it's a JSON array, breakpoints info included in each target
<metadata_key: value> // pairs
},
"type":"event"
}
```
All the info above will be append to statistics field in the terminated event
Test Plan
Debugged a simple hello world program from VSCode. Exit debug session in two ways: 1) run to program exit; 2) user initiated debug session end (quit debugging before program exit).
Check DAP log and see both debug sessions have statistics returned in terminated event.
Here's an example when debugging the test program:
```
{"event":"terminated","seq":0,"statistics":{"memory":"{\"strings\":{\"bytesTotal\":1843200,\"bytesUnused\":897741,\"bytesUsed\":945459}}","targets":"[{\"breakpoints\":[{\"details\":{\"Breakpoint\":{\"BKPTOptions\":{\"AutoContinue\":false,\"ConditionText\":\"\",\"EnabledState\":true,\"IgnoreCount\":0,\"OneShotState\":false},\"BKPTResolver\":{\"Options\":{\"NameMask\":[56],\"Offset\":0,\"SkipPrologue\":true,\"SymbolNames\":[\"foo\"]},\"Type\":\"SymbolName\"},\"Hardware\":false,\"Names\":[\"vscode\"],\"SearchFilter\":{\"Options\":{},\"Type\":\"Unconstrained\"}}},\"id\":1,\"internal\":false,\"numLocations\":1,\"numResolvedLocations\":1,\"resolveTime\":0.002232},{\"details\":{\"Breakpoint\":{\"BKPTOptions\":{\"AutoContinue\":false,\"ConditionText\":\"\",\"EnabledState\":true,\"IgnoreCount\":0,\"OneShotState\":false},\"BKPTResolver\":{\"Options\":{\"Column\":0,\"Exact\":false,\"FileName\":\"/data/users/wanyi/llvm-sand/external/llvm-project/lldb/test/API/tools/lldb-vscode/terminated-event/main.cpp\",\"Inlines\":true,\"LineNumber\":5,\"Offset\":0,\"SkipPrologue\":true},\"Type\":\"FileAndLine\"},\"Hardware\":false,\"Names\":[\"vscode\"],\"SearchFilter\":{\"Options\":{},\"Type\":\"Unconstrained\"}}},\"id\":2,\"internal\":false,\"numLocations\":0,\"numResolvedLocations\":0,\"resolveTime\":0.
23203799999999999},{\"details\":{\"Breakpoint\":{\"BKPTOptions\":{\"AutoContinue\":false,\"ConditionText\":\"\",\"EnabledState\":true,\"IgnoreCount\":0,\"OneShotState\":false},\"BKPTResolver\":{\"Options\":{\"Language\":\"c\",\"NameMask\":[4,4,4,4,4,4],\"Offset\":0,\"SkipPrologue\":false,\"SymbolNames\":[\"_dl_debug_state\",\"rtld_db_dlactivity\",\"__dl_rtld_db_dlactivity\",\"r_debug_state\",\"_r_debug_state\",\"_rtld_debug_state\"]},\"Type\":\"SymbolName\"},\"Hardware\":false,\"SearchFilter\":{\"Options\":{\"ModuleList\":[\"/usr/lib64/ld-2.28.so\"]},\"Type\":\"Modules\"}}},\"id\":-1,\"internal\":true,\"kindDescription\":\"shared-library-event\",\"numLocations\":1,\"numResolvedLocations\":1,\"resolveTime\":0.
00026699999999999998}],\"expressionEvaluation\":{\"failures\":0,\"successes\":0},\"firstStopTime\":0.
087458974999999994,\"frameVariable\":{\"failures\":0,\"successes\":0},\"launchOrAttachTime\":0.
052953161999999998,\"moduleIdentifiers\":[
94554748126576,
94554747837792,
94554747149216,
139800112130176,
139800112161056,
139800112206064,
139800112340224,
139800112509552,
139800112236528],\"signals\":[{\"SIGSTOP\":1}],\"sourceMapDeduceCount\":0,\"stopCount\":8,\"targetCreateTime\":0.
00057700000000000004,\"totalBreakpointResolveTime\":0.234537}]","totalDebugInfoByteSize":1668056,"totalDebugInfoEnabled":3,"totalDebugInfoIndexLoadedFromCache":0,"totalDebugInfoIndexSavedToCache":0,"totalDebugInfoIndexTime":0.
027963000000000002,"totalDebugInfoParseTime":0.
34354800000000002,"totalModuleCount":10,"totalModuleCountHasDebugInfo":3,"totalSymbolTableIndexTime":0.
056050000000000003,"totalSymbolTableParseTime":0.
23930000000000001,"totalSymbolTableStripped":0,"totalSymbolTablesLoadedFromCache":0,"totalSymbolTablesSavedToCache":0},"type":"event"}
```
Differential Revision: https://reviews.llvm.org/D137665