Mike Hommey [Thu, 17 Nov 2022 02:31:28 +0000 (21:31 -0500)]
[lld-macho] Increase slop to prevent thunk out of range again.
Building Firefox with -O0 on arm64 mac recently hit the
"FIXME: thunk range overrun" error on multiple occasions.
Doubling or tripling slop was not sufficient in some cases, so
quadruple it.
Reviewed By: #lld-macho, int3
Differential Revision: https://reviews.llvm.org/D138174
Craig Topper [Thu, 17 Nov 2022 02:51:12 +0000 (18:51 -0800)]
[RISCV] Add a DAG combine to pre-promote (i1 (truncate (i32 (srl X, Y)))) with Zbs on RV64.
Type legalization will want to turn (srl X, Y) into RISCVISD::SRLW,
which will prevent us from using a BEXT instruction.
This is similar to what we do for (i32 (and (srl X, Y), 1)).
Joshua Batista [Thu, 17 Nov 2022 01:56:24 +0000 (17:56 -0800)]
[HLSL] add sin library function
This change exposes the sin library function for HLSL,
excluding long, int, and long long doubles.
Sin is supported for all scalar, vector, and matrix types.
Long and long long double support is missing in this patch because those types
don't exist in HLSL. Int is missing because the sin function only works on floating type arguments.
The full documentation of the HLSL sin function is available here:
https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-sin
Reviewed By: python3kgae
Differential Revision: https://reviews.llvm.org/D138161
Koakuma [Thu, 17 Nov 2022 01:56:17 +0000 (20:56 -0500)]
[SPARC] Don't emit deprecated FP branches when targeting v9
Don't emit deprecated v8-style FP compares & branches when targeting v9
processors.
For now, always use %fcc0, because currently the allocator requires allocatable
registers to also be spillable, which isn't the case with v9 FCC registers.
The work to enable allocation over the entire FCC register file will be done in
a future patch.
Fixes bug #17834
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D135515
Koakuma [Thu, 17 Nov 2022 01:46:14 +0000 (20:46 -0500)]
[SPARC] Improve integer branch handling for v9 targets
Do not emit deprecated v8-style branches when targeting a v9 processor.
As a side effect, this also fixes the emission of useless ba's when doing
conditional branches on 64-bit integer values.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D130006
wren romano [Thu, 17 Nov 2022 01:32:10 +0000 (17:32 -0800)]
[mlir][sparse] Adding wrapper for `__has_builtin`
This is a followup to D138154 and should resolve build issues on Windows.
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/D138167
gonglingqin [Thu, 17 Nov 2022 01:27:08 +0000 (09:27 +0800)]
[LoongArch] Eliminate extra un-accounted-for successors
Specifically:
```
*** Bad machine code: MBB has unexpected successors which are not branch targets, fallthrough, EHPads, or inlineasm_br targets. ***
- function: atomicrmw_umax_i8_acquire
- basic block: %bb.3 (0x1b90bd8)
*** Bad machine code: Non-terminator instruction after the first terminator ***
- function: atomicrmw_umax_i8_acquire
- basic block: %bb.3 (0x1b90bd8)
- instruction: DBAR 1792
```
Differential Revision: https://reviews.llvm.org/D137884
Richard Smith [Thu, 17 Nov 2022 01:41:12 +0000 (17:41 -0800)]
Suppress warning on unused static data member.
The member in the specialization is intentionally unused on 32-bit
targets.
Adrian Prantl [Thu, 17 Nov 2022 01:35:10 +0000 (17:35 -0800)]
Fix use of std::unique / erase. This fixes a bot error after D136650.
wanglei [Thu, 17 Nov 2022 01:12:27 +0000 (09:12 +0800)]
[LoongArch] Transfer MI flags when expand PseudoCALL
When expanding a PseudoCALL, the corresponding flags (e.g. nomerge)
need to be passed to the new instruction.
This patch also adds test for the nomerge attribute.
The `nomerge` attribute was added during `LowerCall`, but was lost
during expand PseudoCALL. Now add it back.
Reviewed By: SixWeining
Differential Revision: https://reviews.llvm.org/D137888
Matt Arsenault [Thu, 17 Nov 2022 00:51:56 +0000 (16:51 -0800)]
AMDGPU: Use -passes for amdgpu-promote-alloca tests
Craig Topper [Thu, 17 Nov 2022 00:53:42 +0000 (16:53 -0800)]
[RISCV] Remove duplicate setOperationAction. NFC
wren romano [Wed, 16 Nov 2022 21:26:58 +0000 (13:26 -0800)]
[mlir][sparse] Macros to clean up StridedMemRefType in the SparseTensorRuntime
In particular, this silences warnings from [-Wsign-compare].
This is a revised version of D137735, which got reverted due to a sign-comparison warning on LLVM's Windows buildbot (which was not on MLIR's Windows buildbot). Differences vs the previous differential:
* `vectorToMemref` now uses `detail::checkOverflowCast` to silence the warning that caused the the previous differential to get reverted.
* `MEMREF_GET_USIZE` now uses `detail::checkOverflowCast` rather than `static_cast`
* `ASSERT_USIZE_EQ` added to abbreviate another common idiom, and to ensure that we use `detail::safelyEQ` everywhere (to silence a few other warnings)
* A couple for-loops now use `index_type` for the induction variable, since their upper bound uses that typedef too. (Namely `_mlir_ciface_getSparseTensorReaderDimSizes` and `_mlir_ciface_outSparseTensorWriterNext`)
Depends on D138149
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/D137998
Ben Shi [Wed, 16 Nov 2022 13:12:28 +0000 (21:12 +0800)]
[clang] Fix wrong ABI of AVRTiny.
A scalar which exceeds 4 bytes should be returned via a stack slot,
on an AVRTiny device.
Reviewed By: aykevl
Differential Revision: https://reviews.llvm.org/D138125
wren romano [Wed, 16 Nov 2022 22:19:01 +0000 (14:19 -0800)]
[mlir][sparse] Updating checkedMul to use intrinsics.
Depends On D138149
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/D138154
wren romano [Wed, 16 Nov 2022 20:59:54 +0000 (12:59 -0800)]
[mlir][sparse] Adding safe comparison functions to MLIRSparseTensorRuntime.
Different platforms use different signedness for `StridedMemRefType::sizes` and `std::vector::size_type`, and this has been causing a lot of portability issues re [-Wsign-compare] warnings. These new functions ensure that we need never worry about those signedness warnings ever again.
Also merging CheckedMul.h into ArithmeticUtils.h
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/D138149
wren romano [Wed, 16 Nov 2022 23:32:26 +0000 (15:32 -0800)]
[mlir][sparse] Misc cleanup of MLIRSparseTensorRuntime
Removing an unnecessary import, and renaming some macros to match the style used elsewhere.
Reviewed By: aartbik, bixia
Differential Revision: https://reviews.llvm.org/D138158
Peiming Liu [Wed, 16 Nov 2022 22:52:39 +0000 (22:52 +0000)]
[mlir][sparse] annotate loops that are generated by loop emitter.
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/D138155
Jim Ingham [Thu, 17 Nov 2022 00:00:26 +0000 (16:00 -0800)]
Only use major version in the clang resource directory for standalone builds.
Commit
e1b88c8a09be changed the name of the clang resource directory so that
it was "lib/clang/<MajorVersion>" but missed the place in the LLDB standalone
build where we search for the resource directory. That was still looking for
<Major>.<Minor>.<Patch>. The standalone lldb bot has been failing since this
commit.
Adrian Prantl [Tue, 15 Nov 2022 00:24:36 +0000 (16:24 -0800)]
Make CompilerType safe
When a process gets restarted TypeSystem objects associated with it
may get deleted, and any CompilerType objects holding on to a
reference to that type system are a use-after-free in waiting. Because
of the SBAPI, we don't have tight control over where CompilerTypes go
and when they are used. This is particularly a problem in the Swift
plugin, where the scratch TypeSystem can be restarted while the
process is still running. The Swift plugin has a lock to prevent
abuse, but where there's a lock there can be bugs.
This patch changes CompilerType to store a std::weak_ptr<TypeSystem>.
Most of the std::weak_ptr<TypeSystem>* uglyness is hidden by
introducing a wrapper class CompilerType::WrappedTypeSystem that has a
dyn_cast_or_null() method. The only sites that need to know about the
weak pointer implementation detail are the ones that deal with
creating TypeSystems.
rdar://
101505232
Differential Revision: https://reviews.llvm.org/D136650
Eli Friedman [Wed, 16 Nov 2022 23:13:33 +0000 (15:13 -0800)]
[clang] Fix __try/__finally blocks in C++ constructors.
We were crashing trying to convert a GlobalDecl from a
CXXConstructorDecl. Instead of trying to do that conversion, just pass
down the original GlobalDecl.
I think we could actually compute the correct constructor/destructor
kind from the context, given the way Microsoft mangling works, but it's
simpler to just pass through the correct constructor/destructor kind.
Differential Revision: https://reviews.llvm.org/D136776
Florian Hahn [Wed, 16 Nov 2022 23:12:40 +0000 (23:12 +0000)]
[VPlan] Introduce VPValue::hasDefiningRecipe helper (NFC).
This clarifies the intention of code that uses the helper.
Suggested by @Ayal during review of D136068, thanks!
Florian Hahn [Wed, 16 Nov 2022 23:03:34 +0000 (23:03 +0000)]
[VPlan] Use recipe type to avoid getDefiningRecipe call (NFC).
Suggested by @Ayal during review of D136068, thanks!
Fangrui Song [Wed, 16 Nov 2022 22:47:53 +0000 (22:47 +0000)]
Revert D137868 "[libc] Fix builtin definition for memory functions"
This reverts commit
da5d00ad0cf4d45e38287280c670b08e84e27411.
This caused -Wmacro-redefined
```
.../libc/src/string/memory_utils/op_x86.h:31:9: error: '_mm512_cmpneq_epi8_mask' macro redefined [-Werror,-Wmacro-redefined]
^
.../lib/clang/google3-trunk/include/avx512bwintrin.h:294:9: note: previous definition is here
^
```
Matt Arsenault [Wed, 16 Nov 2022 21:48:52 +0000 (13:48 -0800)]
AMDGPU: Create poison values instead of undef
These placeholders don't care about the finer points on
the difference between the two.
Florian Hahn [Wed, 16 Nov 2022 22:39:50 +0000 (22:39 +0000)]
[VPlan] Update stale comment (NFC).
Update comment to reflect current code, which also allows for
VPScalarIVStepsRecipes to be uniform.
Suggested by @Ayal during review of D136068, thanks!
Tom Praschan [Wed, 16 Nov 2022 23:37:15 +0000 (00:37 +0100)]
[clangd] Add heuristic for dropping snippet when completing member function pointer
This implements the 1st heuristic mentioned in https://github.com/clangd/clangd/issues/968#issuecomment-
1002242704:
When completing a function that names a non-static member of a class, and we are not inside that class's scope, assume the reference will not be a call (and thus don't add the snippetSuffix)
Reviewed By: nridge
Differential Revision: https://reviews.llvm.org/D137040
Richard Smith [Wed, 9 Nov 2022 23:45:54 +0000 (15:45 -0800)]
When we run out of source locations, try to produce useful information
indicating why we ran out.
Florian Hahn [Wed, 16 Nov 2022 22:31:58 +0000 (22:31 +0000)]
[LV] Replace unnecessary cast_or_null with cast (NFC).
The existing code already unconditionally dereferences RepR, so
cast_or_null can be replaced by just cast.
Suggested by @Ayal during review of D136068, thanks!
Florian Hahn [Wed, 16 Nov 2022 22:17:08 +0000 (22:17 +0000)]
[VPlan] Remove unnecessary casts from tests after
32f1c5531b.
After
32f1c5531b, getDefiningRecipe returns a VPRecipeBase* so there's
no need to cast to VPRecipeBase.
Suggested by @Ayal during review of D136068, thanks!
Florian Hahn [Wed, 16 Nov 2022 22:12:08 +0000 (22:12 +0000)]
[VPlan] Update VPValue::getDef to return VPRecipeBase, adjust name(NFC)
The return value of getDef is guaranteed to be a VPRecipeBase and all
users can also accept a VPRecipeBase *. Most users actually case to
VPRecipeBase or a specific recipe before using it, so this change
removes a number of redundant casts.
Also rename it to getDefiningRecipe to make the name a bit clearer.
Reviewed By: Ayal
Differential Revision: https://reviews.llvm.org/D136068
Ivan Butygin [Thu, 10 Nov 2022 19:53:36 +0000 (20:53 +0100)]
[mlir][linalg] Fix `FoldTensorCastProducerOp` for generic with memref output
Type should only be added to results if it is tensor.
Differential Revision: https://reviews.llvm.org/D137801
Ivan Butygin [Tue, 8 Nov 2022 15:48:10 +0000 (16:48 +0100)]
[mlir][arith] Fold `and(a, and(a, b))` to `and(a, b)`
Differential Revision: https://reviews.llvm.org/D137647
Mehdi Amini [Wed, 16 Nov 2022 21:35:26 +0000 (21:35 +0000)]
Improve diagnostic when parsing a custom op without registering the dialect
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D138151
Tom Honermann [Thu, 13 Oct 2022 20:47:08 +0000 (13:47 -0700)]
[Clang] Correct when Itanium ABI guard variables are set for non-block variables with static or thread storage duration.
Previously, Itanium ABI guard variables were set after initialization was
complete for non-block declared variables with static and thread storage
duration. That resulted in initialization of such variables being restarted
in cases where the variable was referenced while it was still under
construction. Per C++20 [class.cdtor]p2, such references are permitted
(though the value obtained by such an access is unspecified). The late
initialization resulted in recursive reinitialization loops for cases like
this:
template<typename T>
struct ct {
struct mc {
mc() { ct<T>::smf(); }
void mf() const {}
};
thread_local static mc tlsdm;
static void smf() { tlsdm.mf(); }
};
template<typename T>
thread_local typename ct<T>::mc ct<T>::tlsdm;
int main() {
ct<int>::smf();
}
With this change, guard variables are set before initialization is started
so as to avoid such reinitialization loops.
Fixes https://github.com/llvm/llvm-project/issues/57828
Reviewed By: rjmccall
Differential Revision: https://reviews.llvm.org/D135919
Michael Jones [Fri, 11 Nov 2022 22:08:58 +0000 (14:08 -0800)]
[libc] Fix builtin definition for memory functions
The memory functions are highly performance sensitive and use builtins
where possible, but also need to define those functions names when they
don't exist to avoid compilation errors. Previously all those
redefinitions were behind the SSE2 flag for x86, which caused errors on
CPUs that supported SSE2 but not AVX512. This patch splits the various
CPU extensions out to avoid errors on such CPUs.
Reviewed By: gchatelet
Differential Revision: https://reviews.llvm.org/D137868
Joshua Batista [Wed, 16 Nov 2022 20:06:43 +0000 (12:06 -0800)]
[HLSL] add cos library function
This change exposes the cos library function for HLSL,
excluding long, int, and long long doubles.
Cos is supported for all scalar, vector, and matrix types.
Long and long long double support is missing in this patch because those types
don't exist in HLSL. Int is missing because the cos function only works on floating type arguments.
The full documentation of the HLSL cos function is available here:
https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-cos
Reviewed By: python3kgae
Differential Revision: https://reviews.llvm.org/D134921
Peiming Liu [Wed, 16 Nov 2022 20:03:23 +0000 (20:03 +0000)]
[mlir][sparse] fix CHECK test error on windows.
Reviewed By: aartbik, bixia
Differential Revision: https://reviews.llvm.org/D138147
Louis Dionne [Tue, 15 Nov 2022 21:41:55 +0000 (16:41 -0500)]
[clang] Don't include C++ Standard Library headers when -nostdinc is used
This is a follow-up to
53c98d85a, which made the same change but only
for GNU. It seems that we should try to provide a consistent behavior
across all targets.
This fixes an issue where clang/test/Driver/nostdincxx.cpp would start
failing on non-GNU targets because that test was too loose in its checks.
It would only check that 'file not found' was part of the error message,
but didn't ensure that the file we had not found was <vector>.
Differential Revision: https://reviews.llvm.org/D138062
bixia1 [Wed, 16 Nov 2022 18:49:48 +0000 (10:49 -0800)]
[mlir][sparse] Make integration tests run on both library and codegen pathes.
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/D138145
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.