Goran Flegar [Mon, 10 Oct 2022 14:27:53 +0000 (16:27 +0200)]
[mlir][Bazel] Fix for reviews.llvm.org/D135559
Erich Keane [Mon, 10 Oct 2022 14:22:41 +0000 (07:22 -0700)]
Possibly fix sphinx regression from
6685e56ceddf
It isn't clear that this is what it is complaining about, but looking
closer, I think this is what I got wrong here. So submitting this to
hope that the Sphinx build will be happy.
Erich Keane [Tue, 4 Oct 2022 19:41:43 +0000 (12:41 -0700)]
Disallow dereferencing of void* in C++.
as Discussed:
https://discourse.llvm.org/t/rfc-can-we-stop-the-extension-to-allow-dereferencing-void-in-c/65708
There is no good reason to allow this when the other compilers all
reject this, and it messes with SFINAE/constraint checking.
Differential Revision: https://reviews.llvm.org/D135287
Nicolas Vasilache [Mon, 10 Oct 2022 06:36:10 +0000 (23:36 -0700)]
[mlir][Linalg] Retire LinalgStrategyTileAndFusePass and filter-based pattern.
Context: https://discourse.llvm.org/t/psa-retire-linalg-filter-based-patterns/63785
In the process, also retire `tileConsumerAndFuseProducers` that is now replaced by `tileConsumerAndFuseProducerGreedilyUsingSCFForOp`.
Context: https://discourse.llvm.org/t/psa-retire-tileandfuselinalgops-method/63850
When performing this replacement, a change of behavior appeared: the older `tileConsumerAndFuseProducers` would split the parallel
and non-parallel dimensions automatically and perform a first level of tile-and-fuse on parallel dimensions only and then introduce a
second level of tiling-only on the reduction dimensions. The newer `tileConsumerAndFuseProducerGreedilyUsingSCFForOp` on the other hand
does not perform this breakdown. As a consequence, the transform specification is evolved to produce the same output.
Additionally, replace some uses of `unsigned` by `int64_t` where possible without pulling in larger interface changes (left for a future PR).
Context: https://www.youtube.com/watch?v=Puio5dly9N8
Lastly, tests that were performing tile and fuse and distribute on tensors are retired: the generated IR mixing scf.for, tensors and
distributed processor ids was racy at best ..
Differential Revision: https://reviews.llvm.org/D135559
Nico Weber [Mon, 10 Oct 2022 13:19:12 +0000 (09:19 -0400)]
[gn build] port
bc839b4b4e27
Sanjay Patel [Mon, 10 Oct 2022 11:21:23 +0000 (07:21 -0400)]
[InstCombine] fold udiv with common factor
((X *nuw Y) >> Z) / X --> Y >> Z
https://alive2.llvm.org/ce/z/x3kKnq
This is similar to
6b869be8100d /
8da2fa856f1b, but I have
not found a signed equivalent, so it's just an unsigned
match for now.
Sanjay Patel [Mon, 10 Oct 2022 11:08:38 +0000 (07:08 -0400)]
[InstCombine] add 'exact' to udiv test for more coverage; NFC
Sanjay Patel [Mon, 10 Oct 2022 10:51:43 +0000 (06:51 -0400)]
[PhaseOrdering] add test for sdiv with common factor; NFC
issue #58137
Aaron Ballman [Mon, 10 Oct 2022 11:53:52 +0000 (07:53 -0400)]
Fix clang-tools-extra Sphinx build
This should address the issues found in:
https://lab.llvm.org/buildbot/#/builders/115/builds/35504
Peter Rong [Mon, 10 Oct 2022 11:52:31 +0000 (12:52 +0100)]
[AArch64] Add index check before lowerInterleavedStore() uses ShuffleVectorInst's mask
This commit fixes https://github.com/llvm/llvm-project/issues/57326.
Currently we would take a Mask out and directly use it by doing
auto Mask = SVI->getShuffleMask();
However, if the mask is undef, this Mask is not initialized. It might be
a vector of -1 or random integers.
This would cause an Out-of-bound read later when trying to find a
StartMask.
This change checks if all indices in the Mask is in the allowed range,
and fixes the out-of-bound accesses.
Differential Revision: https://reviews.llvm.org/D132634
Michael Buch [Thu, 6 Oct 2022 23:35:05 +0000 (00:35 +0100)]
[lldb][CPlusPlusLanguage] Respect the step-avoid-regex for functions with auto return types
**Summary**
The primary motivation for this patch is to make sure we handle
the step-in behaviour for functions in the `std` namespace which
have an `auto` return type. Currently the default `step-avoid-regex`
setting is `^std::` but LLDB will still step into template functions
with `auto` return types in the `std` namespace.
**Details**
When we hit a breakpoint and check whether we should stop, we call
into `ThreadPlanStepInRange::FrameMatchesAvoidCriteria`. We then ask
for the frame function name via `SymbolContext::GetFunctionName(Mangled::ePreferDemangledWithoutArguments)`.
This ends up trying to parse the function name using `CPlusPlusLanguage::MethodName::GetBasename` which
parses the raw demangled name string.
`CPlusPlusNameParser::ParseFunctionImpl` calls `ConsumeTypename` to skip
the (in our case auto) return type of the demangled name (according to the
Itanium ABI this is a valid thing to encode into the mangled name). However,
`ConsumeTypename` doesn't strip out a plain `auto` identifier
(it will strip a `decltype(auto) return type though). So we are now left with
a basename that still has the return type in it, thus failing to match the `^std::`
regex.
Example frame where the return type is still part of the function name:
```
Process 1234 stopped
* thread #1, stop reason = step in
frame #0: 0x12345678 repro`auto std::test_return_auto<int>() at main.cpp:12:5
9
10 template <class>
11 auto test_return_auto() {
-> 12 return 42;
13 }
```
This is another case where the `CPlusPlusNameParser` breaks us in subtle ways
due to evolving C++ syntax. There are longer-term plans of replacing the hand-rolled
C++ parser with an alternative that uses the mangle tree API to do the parsing for us.
**Testing**
* Added API and unit-tests
* Adding support for ABI tags into the parser is a larger undertaking
which we would rather solve properly by using libcxxabi's mangle tree
parser
Differential Revision: https://reviews.llvm.org/D135413
David Spickett [Thu, 6 Oct 2022 10:41:42 +0000 (10:41 +0000)]
[LLDB] Complete set of char tests for static integral members
Previously we had a bit of a mix of "signed char" "unsigned char" and
"char".
This adds seperate min and max checks for all three types.
Depends on D135170
Reviewed By: Michael137
Differential Revision: https://reviews.llvm.org/D135352
Simon Giesecke [Mon, 10 Oct 2022 10:03:05 +0000 (12:03 +0200)]
Add llvm-gsymutil to the Bazel build files.
Differential Revision: https://reviews.llvm.org/D135568
Matt Devereau [Thu, 8 Sep 2022 11:22:11 +0000 (11:22 +0000)]
[AArch64][SVE] Fix AArch64_SVE_VectorCall calling convention
This fixes the case where callees with SVE arguments outside of the z0-z7
range were incorrectly deduced as SVE calling convention functions
Adeel Ahmad [Mon, 10 Oct 2022 08:31:50 +0000 (10:31 +0200)]
Extended Documentation of LLVM_TARGETS_TO_BUILD by listing all possible values
Differential Revision: https://reviews.llvm.org/D135431
Nikita Popov [Fri, 7 Oct 2022 09:54:17 +0000 (11:54 +0200)]
[Attributor] Use ConstantFoldLoadFromConst()
When determining the initial value of the object, use the constant
folding API to load a given type at a given offset in the global
initializer. This makes it work for cases where the load doesn't
directly correspond to an aggregate member.
Differential Revision: https://reviews.llvm.org/D135435
Nikita Popov [Fri, 7 Oct 2022 10:10:42 +0000 (12:10 +0200)]
[Bindings] Remove go bindings
Remove the unmaintained Go bindings per
https://discourse.llvm.org/t/rfc-remove-the-go-bindings/65725.
The tinygo project provides maintained Go bindings at
https://github.com/tinygo-org/go-llvm.
Differential Revision: https://reviews.llvm.org/D135436
Nikita Popov [Mon, 10 Oct 2022 07:53:34 +0000 (09:53 +0200)]
[AA] Remove deprecated ModRefInfo helpers (NFC)
Adrian Kuegel [Wed, 5 Oct 2022 08:08:18 +0000 (10:08 +0200)]
[mlir][Linalg] Use ConfinedAttr for dimensions of ReduceOp.
We can use the new DenseArrayStrictlySorted constraint.
Differential Revision: https://reviews.llvm.org/D135246
LLVM GN Syncbot [Mon, 10 Oct 2022 07:30:41 +0000 (07:30 +0000)]
[gn build] Port
1ae33bf42680
Carlos Galvez [Tue, 23 Aug 2022 06:14:03 +0000 (06:14 +0000)]
[clang-tidy] Add cppcoreguidelines-avoid-do-while check
Implements rule ES.75 of C++ Core Guidelines.
Differential Revision: https://reviews.llvm.org/D132461
Valentin Clement [Mon, 10 Oct 2022 06:58:20 +0000 (08:58 +0200)]
[flang] Allow conversion from boxed derived type to fir.class
This patch updates the fir.convert operation's verifier to allow
conversion from !fir.box<!fir.type<T>> to !fir.class<!fir.type<T>>.
Other conversion involving fir.class are likely needed but will
be added when lowering needs them.
Reviewed By: PeteSteinfeld
Differential Revision: https://reviews.llvm.org/D135445
LiaoChunyu [Sun, 9 Oct 2022 13:52:36 +0000 (21:52 +0800)]
[RISCV] Use hasAllWUsers to recover XORI/ORI
reference
0fbe71e91f44.
Also add testcase for addi.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D135538
Lang Hames [Mon, 10 Oct 2022 05:00:43 +0000 (22:00 -0700)]
[examples] Fix deprecated use of llvm::empty.
Lang Hames [Mon, 10 Oct 2022 04:54:35 +0000 (21:54 -0700)]
[ORC] Relax assertions in SimpleRemoteEPCTransport.
Null source/destination pointers are ok for zero-sized messages.
Lang Hames [Mon, 10 Oct 2022 04:54:09 +0000 (21:54 -0700)]
[LLJIT] Default to EPCEHFrameRegistrar rather than InProcessEHFrameRegistrar.
Now that ExecutionSession objects alway have ExecutorProcessControl (EPC)
objects attached we can use EPCEHFrameRegistrar by default, rather than
InProcessEHFrameRegistrar. This allows LLJIT to work out-of-the-box with remote
EPCs on platforms that use JITLink, without requiring a custom
ObjectLinkingLayerCreator to override the eh-frame registrar.
Craig Topper [Mon, 10 Oct 2022 03:40:38 +0000 (20:40 -0700)]
[RISCV] Remove some vsetvli intrinsics under Zve32*.
Zve32* does not support SEW=64. Or any LMUL smaller than 32/SEW.
Reviewed By: eopXD
Differential Revision: https://reviews.llvm.org/D135519
Kai Luo [Mon, 10 Oct 2022 01:38:38 +0000 (09:38 +0800)]
[tsan][go] Fix string equal operator
Fixed error
```
compiler-rt/lib/tsan/go/buildgo.sh: 62: [: unexpected operator
```
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D135537
Mehdi Amini [Thu, 6 Oct 2022 18:54:20 +0000 (18:54 +0000)]
Apply clang-tidy fixes for modernize-use-equals-default in Bufferize.cpp (NFC)
Mehdi Amini [Thu, 6 Oct 2022 18:42:49 +0000 (18:42 +0000)]
Apply clang-tidy fixes for readability-identifier-naming in TosaToLinalg.cpp (NFC)
Mingming Liu [Tue, 4 Oct 2022 21:39:50 +0000 (14:39 -0700)]
[AArch64] Swap 'lsl(val1,small-shmt)' to right hand side for AND(lsl(val1,small-shmt), lsl(val2,large-shmt))
On many aarch64 processors (Cortex A78, Neoverse N1/N2/V1, etc), ADD with LSL shift (shift-amount <= 4) has smaller latency and higher
throughput than ADD with larger shift (shift-amunt > 4). This is at least no-op for the rest of the processors.
Differential Revision: https://reviews.llvm.org/D135208
Mingming Liu [Tue, 4 Oct 2022 21:31:35 +0000 (14:31 -0700)]
[AArch64][NFC] Precommit test case to show sub-optimal codegen for add(lsl(val1,small-shift), lsl(val2,large-shift)).
Ideally, add operand with smaller shift should be RHS. In that way, smaller-shift is folded into ADD.
- Also add another test case when 'lsl(val1,small-shift)' has one than one use, to show the (planned) optimization won't regress this case.
Florian Hahn [Sun, 9 Oct 2022 20:51:54 +0000 (21:51 +0100)]
[ConstraintElimination] Include index type scale.
The current decomposition for GEPs did not correctly handle cases where
GEPs access different source types. Adjust the constraints by including
the indexed type-size as coefficients.
Further generalization to allow GEPs with more than one index is a
needed general follow-up improvement.
Florian Hahn [Sun, 9 Oct 2022 20:51:47 +0000 (21:51 +0100)]
[ConstraintElimination] Add tests for GEPs with different source types.
luxufan [Mon, 3 Oct 2022 17:21:08 +0000 (17:21 +0000)]
[DSE][NFC] Add nounwind attribute to match test intent
Differential Revision: https://reviews.llvm.org/D135533
luxufan [Wed, 5 Oct 2022 20:38:49 +0000 (20:38 +0000)]
[DSE] Relax constraint on isGuaranteedLoopInvariant
If the location ptr to be killed is in no loop and the Function does not
have irreducible loops, then we can regard it as loop invariant.
Differential Revision: https://reviews.llvm.org/D135369
Yeting Kuo [Thu, 6 Oct 2022 14:55:52 +0000 (22:55 +0800)]
[RISCV][NFC] Fix unused variable warning.
Reviewed By: reames
Differential Revision: https://reviews.llvm.org/D135365
mydeveloperday [Sun, 9 Oct 2022 10:16:58 +0000 (11:16 +0100)]
[clang-format] Add support to remove unnecessary semicolons after function definition
Fixes: https://github.com/llvm/llvm-project/issues/58217
This change is to remove extraneous and unnecessary ';' from after a function definition, its off by default and carries the same "code modification" warning as some of our other code manipulating changes.
Reviewed By: HazardyKnusperkeks, owenpan
Differential Revision: https://reviews.llvm.org/D135466
Tom Praschan [Fri, 7 Oct 2022 23:24:13 +0000 (01:24 +0200)]
[clangd] Fix rename for symbol introduced by UsingDecl
Fixes https://github.com/clangd/clangd/issues/170
This patch actually consists of 2 fixes:
1) Add handling for UsingShadowDecl to canonicalRenameDecl().
This fixes the issue described in https://github.com/clangd/clangd/issues/170.
2) Avoid the "there are multiple symbols under the cursor error" by applying similar
logic as in https://reviews.llvm.org/D133664.
This also partly fixes https://github.com/clangd/clangd/issues/586.
Differential Revision: https://reviews.llvm.org/D135489
gonglingqin [Sun, 9 Oct 2022 09:51:10 +0000 (17:51 +0800)]
[LoongArch] Expand fptrunc store from f64 to f32
Differential Revision: https://reviews.llvm.org/D135510
Florian Hahn [Sun, 9 Oct 2022 09:44:35 +0000 (10:44 +0100)]
[ConstraintElim] Move logic to get constraint for solving to helper.
Move common logic shared by callers of getConstraint that use the result
to query the constraint system to a new helper getConstraintForSolving.
This includes common legality checks (i.e. not an equality constraint,
no new variables) and the logic to query the unsigned system if possible
for signed predicates.
LLVM GN Syncbot [Sun, 9 Oct 2022 07:11:39 +0000 (07:11 +0000)]
[gn build] Port
a2c6a1193f41
Hui Xie [Fri, 30 Sep 2022 12:06:36 +0000 (13:06 +0100)]
[libc++][ranges]implement `std::views::take_while`
Differential Revision: https://reviews.llvm.org/D134952
Chuanqi Xu [Sun, 9 Oct 2022 06:54:32 +0000 (14:54 +0800)]
[C++20] [Coroutines] Exit early if we found co_await appears in
unevaluated context
Closes https://github.com/llvm/llvm-project/issues/58133
The direct cause for this issue is that the compilation process
continues after it found it is in a invalid state. [expr.await]p2 says
clearly that the co_await expressions are not allowed to appear in
unevaluated context. So we can exit early in this case. It also reduces
many redundant diagnostic messages (Such as 'expression with side
effects has no effect in an unevaluated context').
Ting Wang [Sun, 9 Oct 2022 05:23:18 +0000 (01:23 -0400)]
[PowerPC] Add vector pair calling convention for AIX
This is AIX part of update after https://reviews.llvm.org/D117225
Fixed the issue that AIX64 with vector pair enabled saw redundant
spill/reload of callee saved vector registers.
Based on original patch by: Kai Luo
Reviewed By: lkail
Differential Revision: https://reviews.llvm.org/D133466
WANG Xuerui [Sun, 9 Oct 2022 04:09:21 +0000 (12:09 +0800)]
[LoongArch] Don't merge FrameIndex accesses into [F]{LD,ST}X
Otherwise eliminateFrameIndex cannot figure out how to fixup the stack
offset with its stateless logic, because there wouldn't be an immediate
slot for it to trivially write to, and it may not be easy to transform
the surrounding code to make it work.
This fixes a fairly common crash when compiling moderately complex code with
Clang.
Differential Revision: https://reviews.llvm.org/D135251
Keith Smiley [Sun, 9 Oct 2022 03:38:00 +0000 (20:38 -0700)]
[lld-macho] Implement -ignore_auto_link
This option is really only useful for things like debugging
https://github.com/llvm/llvm-project/issues/56939, but there are some
actual uses of it in Swift's build system as well.
Differential Revision: https://reviews.llvm.org/D135528
Petr Hosek [Thu, 29 Sep 2022 07:53:06 +0000 (07:53 +0000)]
[CMake] Use libcxx-abi-* targets for in-tree sanitizer C++ ABI
When in-tree libcxx is selected as the sanitizer C++ ABI, use
libcxx-abi-* targets rather than libcxxabi and libunwind directly.
Differential Revision: https://reviews.llvm.org/D134855
Craig Topper [Sun, 9 Oct 2022 01:39:45 +0000 (18:39 -0700)]
Remove myself as X86 Backend owner.
Craig Topper [Sat, 8 Oct 2022 17:49:52 +0000 (10:49 -0700)]
[RISCV] Merge more rv32/rv64 vector intrinsic tests that contain the same content.
Phoebe Wang [Sun, 9 Oct 2022 00:50:16 +0000 (08:50 +0800)]
Add myself to CREDITS.TXT + CODE_OWNERS.TXT
See https://discourse.llvm.org/t/proposed-change-to-x86-code-ownership/65620
Tatsuyuki Ishi [Sun, 9 Oct 2022 00:58:07 +0000 (00:58 +0000)]
[Support] Add fast path for StringRef::find with needle of length 2.
InclusionRewriter on Windows (CRLF line endings) will exercise this in a
hot path. Calling memcmp repeatedly would be highly suboptimal for that
use case, so give it a specialized path.
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D133660
Anton Bikineev [Thu, 22 Sep 2022 14:56:03 +0000 (16:56 +0200)]
[PGO] Consider parent context when weighing branches with likelyhood.
Generally, with PGO enabled the C++20 likelyhood attributes shall be
dropped assuming the profile has a good coverage. However, currently
this is not the case for the following code:
if (always_false()) [[likely]] {
...
}
The patch fixes this and drops the attribute, if the parent context was
executed in the profile. The patch still preserves the attribute, if the
parent context was not executed, e.g. to support the cases when the
profile has insufficient coverage.
Differential Revision: https://reviews.llvm.org/D134456
Simon Pilgrim [Sat, 8 Oct 2022 21:19:50 +0000 (22:19 +0100)]
Add myself to CREDITS.TXT + CODE_OWNERS.TXT
Phoebe Wang and I are replacing Craig Topper as X86 Code Owners: https://discourse.llvm.org/t/proposed-change-to-x86-code-ownership/65620
Florian Hahn [Sat, 8 Oct 2022 18:39:36 +0000 (19:39 +0100)]
[ConstraintElimination] Add tests for chained GEPs without inbounds.
Mehdi Amini [Thu, 6 Oct 2022 18:41:58 +0000 (18:41 +0000)]
Apply clang-tidy fixes for llvm-else-after-return in TosaToLinalg.cpp (NFC)
Mehdi Amini [Thu, 6 Oct 2022 18:21:47 +0000 (18:21 +0000)]
Apply clang-tidy fixes for performance-unnecessary-value-param in IRCore.cpp (NFC)
Fangrui Song [Sat, 8 Oct 2022 18:09:42 +0000 (11:09 -0700)]
[LTO] Make local linkage GlobalValue in non-prevailing COMDAT available_externally
See the updated linkonce_resolution_comdat.ll. For a local linkage GV in a
non-prevailing COMDAT, it remains defined while its leader has been made
available_externally. This violates the COMDAT rule that its members must be
retained or discarded as a unit.
To fix this, update the regular LTO change D34803 to track local linkage
GlobalValues, and port the code to ThinLTO (GlobalAliases are not handled.)
Fix https://github.com/llvm/llvm-project/issues/58215:
as a size optimization, we place private `__profd_` in a COMDAT with a
`__profc_` key. When FuncImport.cpp makes `__profc_` available_externally due to
a non-prevailing COMDAT, `__profd_` incorrectly remains private. This change
makes the `__profd_` available_externally.
```
cat > c.h <<'eof'
extern void bar();
inline __attribute__((noinline)) void foo() {}
eof
cat > m1.cc <<'eof'
#include "c.h"
int main() {
bar();
foo();
}
eof
cat > m2.cc <<'eof'
#include "c.h"
__attribute__((noinline)) void bar() {
foo();
}
eof
clang -O2 -fprofile-generate=./t m1.cc m2.cc -flto -fuse-ld=lld -o t_gen
rm -fr t && ./t_gen && llvm-profdata show -function=foo t/default_*.profraw
# one _Z3foov
clang -O2 -fprofile-generate=./t m1.cc m2.cc -flto=thin -fuse-ld=lld -o t_gen
rm -fr t && ./t_gen && llvm-profdata show -function=foo t/default_*.profraw
# one _Z3foov
```
Reviewed By: tejohnson
Differential Revision: https://reviews.llvm.org/D135427
Craig Topper [Sat, 8 Oct 2022 17:49:52 +0000 (10:49 -0700)]
[RISCV] Add signext attribute to i32 arguments in some tests. NFC
Sam McCall [Sat, 8 Oct 2022 02:32:15 +0000 (04:32 +0200)]
[clangd] FindTarget: UsingEnumDecl is not an alias
Unlike UsingDecl it doesn't name the UsingShadowDecls it emits, so it doesn't
make sense to consider them the same thing. Don't consider the UsingEnumDecl
a target when the UsingShadowDecl is referenced.
Differential Revision: https://reviews.llvm.org/D135506
Florian Hahn [Sat, 8 Oct 2022 15:59:27 +0000 (16:59 +0100)]
[ConstraintElimination] Support chained GEPs with constant offsets.
Handle the (gep (gep ....), C) case by incrementing the constant
coefficient of the inner GEP, if C is a constant.
Florian Hahn [Sat, 8 Oct 2022 15:26:08 +0000 (16:26 +0100)]
[LV] Replace check with assert for reduction resume values (NFC).
At this point, we need to have resume values for all inductions. If not,
this would result in silent mis-compiles.
Florian Hahn [Sat, 8 Oct 2022 15:05:55 +0000 (16:05 +0100)]
[ConstraintElimination] Remove unused function (NFC).
Sanjay Patel [Sat, 8 Oct 2022 14:09:44 +0000 (10:09 -0400)]
[InstCombine] fold exact sdiv to ashr (2nd try)
The 1st attempt failed to updated the test checks as expected.
Original commit message:
sdiv exact X, (1<<ShAmt) --> ashr exact X, ShAmt (if shl is non-negative)
https://alive2.llvm.org/ce/z/kB6VF7
It would probably be better to use ValueTracking to replace this
and the existing transform above it, but the analysis does not
account for the no-wrap properly, and it's not immediately clear
to me how to fix it.
Sanjay Patel [Sat, 8 Oct 2022 14:06:44 +0000 (10:06 -0400)]
[InstCombine] add test for sdiv with shl; NFC
Sanjay Patel [Sat, 8 Oct 2022 14:02:03 +0000 (10:02 -0400)]
Revert "[InstCombine] fold exact sdiv to ashr"
This reverts commit
fe15290e0cf5d2bcdefca2e81ef6ff8155a2f7a8.
The test checks were not updated as expected.
Sanjay Patel [Sat, 8 Oct 2022 13:19:21 +0000 (09:19 -0400)]
[InstCombine] fold exact sdiv to ashr
sdiv exact X, (1<<ShAmt) --> ashr exact X, ShAmt (if shl is non-negative)
https://alive2.llvm.org/ce/z/kB6VF7
It would probably be better to use ValueTracking to replace this
and the existing transform above it, but the analysis does not
account for the no-wrap properly, and it's not immediately clear
to me how to fix it.
Mark de Wever [Fri, 2 Sep 2022 16:46:59 +0000 (18:46 +0200)]
[libc++] Make charconv require C++17 or later.
Implementing the paper
P2291R3 Add Constexpr Modifiers to Functions to_chars and from_chars for
Integral Types in <charconv> Header
Gives issues in language versions prior to C++17. As suggested in
D131855 disable the code prior to C++17. This removes libc++'s
extension.
Reviewed By: ldionne, #libc_vendors, #libc, philnik
Differential Revision: https://reviews.llvm.org/D133216
Evgeny Shulgin [Wed, 14 Sep 2022 20:03:14 +0000 (20:03 +0000)]
[clang-tidy] Ignore concepts in `misc-redundant-expression`
The checker should ignore requirement expressions inside concept
definitions, because redundant expressions still make sense here
Fixes https://github.com/llvm/llvm-project/issues/54114
Reviewed By: njames93, aaron.ballman
Differential Revision: https://reviews.llvm.org/D122078
Florian Hahn [Sat, 8 Oct 2022 10:03:44 +0000 (11:03 +0100)]
[ConstraintElimination] Use logic from
3771310eed for queries only.
The logic added in
3771310eed was placed sub-optimally. Applying the
transform in ::getConstraint meant that it would also impact conditions
that are added to the system by the signed <-> unsigned transfer logic.
This meant we failed to add some signed facts to the signed system. To
make sure we still add as many useful facts to the signed/unsigned
systems, move the logic to the point where we query the system.
Chuanqi Xu [Sat, 8 Oct 2022 09:05:44 +0000 (17:05 +0800)]
[C++20] [Modules] Only allow redeclarations in partitions if they are in the same module
Closes https://github.com/llvm/llvm-project/issues/58196.
The root cause for the problem is an oversight in
https://reviews.llvm.org/D127624, which allows the redeclarations in
partitions. However, we took a mistake there that we should only allow
it if the redeclarations in the one same module instead of return
directly if either the redeclaration lives in a partition. The original
implementation makes no sense and I believe it was an oversight.
Chuanqi Xu [Sat, 8 Oct 2022 08:38:19 +0000 (16:38 +0800)]
[C++20] [Modules] Remove assertion of current module when acting on import
Closes https://github.com/llvm/llvm-project/issues/58199
Previously, when we act on a import statement, we'll assume there is a
module declaration in the current TU if the command line tells us we're
compiling a module unit. This makes since on valid codes. However, for
invalid codes, it is possible. See
https://github.com/llvm/llvm-project/issues/58199 for example.
This patch removes the assertion. And the assertion is a noop and it
should be safe to remove it.
Freddy Ye [Sat, 8 Oct 2022 06:27:06 +0000 (14:27 +0800)]
[X86] Remove AVX512VP2INTERSECT from Sapphire Rapids.
For more details, please refer to the latest ISE document: https://www.intel.com/content/www/us/en/develop/download/intel-architecture-instruction-set-extensions-programming-reference.html
Reviewed By: pengfei
Differential Revision: https://reviews.llvm.org/D135509
gonglingqin [Sat, 8 Oct 2022 06:33:04 +0000 (14:33 +0800)]
[LoongArch] Do not assert value type in isFPImmLegal
This patch fixes the failure of llvm/test/CodeGen/Generic/vector.ll and
CodeGen/PowerPC/2007-11-19-VectorSplitting.ll for a LoongArch native build.
Differential Revision: https://reviews.llvm.org/D134798
chenglin.bi [Sat, 8 Oct 2022 06:47:50 +0000 (14:47 +0800)]
[ARM64EC][clang-cl] Add arm64EC test; NFC
Sam McCall [Thu, 15 Sep 2022 19:54:01 +0000 (21:54 +0200)]
[clangd] Enable standard library index by default.
Differential Revision: https://reviews.llvm.org/D133968
Manoj Gupta [Thu, 22 Sep 2022 20:53:46 +0000 (13:53 -0700)]
BareMetal: detect usr/include/c++/v1 path in sysroot
Currently baremetal driver adds <sysroot>/include/c++/v1
for libc++ headers. However on ChromeOS, all include files
are inside <sysroot>/usr/include. So add
<sysroot>/usr/include/c++/v1 if it exists in baremetal driver.
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D134478
wanglei [Thu, 6 Oct 2022 12:39:59 +0000 (20:39 +0800)]
[LoongArch] Set correct encodings for DWARF exception handling
This patch sets correct encodings for DWARF exception handling for
LoongArch.
Differential Revision: https://reviews.llvm.org/D134710
Jessica Paquette [Fri, 7 Oct 2022 19:19:33 +0000 (12:19 -0700)]
[GlobalISel] Add commutative matchers for compares.
This adds:
* `m_c_GICmp`
* `m_c_GFCmp`
These work the same way as the standard matchers, but will also try to commute
the LHS and RHS of a compare to get a match.
E.g.
```
m_c_GICmp(m_Pred(...), m_GAdd(...), m_GSub(...))
```
Can match either of
```
icmp cc (add x, y), (sub a, b)
icmp swapped_cc (sub a, b), (add x, y)
```
Differential Revision: https://reviews.llvm.org/D135415
Enna1 [Sat, 8 Oct 2022 01:55:40 +0000 (09:55 +0800)]
[memprof] dump memprof profile when receive deadly signals
Currently memprof profile is dumped when program exits (call `FinishAndWrite()` in ~Allocator) or `__memprof_profile_dump` is manually called.
For programs that never exit (e.g. server-side application), it will be useful to dump memprof profile when specific signal is received.
This patch installs a signal handler for deadly signals(SIGSEGV, SIGBUS, SIGABRT, SIGILL, SIGTRAP, SIGFPE) like we do in other sanitizers. In the signal handler `__memprof_profile_dump` is called to dump memprof profile.
Reviewed By: tejohnson
Differential Revision: https://reviews.llvm.org/D134795
Lei Zhang [Sat, 8 Oct 2022 00:43:27 +0000 (00:43 +0000)]
[mlir][vector] Merge accumulator/result transpose into contract
This commit adds a pattern to merge accumulator and result
`vector.transpose` ops into `vector.contract`. This kind of
pattern can be generated for NCHW convolution vectorization,
where we use transposes to convert the 1-D NCW convolution
into NWC during vectorization. Merging the transpose would
mean we can avoid materialize vector extract/insert for
transposes and it makes further vector level transformations
easier.
Reviewed By: ThomasRaoux
Differential Revision: https://reviews.llvm.org/D135496
Craig Topper [Sat, 8 Oct 2022 00:16:38 +0000 (17:16 -0700)]
[RISCV] Fix incorrect parenthese placement in comment. NFC
Craig Topper [Fri, 7 Oct 2022 17:26:22 +0000 (10:26 -0700)]
[VP][RISCV] Add vp.smax/smin/umax/umin intrinsics
Differential Revision: https://reviews.llvm.org/D135418
Jeff Bailey [Sat, 8 Oct 2022 00:03:47 +0000 (00:03 +0000)]
[libc] Document which date funcs are needed/done
Reviewed By: rtenneti
Differential Revision: https://reviews.llvm.org/D135501
Kostya Serebryany [Wed, 5 Oct 2022 20:22:13 +0000 (13:22 -0700)]
[libFuzzer] update the libFuzzer docs to reflect the current state.
[libFuzzer] update the libFuzzer docs to reflect the current state.
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D135312
Arthur Eubanks [Fri, 7 Oct 2022 21:37:23 +0000 (14:37 -0700)]
[llvm-reduce] Fail verifier less when removing debug metadata
Without this patch, we hit the following a lot:
"llvm.dbg.declare intrinsic requires a !dbg attachment"
"DICompileUnit not listed in llvm.dbg.cu"
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D135492
Michael Jones [Fri, 7 Oct 2022 23:16:15 +0000 (16:16 -0700)]
[libc][nfc] fix comment in clock_gettime
The first line got split because it was too long. Now it's fixed.
Differential Revision: https://reviews.llvm.org/D135498
Krzysztof Parzyszek [Fri, 7 Oct 2022 22:40:27 +0000 (15:40 -0700)]
[Hexagon] Implement helper to get intrinsic for instruction opcode
There are intrinsics for most scalar instructions and almost all HVX
instructions. What's somewhat painful is that there are two intrinsics
for each HVX instruction: one for 64- and one for 128-byte mode.
Instead of checking the current codegen settings every time, this
function would simply return the right intrinsic.
Amaury Séchet [Fri, 7 Oct 2022 22:35:25 +0000 (00:35 +0200)]
[DAGCombine] Deduplicate addcarry node using commutativity.
The first two parameters of addcarry are commutative. We may face a situation where both variant are present in the DAG, in which case we benefit from using just one.
Depends on D57302 and D33587
Reviewed By: RKSimon, chfast
Differential Revision: https://reviews.llvm.org/D57317
Jessica Paquette [Fri, 7 Oct 2022 21:33:51 +0000 (14:33 -0700)]
[GlobalISel] Mark mi_match as nodiscard
Typically when you match something, you want to check the result.
Fix a couple warnings in the AMDGPUPostLegalizerCombiner which appear as a
result of this.
Differential Revision: https://reviews.llvm.org/D135491
Lang Hames [Fri, 7 Oct 2022 21:56:04 +0000 (14:56 -0700)]
[JITLink][aarch64] Fix typo in error message.
Arthur Eubanks [Fri, 7 Oct 2022 20:12:59 +0000 (13:12 -0700)]
[opt] Don't translate legacy -analysis flag to require<analysis>
Tests relying on this should explicitly use -passes='require<analysis>,foo'.
Maksim Panchenko [Fri, 7 Oct 2022 18:55:30 +0000 (11:55 -0700)]
[BOLT][TEST] Fix section order test
.bss section emitted by llvm-bolt (e.g. with instrumentation) is not a
real BSS section, i.e. it takes space in the output file. Hence the
order with respect to .data is not defined. Remove .bss from the test
and fix the buildbot failure.
Reviewed By: Amir
Differential Revision: https://reviews.llvm.org/D135475
Evgeny Shulgin [Fri, 7 Oct 2022 20:54:39 +0000 (20:54 +0000)]
[Clang] Use C++17 in constant-builtins-fmax.cpp test
Add `-std=c++17` to the test so that buildbot won't fail
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D135486
Pavel Chupin [Fri, 7 Oct 2022 21:01:20 +0000 (14:01 -0700)]
Fix warnings in build done by clang-based compiler
Differential Revision: https://reviews.llvm.org/D135230
Artem Belevich [Wed, 10 Aug 2022 00:28:30 +0000 (17:28 -0700)]
Add support for CUDA-11.8 and sm_{87,89,90} GPUs.
Differential Revision: https://reviews.llvm.org/D135306
Artem Belevich [Wed, 5 Oct 2022 22:20:17 +0000 (15:20 -0700)]
Refactored CUDA version housekeeping to use less boilerplate.
Differential Revision: https://reviews.llvm.org/D135328
Arthur Eubanks [Fri, 7 Oct 2022 20:49:25 +0000 (13:49 -0700)]
[opt] Remove legacy -print-dom-info pass
This was specific to `opt` for some reason.
There's already a new pass manager pass `print<domtree>` which does the same.
Florian Hahn [Fri, 7 Oct 2022 20:35:42 +0000 (21:35 +0100)]
[LoopSimplifyCFG] Invalidate SCEV dispositions.
Clear all dispositions if there are any dead blocks (which will get
removed later) and also clear dispositions for removed instructions.
Clearing all dispositions in case there are dead blocks happens first,
which should avoid traversing SCEV use-lists for invalidating
dispositions for individual values.
Fixes #58179.
Evgeny Shulgin [Wed, 21 Sep 2022 15:52:18 +0000 (15:52 +0000)]
[Clang] Support constexpr builtin fmax
Support constexpr version of __builtin_fmax and its variations.
Reviewed By: jcranmer-intel
Differential Revision: https://reviews.llvm.org/D134369