David Sherwood [Mon, 4 Oct 2021 16:31:35 +0000 (17:31 +0100)]
[NFC][LoopVectorize] Remove setBestPlan in favour of getBestPlanFor
I have removed LoopVectorizationPlanner::setBestPlan, since this
function is quite aggressive because it deletes all other plans
except the one containing the <VF,UF> pair required. The code is
currently written to assume that all <VF,UF> pairs will live in the
same vplan. This is overly restrictive, since scalable VFs live in
different plans to fixed-width VFS. When we add support for
vectorising epilogue loops when the main loop uses scalable vectors
then we will the vplan for the main loop will be different to the
epilogue.
Instead I have added a new function called
LoopVectorizationPlanner::getBestPlanFor
that returns the best vplan for the <VF,UF> pair requested and leaves
all the vplans untouched. We then pass this best vplan to
LoopVectorizationPlanner::executePlan
which now takes an additional VPlanPtr argument.
Differential revision: https://reviews.llvm.org/D111125
Matthias Springer [Wed, 27 Oct 2021 07:40:26 +0000 (16:40 +0900)]
[mlir][linalg][bufferize] Add analysis fuzzer option
Analyze ops in a pseudo-random order to see if any assertions are triggered. Randomizing the order of analysis likely worsens the quality of the bufferization result (more out-of-place bufferizations). However, assertions should never fail, as that would indicate a problem with our implementation.
Differential Revision: https://reviews.llvm.org/D112581
Shraiysh Vaishay [Wed, 27 Oct 2021 06:48:00 +0000 (12:18 +0530)]
[MLIR][OpenMP] Added omp.atomic.read and omp.atomic.write
This patch supports the atomic construct (read and write) following
section 2.17.7 of OpenMP 5.0 standard. Also added tests and
verifier for the same.
Reviewed By: kiranchandramohan
Differential Revision: https://reviews.llvm.org/D111992
Kirill Bobyrev [Wed, 27 Oct 2021 08:30:03 +0000 (10:30 +0200)]
[clangd] IncludeCleaner: Support macros
Collect the macro definition locations for all the macros used in the main
file.
Reviewed By: sammccall
Differential Revision: https://reviews.llvm.org/D112447
Nicolas Vasilache [Tue, 26 Oct 2021 21:13:11 +0000 (21:13 +0000)]
[mlir][Linalg] NFC - Add additional control to lower vector.shape_cast ops
This also moves some code to a new patterns file.
Differential Revision: https://reviews.llvm.org/D112575
Nicolas Vasilache [Wed, 27 Oct 2021 07:48:39 +0000 (07:48 +0000)]
[mlir][Vector] Add InsertStridedSliceOp -> ShuffleOp for the rank-1 cases.
This also fixes the vector.shuffle C++ builder which had an incorrect type assumption that triggers with this new rewrite.
The vector.shuffle semantics were correct though.
Differential revision: https://reviews.llvm.org/D112578
Kadir Cetinkaya [Tue, 26 Oct 2021 17:10:26 +0000 (19:10 +0200)]
[clangd] Fix filename ranges while replaying preamble
Clangd used first token of filename as filename range rather than the
synthezied filename token. Unfortunately the former only contains `"` or `<` in
the raw lexing mode, resulting in wrong range information and breaking tidy
checks that relied on it.
Fixes https://github.com/clangd/clangd/issues/896.
Differential Revision: https://reviews.llvm.org/D112559
Arthur Eubanks [Wed, 27 Oct 2021 06:41:02 +0000 (23:41 -0700)]
[InferAddressSpaces] Make pass work with opaque pointers
Avoid getPointerElementType().
Dmitry Vyukov [Tue, 26 Oct 2021 14:37:11 +0000 (16:37 +0200)]
tsan: tidy up SCOPED_INTERCEPTOR_RAW
Don't leak caller_pc var from the macro
(it's not supposed to be used by interceptors).
Use UNUSED instead of (void) cast.
Depends on D112540.
Reviewed By: melver
Differential Revision: https://reviews.llvm.org/D112541
Dmitry Vyukov [Tue, 26 Oct 2021 14:31:46 +0000 (16:31 +0200)]
tsan: remove real func check from interceptors
If the real function is not intercepted,
we are going to crash one way or another.
The question is just in the failure mode:
error message vs NULL deref. But the message
costs us a check in every interceptor and
they are not observed to be failing in real life
for a long time, also other sanitizers don't
have this check as well (also crash on
NULL deref if that happens).
Remove the check from non-debug mode.
Reviewed By: melver
Differential Revision: https://reviews.llvm.org/D112540
Kazu Hirata [Wed, 27 Oct 2021 06:38:14 +0000 (23:38 -0700)]
[Hexagon] Remove set-but-unused variables (NFC)
Pavel Labath [Thu, 21 Oct 2021 18:13:45 +0000 (20:13 +0200)]
Remove ConstString from Language, LanguageRuntime, SystemRuntime and SymbolFile plugin names
Phoebe Wang [Wed, 27 Oct 2021 05:58:31 +0000 (13:58 +0800)]
[X86][NFC] Add the missed `break;` for
79f9dfef0da5
Uday Bondhugula [Tue, 19 Oct 2021 07:19:01 +0000 (12:49 +0530)]
[Clang][NFC] Clang CUDA codegen clean-up
Update an instance of dyn_cast -> cast and other NFC clang-tidy fixes
for Clang CUDA codegen.
Differential Revision: https://reviews.llvm.org/D112284
Craig Topper [Wed, 27 Oct 2021 05:23:48 +0000 (22:23 -0700)]
[RISCV] Add ICmp and FCmp to shouldSinkOperands.
River Riddle [Wed, 27 Oct 2021 04:11:49 +0000 (04:11 +0000)]
Fix AffineDemotion pass after the DialectConversion change in D111620
Kazu Hirata [Wed, 27 Oct 2021 04:01:29 +0000 (21:01 -0700)]
[Utils] Fix a warning in DialectConversion.cpp
This patch fixes:
mlir/lib/Transforms/Utils/DialectConversion.cpp:2775:5: error:
default label in switch which covers all enumeration values
[-Werror,-Wcovered-switch-default]
by removing the default case. This way, the compiler should issue a
warning in the future when somebody adds a new enum value without a
corresponding case in the switch statement.
Lang Hames [Wed, 27 Oct 2021 01:32:06 +0000 (18:32 -0700)]
[JITLink] Fix element-present check in MachOLinkGraphParser.
Not all symbols are added to the index-to-symbol map, so we shouldn't use the
size of the map as a proxy for the highest valid index.
Lang Hames [Mon, 25 Oct 2021 22:06:45 +0000 (15:06 -0700)]
[ORC] Don't try to perform empty deallocations.
Jake Egan [Wed, 27 Oct 2021 03:42:15 +0000 (23:42 -0400)]
Generalize DWARF tests that expect DW_FORM_strp
The modified tests were failing on AIX because DWARF on AIX uses inline strings by default, but the tests check for `DW_FORM_strp`.
This patch removes `DW_FORM_strp` so both forms will pass the check.
Reviewed By: shchenz, dblaikie
Differential Revision: https://reviews.llvm.org/D112286
Max Kazantsev [Wed, 27 Oct 2021 02:28:45 +0000 (09:28 +0700)]
[SCEV][NFC] Verify intergity of SCEVUsers
Make sure that, for every living SCEV, we have all its direct
operand tracking it as their user.
Differential Revision: https://reviews.llvm.org/D112402
Reviewed By: reames
Ben Shi [Sun, 17 Oct 2021 12:27:57 +0000 (12:27 +0000)]
[RISCV] Optimize immediate materialisation with SLLI.UW in the Zba extension
Simplify "LUI+SLLI+ADDI+SLLI" and "LUI+ADDIW+SLLI+ADDI+SLLI" to
"LUI+ADDIW+SLLIUW" to reduce total instruction amount.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D111933
Ben Shi [Sat, 16 Oct 2021 09:06:14 +0000 (09:06 +0000)]
[RISCV][test] Add more tests of immediate materialisation
Reviewed By: craig.topper, MaskRay
Differential Revision: https://reviews.llvm.org/D111932
River Riddle [Wed, 27 Oct 2021 02:00:10 +0000 (02:00 +0000)]
[mlir:DialectConversion] Restructure how argument/target materializations get invoked
The current implementation invokes materializations
whenever an input operand does not have a mapping for the
desired type, i.e. it requires materialization at the earliest possible
point. This conflicts with goal of dialect conversion (and also the
current documentation) which states that a materialization is only
required if the materialization is supposed to persist after the
conversion process has finished.
This revision refactors this such that whenever a target
materialization "might" be necessary, we insert an
unrealized_conversion_cast to act as a temporary materialization.
This allows for deferring the invocation of the user
materialization hooks until the end of the conversion process,
where we actually have a better sense if it's actually
necessary. This has several benefits:
* In some cases a target materialization hook is no longer
necessary
When performing a full conversion, there are some situations
where a temporary materialization is necessary. Moving forward,
these users won't need to provide any target materializations,
as the temporary materializations do not require the user to
provide materialization hooks.
* getRemappedValue can now handle values that haven't been
converted yet
Before this commit, it wasn't well supported to get the remapped
value of a value that hadn't been converted yet (making it
difficult/impossible to convert multiple operations in many
situations). This commit updates getRemappedValue to properly
handle this case by inserting temporary materializations when
necessary.
Another code-health related benefit is that with this change we
can move a majority of the complexity related to materializations
to the end of the conversion process, instead of handling adhoc
while conversion is happening.
Differential Revision: https://reviews.llvm.org/D111620
River Riddle [Wed, 27 Oct 2021 01:59:45 +0000 (01:59 +0000)]
[NFC] Tidy up DialectConversion.cpp
This file has gotten a bit crusty over the years, and has outdated stylistic decisions.
Ben Shi [Tue, 26 Oct 2021 08:39:51 +0000 (08:39 +0000)]
[CUDA][NFC] Fix inexact warning message about lambdas
Reviewed By: tra
Differential Revision: https://reviews.llvm.org/D112521
Nico Weber [Wed, 27 Oct 2021 01:05:48 +0000 (21:05 -0400)]
Unbreak code_signature_lc.test on macOS after
911be05743eb606
Daniel Rodríguez Troitiño [Wed, 27 Oct 2021 00:03:08 +0000 (17:03 -0700)]
[test][objcopy] Replace GNU sed extension with BSD compatible syntax.
GNU sed offers the `,+4d` to delete the line a next four lines, but BSD
sed doesn't seem to support it (at least in macOS 10.15, but seems to do
in my 11.6 version).
Replace the usage of the extension with the equivalent syntax that works
both in BSD and GNU sed. I don't have a macOS 10.15 to check, but this
works in both my macOS 11.6 and Linux machines.
Differential Revision: https://reviews.llvm.org/D112583
Jacques Pienaar [Wed, 27 Oct 2021 00:35:16 +0000 (17:35 -0700)]
[mlir] Fix missing prefix for region accessor on OpAdaptor
Also flip op-decl-and-defs test to _Prefixed to test more.
Brad Smith [Wed, 27 Oct 2021 00:05:12 +0000 (20:05 -0400)]
[mlir] Avoid including <alloca.h> on OpenBSD
Luís Ferreira [Tue, 26 Oct 2021 23:23:27 +0000 (16:23 -0700)]
[Demangle] Add prepend functionality to OutputString
Implement the functionallity of prepend, required by D demangler.
Please read discussion https://reviews.llvm.org/D111414 for context.
See also https://reviews.llvm.org/D111947 .
Reviewed By: dblaikie, Geod24
Differential Revision: https://reviews.llvm.org/D111948
David Blaikie [Tue, 26 Oct 2021 23:19:38 +0000 (16:19 -0700)]
Add cross-project-test for simplified template name rebuilding
LLVM GN Syncbot [Tue, 26 Oct 2021 23:05:31 +0000 (23:05 +0000)]
[gn build] Port
566bfbb740bb
Jacques Pienaar [Tue, 26 Oct 2021 23:04:15 +0000 (16:04 -0700)]
[mlir][ods] Fix incorrect accessing of segment_sizes
The previous change resulted in prefixing a query that uses the raw
attribute as if function invocation. Fixing quickly, with updated test
to follow.
Jez Ng [Tue, 26 Oct 2021 22:40:20 +0000 (18:40 -0400)]
[lld-macho] Fix compact-unwind-bad-reloc.s test
Broken by
a9353dbe517c522ac63818de2cde645acdc46834.
Now that the functions point to the compact unwind entries, instead of
the other way around, we need to perform the "invalid reference" check
in a different place.
This change was originally part of the stacked diff D109946, but should
have been included as part of D109945.
David Blaikie [Tue, 26 Oct 2021 22:48:20 +0000 (15:48 -0700)]
llvm-dwarfdump --verify: Exit non-zero on simplified template name rebuilding failures
Nico Weber [Tue, 26 Oct 2021 22:40:07 +0000 (18:40 -0400)]
Reland "[gn build] (manually) port
6fe2beba7d2a (ExceptionTests)"
This reverts commit
e2a2e5475cbd370044474e132a1b5c58e6a3d458.
6fe2beba7d2a relanded (again) in
c24a58081b527fa8.
Rob Suderman [Tue, 26 Oct 2021 22:08:05 +0000 (15:08 -0700)]
[tosa][mlir] Add bailout to TosaMakeBroadcastable for unranked case
Dyn-cast should be checked and bailed out if the dyn_cast failed.
Reviewed By: sjarus, NatashaKnk
Differential Revision: https://reviews.llvm.org/D112574
Austin Kerbow [Sat, 23 Oct 2021 05:06:41 +0000 (22:06 -0700)]
[AMDGPU] Use max waves for scheduler's initial occupancy target
The scheduler should set critical/excess register usage thresholds that
are guided by the maximum possible occupancy for the function. This
change is focused on setting proper lower bounds on register usage which
we would typically only see when a specific number of maximum waves is
requested with the "waves-per-eu" attribute, or by setting
"amdgpu-num-vgpr|sgpr" directly. This was broken previously. I have a
follow-on patch that will address issues with the scheduler not
targeting correct upper bounds on register usage which is typical with
launch bounds and min "waves-per-eu".
Changes by this patch:
Set the initial critical register usage thresholds to minimum values
that are determined by the maximum possible occupancy for the function,
or the number of allocatable registers, whichever is lower.
Avoid unisgned overflow if register limits are lower than the register
tracking "ErrorMargin", I.e. when using stress-regalloc=2.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D112373
Yuanfang Chen [Tue, 26 Oct 2021 20:58:43 +0000 (13:58 -0700)]
[DebugInfo] Skip ODRUniquing for mismatched tags
Otherwise, ODRUniquing would map some member method/variable MDNodes
to have enum type DIScope, resulting in invalid debug info and bad
DWARF.
- Add a Verifier check that when a 'scope:' operand is an ODR type that is not an enum.
- Makes ODRUniquing apply to only ODR types with the same tag so that the debuginfo/DWARF is well-formed.
Reviewed By: probinson, aprantl
Differential Revision: https://reviews.llvm.org/D111770
Greg Clayton [Tue, 26 Oct 2021 01:03:06 +0000 (18:03 -0700)]
Add new key/value pairs to the module statistics for "statistics dump".
The new key/value pairs that are added to each module's stats are:
"debugInfoByteSize": The size in bytes of debug info for each module.
"debugInfoIndexTime": The time in seconds that it took to index the debug info.
"debugInfoParseTime": The time in seconds that debug info had to be parsed.
At the top level we add up all of the debug info size, parse time and index time with the following keys:
"totalDebugInfoByteSize": The size in bytes of all debug info in all modules.
"totalDebugInfoIndexTime": The time in seconds that it took to index all debug info if it was indexed for all modules.
"totalDebugInfoParseTime": The time in seconds that debug info was parsed for all modules.
Differential Revision: https://reviews.llvm.org/D112501
Nuri Amari [Tue, 26 Oct 2021 21:25:34 +0000 (14:25 -0700)]
Regenerate LC_CODE_SIGNATURE during llvm-objcopy operations
**Context:**
This is a second attempt at introducing signature regeneration to llvm-objcopy. In this diff: https://reviews.llvm.org/D109840, a script was introduced to test
the validity of a code signature. In this diff: https://reviews.llvm.org/D109803 (now reverted), an effort was made to extract the signature generation behavior out of LLD into a common location for use in llvm-objcopy. In this diff: https://reviews.llvm.org/D109972 it was decided that there was no appropriate common location and that a small amount of duplication to bring signature generation to llvm-objcopy would be better. This diff introduces this duplication.
**Summary**
Prior to this change, if a LC_CODE_SIGNATURE load command
was included in the binary passed to llvm-objcopy, the command and
associated section were simply copied and included verbatim in the
new binary. If rest of the binary was modified at all, this results
in an invalid Mach-O file. This change regenerates the signature
rather than copying it.
The code_signature_lc.test test was modified to include the yaml
representation of a small signed MachO executable in order to
effectively test the signature generation.
Reviewed By: alexander-shaposhnikov, #lld-macho
Differential Revision: https://reviews.llvm.org/D111164
Danil Stefaniuc [Tue, 26 Oct 2021 21:24:46 +0000 (14:24 -0700)]
[formatters] Add a libstdcpp formatter for bitset and unify tests across stdlibs
This diff adds a data formatter for libstdcpp's bitset. Besides, it unifies the tests for bitset for libcxx and libstdcpp for maintainability.
Reviewed By: wallace
Differential Revision: https://reviews.llvm.org/D112180
Sanjay Patel [Tue, 26 Oct 2021 21:41:19 +0000 (17:41 -0400)]
[InstCombine] try to canonicalize icmp with trunc op into mask and cmp
The motivating test is based on:
https://llvm.org/PR52260
We have better analysis for X == 0, so try harder to form that.
Sanjay Patel [Tue, 26 Oct 2021 21:09:10 +0000 (17:09 -0400)]
[InstCombine] add tests for icmp with trunc op; NFC
Aart Bik [Tue, 26 Oct 2021 21:16:05 +0000 (14:16 -0700)]
[mlir][sparse] refine trait of sparse_tensor.convert
Rationale:
The currently used trait was demanding that all types are the same
which is not true (since the sparse part may change and the dim sizes
may be relaxed). This revision uses the correct trait and makes the
rank match test explicit in the verify method.
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D112576
William Muir [Tue, 26 Oct 2021 21:23:11 +0000 (14:23 -0700)]
[Bazel] link backtrace library when building llvm/lib/Support under FreeBSD
Links the backtrace library which is required under FreeBSD when building llvm/lib/Support. This library is similarly linked by CMake on BSD builds at [llvm/lib/Support/CMakeLists.txt](https://github.com/llvm/llvm-project/blob/
e158b5634aa67ea3039a62c3d8bda79b77b3b21c/llvm/lib/Support/CMakeLists.txt#L39-L46)
Reviewed By: GMNGeoffrey
Differential Revision: https://reviews.llvm.org/D110533
Alexey Bataev [Tue, 26 Oct 2021 21:04:05 +0000 (14:04 -0700)]
[SLP][NFC]Add a test for poison-free or reduction.
Aart Bik [Tue, 26 Oct 2021 03:10:42 +0000 (20:10 -0700)]
[mlir][sparse] refactor loop sequence codegen
This refactoring adds a few "event" functions (start/end loop-seq/loop) for
readability of the core function of codegen. This also prepares sparse tensor
output codegen, where these "event" functions will provide convenient
placeholders to start or stop insertion bookkeeping.
This revision also includes a few various minor changes that kept on
pending in my local workspace.
Reviewed By: bixia
Differential Revision: https://reviews.llvm.org/D112506
Jon Chesterfield [Tue, 26 Oct 2021 20:18:19 +0000 (21:18 +0100)]
[libomptarget][nfc]Generalise DeviceRTL cmake to allow building for amdgpu
Essentially moves the foreach over sm integers into a macro and instantiates it for nvptx.
NFC in that the macro is not presently instantiated for amdgpu as the corresponding code doesn't compile yet.
Reviewed By: Meinersbur
Differential Revision: https://reviews.llvm.org/D111987
Jez Ng [Tue, 26 Oct 2021 20:04:06 +0000 (16:04 -0400)]
[lld-macho] Simplify the handling of "no unwind info" functions
This diff does away with `addEntriesForFunctionsWithoutUnwindInfo()`,
because `addSymbol()` can now determine which functions need those
entries.
While overhauling UnwindInfoSection, I also parallelized the relocation
of the contents of the CUEs. This somewhat offsets the time regression
from creating one InputSection per CUE (which was done in D109944).
Reviewed By: #lld-macho, oontvoo
Differential Revision: https://reviews.llvm.org/D109945
Jez Ng [Tue, 26 Oct 2021 20:04:04 +0000 (16:04 -0400)]
[lld-macho] Associate compact unwind entries with function symbols
Compact unwind entries (CUEs) contain pointers to their respective
function symbols. However, during the link process, it's far more useful
to have pointers from the function symbol to the CUE than vice versa.
This diff adds that pointer in the form of `Defined::compactUnwind`.
In particular, when doing dead-stripping, we want to mark CUEs live when
their function symbol is live; and when doing ICF, we want to dedup
sections iff the symbols in that section have identical CUEs. In both
cases, we want to be able to locate the symbols within a given section,
as well as locate the CUEs belonging to those symbols. So this diff also
adds `InputSection::symbols`.
The ultimate goal of this refactor is to have ICF support dedup'ing
functions with unwind info, but that will be handled in subsequent
diffs. This diff focuses on simplifying `-dead_strip` --
`findFunctionsWithUnwindInfo` is no longer necessary, and
`Defined::isLive()` is now a lot simpler. Moreover, UnwindInfoSection no
longer has to check for dead CUEs -- we simply avoid adding them in the
first place.
Additionally, we now support stripping of dead LSDAs, which follows
quite naturally since `markLive()` can now reach them via the CUEs.
Reviewed By: #lld-macho, gkm
Differential Revision: https://reviews.llvm.org/D109944
Stanislav Mekhanoshin [Tue, 26 Oct 2021 19:57:17 +0000 (12:57 -0700)]
[InstCombine] Precommit new and-xor-or.ll tests. NFC.
Valentin Clement [Tue, 26 Oct 2021 19:42:26 +0000 (21:42 +0200)]
[fir] Avoid slice with substr in fir.array_load, fir.array_coor and fir.array_merge_store
Substring information on slice operation has been added in D112441.
The operations fir.array_load, fir.array_coor and fir.array_merge_store can take
a slice but not with a substring. This patch add this check in their verifier.
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: schweitz
Differential Revision: https://reviews.llvm.org/D112568
Alexander Belyaev [Tue, 26 Oct 2021 19:35:49 +0000 (21:35 +0200)]
[mlir] Use float literals to make Windows build happy.
Vassil Vassilev [Mon, 25 Oct 2021 17:52:20 +0000 (17:52 +0000)]
Reinstate "[clang-repl] Re-implement clang-interpreter as a test case."
Original commit message: "
Original commit message: "
Original commit message: "
Original commit message:"
The current infrastructure in lib/Interpreter has a tool, clang-repl, very
similar to clang-interpreter which also allows incremental compilation.
This patch moves clang-interpreter as a test case and drops it as conditionally
built example as we already have clang-repl in place.
"
This patch also ignores ppc due to missing weak symbol for __gxx_personality_v0
which may be a feature request for the jit infrastructure. Also, adds a missing
build system dependency to the orc jit.
"
Additionally, this patch defines a custom exception type and thus avoids the
requirement to include header <exception>, making it easier to deploy across
systems without standard location of the c++ headers.
"
This patch also works around PR49692 and finds a way to use llvm::consumeError
in rtti mode.
"
This patch also checks if stl is built with rtti.
Differential revision: https://reviews.llvm.org/D107049
Florian Hahn [Tue, 26 Oct 2021 19:19:36 +0000 (20:19 +0100)]
[Matrix] Replace some err kinds with err_builtin_invalid_arg_type. (NFC)
Replace some custom matrix diagnostic kinds with the more generic
err_builtin_invalid_arg_type introduced in D111985.
Reviewed By: aaron.ballman, erichkeane
Differential Revision: https://reviews.llvm.org/D112532
Alexander Belyaev [Tue, 26 Oct 2021 19:27:20 +0000 (21:27 +0200)]
[mlir] Update Erf approximation.
Valentin Clement [Tue, 26 Oct 2021 19:12:36 +0000 (21:12 +0200)]
[fir][NFC] Move RewritePatterns.td to CanonicalizationPatterns.td in Dialect
RewritePatterns.td/RewritePatterns.inc is used only by the
FIROps.cpp file. This patch move this file logically in the Dialect
folder together with FIRDialet, FIROps, FIRTypes ...
It also rename it to CanonicalizationPatterns.td.
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: schweitz
Differential Revision: https://reviews.llvm.org/D112522
Michał Górny [Tue, 26 Oct 2021 19:08:03 +0000 (21:08 +0200)]
[lldb] [unittests] Fix TcpListen() call in RNBSocketTest
Julian Lettner [Tue, 26 Oct 2021 18:43:04 +0000 (11:43 -0700)]
[TSan] Ensure test uses tagged pointer
This is a test-only failure. The test wrongly assumes that this gets us
a tagged pointer:
```
NSObject* num1 = @7;
assert(isTaggedPtr(num1));
```
However, on newer deployment targets that have “const data support” we
get a “normal” pointer to constant object.
Radar-Id: rdar://problem/
83217293
Alexander Belyaev [Tue, 26 Oct 2021 18:39:25 +0000 (20:39 +0200)]
[mlir] Allow polynomial approximations for N-d vectors.
Polynomial approximation can be extented to support N-d vectors.
N-dimensional vectors are useful when vectorizing operations on N-dimensional
tiles. Before lowering to LLVM these vectors are usually unrolled or flattened
to 1-dimensional vectors.
Differential Revision: https://reviews.llvm.org/D112566
Stella Laurenzo [Tue, 26 Oct 2021 17:14:50 +0000 (17:14 +0000)]
[mlir][python] Segment MLIR Python test dialect to avoid testonly dependency.
With https://reviews.llvm.org/rG14c9207063bb00823a5126131e50c93f6e288bd3, the build is broken with -DMLIR_INCLUDE_TESTS=OFF. This patch fixes the build and we may want to do a better fix to the layering in a followup.
Differential Revision: https://reviews.llvm.org/D112560
Fangrui Song [Tue, 26 Oct 2021 18:44:18 +0000 (11:44 -0700)]
[ARC] Fix `undefined symbol: llvm::MachineFunction::dump() const`
Luke Petre [Tue, 26 Oct 2021 18:02:08 +0000 (14:02 -0400)]
[AST] Fix the EndLoc calculation for ObjCObjectPointer
There is an issue where the AST code does not compute the correct SourceRange
for a ObjCObjectPointer.
From Richard Smith (ie @zygoloid) in discord:
I think the problem is that we set an invalid location for the * (because there
isn't one): https://github.com/llvm/llvm-project/blob/main/clang/lib/Sema/SemaType.cpp#L1121
And then we use the default getLocalSourceRangeImpl for a PointerLikeTypeLoc
that just assumes the * location is the type's end location:
https://github.com/llvm/llvm-project/blob/main/clang/include/clang/AST/TypeLoc.h#L1293
Possibly we should be special-casing that here:
https://github.com/llvm/llvm-project/blob/main/clang/lib/AST/TypeLoc.cpp#L228
My change:
introduces a AST dump test to show the issue in the first commit
special cases ObjCObjectPointerType in the second commit to correctly compute
the end location
Zahira Ammarguellat [Tue, 26 Oct 2021 16:18:28 +0000 (12:18 -0400)]
Fix indentation and pragma name.
zhijian [Tue, 26 Oct 2021 17:56:52 +0000 (13:56 -0400)]
address an test error on window os , exclude the test llvm/test/tools/llvm-readobj/XCOFF/xcoff-auxiliary-header.test from
windows OS.
http://45.33.8.238/win/47662/step_11.txt
for
https://reviews.llvm.org/D82549
Dmitry Vyukov [Tue, 26 Oct 2021 17:47:34 +0000 (19:47 +0200)]
Revert "tsan: turn off COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED"
This reverts commit
5ec832269eedeeddcf00d34efd7272a107e2c7c1.
It broke a number of bots, e.g.:
https://lab.llvm.org/buildbot/#/builders/52/builds/11811
Reviewed By: melver
Differential Revision: https://reviews.llvm.org/D112563
Joe Loser [Tue, 26 Oct 2021 17:45:52 +0000 (13:45 -0400)]
[libc++][NFC] Mark LWG2731 as complete
Mark LWG2731 as complete. The type alias `mutex_type` is only provided if
`scoped_lock` is given one mutex type and it has been implemented that
way since the beginning of Clang 5 it seems. There already are tests for
verifying existence (and lack thereof) for `mutex_type` type alias
depending on the number of mutex types, so there is nothing to
do for this LWG issue.
Reviewed By: Quuxplusone, Mordante, #libc
Differential Revision: https://reviews.llvm.org/D112462
Chia-hung Duan [Tue, 26 Oct 2021 17:35:15 +0000 (17:35 +0000)]
[mlir] Placeholder used in predicate should be the base type
Added a notification in the placeholder section. While writing things
like preciate of an attribute, we may embed certain placeholder in the C
expression. Note that the type of the placeholder is only guaranteed to
be the base type like mlir::Type, it's better not to use the derived
type which is based on the implementation.
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D112396
Usman Nadeem [Tue, 26 Oct 2021 17:22:17 +0000 (10:22 -0700)]
[NFC][Instcombine] Pre-commit some tests for negative fabs
Change-Id: Idcce321c825ecc6b3a111a683e24dc10015f6872
Alexey Bataev [Tue, 26 Oct 2021 17:11:26 +0000 (10:11 -0700)]
[SLP][NFC]Add a test for logical reduction with extra op.
Stanislav Mekhanoshin [Tue, 26 Oct 2021 17:09:21 +0000 (10:09 -0700)]
[InstCombine] Precommit new and-xor-or.ll tests. NFC.
Louis Dionne [Mon, 25 Oct 2021 19:05:27 +0000 (15:05 -0400)]
[libc++] Implement shared_ptr methods inline in the class
This patch refactors the shared_ptr methods from being defined out-of-line
to being defined inline in the class, like what we do for all new code in
the library. The benefits of doing that are that code is not as scattered
around and is hence easier to understand, and it avoids a ton of duplication
due to SFINAE checks. Defining the method where it is declared also removes
the possibility for mismatched attributes.
As a fly-by change, this also:
- Adds a few _LIBCPP_HIDE_FROM_ABI attributes
- Uses __enable_if_t instead of enable_if as a function argument, to match
the style that we use everywhere else.
Differential Revision: https://reviews.llvm.org/D112478
Usman Nadeem [Tue, 26 Oct 2021 17:07:08 +0000 (10:07 -0700)]
[NFC][Instcombine] Cleanup some obsolete matches in visitSelectInstr
These are now redundant after https://reviews.llvm.org/D106872
Change-Id: I82edfedf1d45cac4e3368d77ce3a48c78e342c19
Rosie Sumpter [Tue, 26 Oct 2021 10:24:28 +0000 (11:24 +0100)]
[LoopVectorize] Clean up VPReductionRecipe::execute. NFC
Use RdxDesc->getOpcode instead of getUnderlingInstr()->getOpcode.
Move the code which finds Kind and IsOrdered to be outside the for loop
since neither of these change with the vector part.
Differential Revision: https://reviews.llvm.org/D112547
Balazs Benics [Tue, 26 Oct 2021 16:15:00 +0000 (18:15 +0200)]
[analyzer] Fix StringChecker for Unknown params
It seems like protobuf crashed the `std::string` checker.
Somehow it acquired `UnknownVal` as the sole `std::string` constructor
parameter, causing a crash in the `castAs<Loc>()`.
This patch addresses this.
Reviewed By: martong
Differential Revision: https://reviews.llvm.org/D112551
Amy Zhuang [Tue, 26 Oct 2021 15:42:22 +0000 (08:42 -0700)]
[mlir] Fix getVectorReductionOp
1.Combining kind min/max of Vector reduction op has been changed to
minf/maxf, minsi/maxsi, and minui/maxui. Modify getVectorReductionOp
accordingly.
2.Add min/max to supported reductions.
Reviewed By: dcaballe, nicolasvasilache
Differential Revision: https://reviews.llvm.org/D112246
Kazu Hirata [Tue, 26 Oct 2021 16:01:29 +0000 (09:01 -0700)]
[CodeGen, Hexagon] Use MachineBasicBlock::phis (NFC)
Florian Hahn [Tue, 26 Oct 2021 14:38:32 +0000 (15:38 +0100)]
[Clang] Add elementwise min/max builtins.
This patch implements __builtin_elementwise_max and
__builtin_elementwise_min, as specified in D111529.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D111985
Sanjay Patel [Tue, 26 Oct 2021 14:44:19 +0000 (10:44 -0400)]
[x86] add test/run for mayLoadFold with alignment; NFC
Jez Ng [Tue, 26 Oct 2021 15:36:09 +0000 (11:36 -0400)]
[lld-macho] Put GOT into `__DATA` segment where appropriate
We were previously always emitting the GOT into `__DATA_CONST`, even for
target platforms where it should end up in `__DATA`.
I stumbled onto this while trying to use the `class-dump` tool -- with
the wrong segment names, it fails to locate the ObjC runtime info and
therefore fails to dump any classes.
Reviewed By: #lld-macho, oontvoo
Differential Revision: https://reviews.llvm.org/D112500
Adam Czachorowski [Tue, 26 Oct 2021 13:04:03 +0000 (15:04 +0200)]
[clangd] AddUsing: Fix support for template specializations.
Before this change, we would add "using std::vector<int>" instead of
just "using std::vector;", which would not even compile.
Fixes https://github.com/clangd/clangd/issues/904
Differential Revision: https://reviews.llvm.org/D112530
Adam Czachorowski [Tue, 26 Oct 2021 11:34:10 +0000 (13:34 +0200)]
[clangd] Fix a hover crash on templated spaceship operator.
We make assumption that:
getDeclForComment(getDeclForComment(X)) == getDeclForComment(X)
but this is not true if you have a template
instantionation of a template instantiation, which is the case when, for
example, you have a <=> operator in a templated class.
This fix makes getDeclForComment() call itself recursively to ensure
this property is always true.
Fixes https://github.com/clangd/clangd/issues/901
Differential Revision: https://reviews.llvm.org/D112527
Kirill Bobyrev [Tue, 26 Oct 2021 15:10:51 +0000 (17:10 +0200)]
[clang] Do not traverse EnumDecl's type in RecursiveASTVisitor
This is inconsistent with the code and comments in
RecursiveASTVisitor.h and is not a correct behavior:
https://github.com/llvm/llvm-project/blob/main/clang/include/clang/AST/RecursiveASTVisitor.h#L1879-L1880
> We shouldn't traverse D->getTypeForDecl(); it's a result of
> declaring the type, not something that was written in the source.
Fixes the failures in
1c2e249f938c50e1b331a1f7adc83c0a381f3897
Matt Morehouse [Tue, 26 Oct 2021 15:08:23 +0000 (08:08 -0700)]
[libFuzzer] Improve corpus replacement unit test.
Verify that SecondII is not replaced.
Jonas Paulsson [Tue, 19 Oct 2021 10:47:15 +0000 (12:47 +0200)]
[SystemZ] Improvement of emitMemMemWrapper()
It was discovered that an extra register COPY remained when expanding a
(variable length) memory operation with a loop and there was another use of
the involved address register(s) afterwards.
A simple fix for this is to COPY the address registers before the loop and
use that new vreg instead.
Review: Ulrich Weigand
Differential Revision: https://reviews.llvm.org/D112065
Alexey Bataev [Mon, 25 Oct 2021 16:40:59 +0000 (09:40 -0700)]
[SLP]Do not reorder reduction nodes.
The final reduction nodes should not be reordered, the order does not
matter for reductions. Also, it might be profitable to vectorize smaller
reduction trees, reduction cost may compensate small tree cost.
Part of D111574
Differential Revision: https://reviews.llvm.org/D112467
zhijian [Tue, 26 Oct 2021 14:40:25 +0000 (10:40 -0400)]
[AIX][XCOFF] parsing xcoff object file auxiliary header
Summary:
The patch supports parsing the xcoff object file auxiliary header with llvm-readobj with option "auxiliary-headers"
the format of auxiliary header as
https://www.ibm.com/support/knowledgecenter/en/ssw_aix_72/filesreference/XCOFF.html#XCOFF__fyovh386shar
Reviewers: James Henderson, Jason Liu, Hubert Tong, Esme yi, Sean Fertile.
Differential Revision: https://reviews.llvm.org/D82549
Florian Hahn [Mon, 25 Oct 2021 08:55:21 +0000 (09:55 +0100)]
Specify Clang vector builtins.
This patch specifies a set of vector builtins for Clang, as discussed on
cfe-dev:
https://lists.llvm.org/pipermail/cfe-dev/2021-September/068999.html
https://lists.llvm.org/pipermail/cfe-dev/2021-October/069070.html
Reviewed By: scanon
Differential Revision: https://reviews.llvm.org/D111529
Louis Dionne [Mon, 25 Oct 2021 14:59:59 +0000 (10:59 -0400)]
[libc++] Include nasty_macros.h when running tests with from-scratch configs
This was forgotten when setting up the from-scratch configs.
Differential Revision: https://reviews.llvm.org/D112460
Dmitry Vyukov [Mon, 25 Oct 2021 12:58:43 +0000 (14:58 +0200)]
tsan: turn off COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED
All tsan interceptors check for initialization and/or initialize things
as necessary lazily, so we can pretend everything is initialized in the
COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED check to avoid double-checking
for initialization (this is only necessary for sanitizers that don't
handle initialization on common grounds).
Reviewed By: melver
Differential Revision: https://reviews.llvm.org/D112446
Dmitry Vyukov [Tue, 26 Oct 2021 13:01:09 +0000 (15:01 +0200)]
sanitizer_common: fix deadlock detector output
Print PC of the previous lock, not the current one.
The current one will be printed during unwind.
Reviewed By: melver
Differential Revision: https://reviews.llvm.org/D112533
Kirill Bobyrev [Tue, 26 Oct 2021 14:08:54 +0000 (16:08 +0200)]
[clangd] IncludeCleaner: don't stop the traversal
I was under the impression that `return false;` in the
RecursiveASTVisitor stops the traversal for the subtree but it appears
that it stops the whole tree traversal, so this change introduces a bug
where `ReferencedLocationCrawler` will not collect any symbols past an
enum.
This is a follow-up on D112209.
Neubauer, Sebastian [Tue, 26 Oct 2021 13:45:10 +0000 (15:45 +0200)]
[AMDGPU] Remove unused CSR defs
CSR_AMDGPU_VGPRs_24_255 and CSR_AMDGPU_VGPRs_32_255 are not used
anywhere, so remove them.
Differential Revision: https://reviews.llvm.org/D112535
Ron Lieberman [Tue, 26 Oct 2021 01:53:15 +0000 (01:53 +0000)]
[openmp][lit] Add support to OpenMP lit.cfg for ROCR_VISIBLE_DEVICES env-var
add support for ROCR_VISIBLE_DEVICES similar to name and purpose
as CUDA_VISIBLE_DEVICES
Differential Revision: https://reviews.llvm.org/D112503
Nico Weber [Thu, 21 Oct 2021 10:53:12 +0000 (06:53 -0400)]
[clang] Implement CFG construction for @try and @catch
@finally is still not implemented.
With this, clang can emit -Wreturn-type warnings for functions containing
@try/@catch (but not yet @finally), and -Wunreachable-code also works for those
functions.
The implementation is similar to D36914.
Part of PR46693.
Differential Revision: https://reviews.llvm.org/D112287
Nico Weber [Tue, 26 Oct 2021 13:35:20 +0000 (09:35 -0400)]
[clang] Make loop in CFGBuilder::VisitCXXTryStmt() more canonical
No behavior change.
Nico Weber [Tue, 26 Oct 2021 13:29:41 +0000 (09:29 -0400)]
[clang] Simplify CFG block printing code a bit
No behavior change.
Nico Weber [Tue, 26 Oct 2021 13:23:16 +0000 (09:23 -0400)]
[clang] Use consistent punctuation at end of Block NULL comment
No behavior change.