platform/upstream/llvm.git
21 months ago[LLDB] Complete set of char tests for static integral members
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

21 months agoAdd llvm-gsymutil to the Bazel build files.
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

21 months ago[AArch64][SVE] Fix AArch64_SVE_VectorCall calling convention
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

21 months agoExtended Documentation of LLVM_TARGETS_TO_BUILD by listing all possible values
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

21 months ago[Attributor] Use ConstantFoldLoadFromConst()
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

21 months ago[Bindings] Remove go bindings
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

21 months ago[AA] Remove deprecated ModRefInfo helpers (NFC)
Nikita Popov [Mon, 10 Oct 2022 07:53:34 +0000 (09:53 +0200)]
[AA] Remove deprecated ModRefInfo helpers (NFC)

21 months ago[mlir][Linalg] Use ConfinedAttr for dimensions of ReduceOp.
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

21 months ago[gn build] Port 1ae33bf42680
LLVM GN Syncbot [Mon, 10 Oct 2022 07:30:41 +0000 (07:30 +0000)]
[gn build] Port 1ae33bf42680

21 months ago[clang-tidy] Add cppcoreguidelines-avoid-do-while check
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

21 months ago[flang] Allow conversion from boxed derived type to fir.class
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

21 months ago[RISCV] Use hasAllWUsers to recover XORI/ORI
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

21 months ago[examples] Fix deprecated use of llvm::empty.
Lang Hames [Mon, 10 Oct 2022 05:00:43 +0000 (22:00 -0700)]
[examples] Fix deprecated use of llvm::empty.

21 months ago[ORC] Relax assertions in SimpleRemoteEPCTransport.
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.

21 months ago[LLJIT] Default to EPCEHFrameRegistrar rather than InProcessEHFrameRegistrar.
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.

21 months ago[RISCV] Remove some vsetvli intrinsics under Zve32*.
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

21 months ago[tsan][go] Fix string equal operator
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

21 months agoApply clang-tidy fixes for modernize-use-equals-default in Bufferize.cpp (NFC)
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)

21 months agoApply clang-tidy fixes for readability-identifier-naming in TosaToLinalg.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)

21 months ago[AArch64] Swap 'lsl(val1,small-shmt)' to right hand side for AND(lsl(val1,small-shmt...
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

21 months ago[AArch64][NFC] Precommit test case to show sub-optimal codegen for add(lsl(val1,small...
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.

21 months ago[ConstraintElimination] Include index type scale.
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.

21 months ago[ConstraintElimination] Add tests for GEPs with different source types.
Florian Hahn [Sun, 9 Oct 2022 20:51:47 +0000 (21:51 +0100)]
[ConstraintElimination] Add tests for GEPs with different source types.

21 months ago[DSE][NFC] Add nounwind attribute to match test intent
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

21 months ago[DSE] Relax constraint on isGuaranteedLoopInvariant
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

21 months ago[RISCV][NFC] Fix unused variable warning.
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

21 months ago[clang-format] Add support to remove unnecessary semicolons after function definition
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

21 months ago[clangd] Fix rename for symbol introduced by UsingDecl
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

21 months ago[LoongArch] Expand fptrunc store from f64 to f32
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

21 months ago[ConstraintElim] Move logic to get constraint for solving to helper.
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.

21 months ago[gn build] Port a2c6a1193f41
LLVM GN Syncbot [Sun, 9 Oct 2022 07:11:39 +0000 (07:11 +0000)]
[gn build] Port a2c6a1193f41

21 months ago[libc++][ranges]implement `std::views::take_while`
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

21 months ago[C++20] [Coroutines] Exit early if we found co_await appears in
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').

21 months ago[PowerPC] Add vector pair calling convention for AIX
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

21 months ago[LoongArch] Don't merge FrameIndex accesses into [F]{LD,ST}X
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

21 months ago[lld-macho] Implement -ignore_auto_link
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

21 months ago[CMake] Use libcxx-abi-* targets for in-tree sanitizer C++ ABI
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

21 months agoRemove myself as X86 Backend owner.
Craig Topper [Sun, 9 Oct 2022 01:39:45 +0000 (18:39 -0700)]
Remove myself as X86 Backend owner.

21 months ago[RISCV] Merge more rv32/rv64 vector intrinsic tests that contain the same content.
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.

21 months agoAdd myself to CREDITS.TXT + CODE_OWNERS.TXT
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

21 months ago[Support] Add fast path for StringRef::find with needle of length 2.
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

21 months ago[PGO] Consider parent context when weighing branches with likelyhood.
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

21 months agoAdd myself to CREDITS.TXT + CODE_OWNERS.TXT
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

21 months ago[ConstraintElimination] Add tests for chained GEPs without inbounds.
Florian Hahn [Sat, 8 Oct 2022 18:39:36 +0000 (19:39 +0100)]
[ConstraintElimination] Add tests for chained GEPs without inbounds.

21 months agoApply clang-tidy fixes for llvm-else-after-return in TosaToLinalg.cpp (NFC)
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)

21 months agoApply clang-tidy fixes for performance-unnecessary-value-param in IRCore.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)

21 months ago[LTO] Make local linkage GlobalValue in non-prevailing COMDAT available_externally
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

21 months ago[RISCV] Add signext attribute to i32 arguments in some tests. NFC
Craig Topper [Sat, 8 Oct 2022 17:49:52 +0000 (10:49 -0700)]
[RISCV] Add signext attribute to i32 arguments in some tests. NFC

21 months ago[clangd] FindTarget: UsingEnumDecl is not an alias
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

21 months ago[ConstraintElimination] Support chained GEPs with constant offsets.
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.

21 months ago[LV] Replace check with assert for reduction resume values (NFC).
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.

21 months ago[ConstraintElimination] Remove unused function (NFC).
Florian Hahn [Sat, 8 Oct 2022 15:05:55 +0000 (16:05 +0100)]
[ConstraintElimination] Remove unused function (NFC).

21 months ago[InstCombine] fold exact sdiv to ashr (2nd try)
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.

21 months ago[InstCombine] add test for sdiv with shl; NFC
Sanjay Patel [Sat, 8 Oct 2022 14:06:44 +0000 (10:06 -0400)]
[InstCombine] add test for sdiv with shl; NFC

21 months agoRevert "[InstCombine] fold exact sdiv to ashr"
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.

21 months ago[InstCombine] fold exact sdiv to ashr
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.

21 months ago[libc++] Make charconv require C++17 or later.
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

21 months ago[clang-tidy] Ignore concepts in `misc-redundant-expression`
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

21 months ago[ConstraintElimination] Use logic from 3771310eed for queries only.
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.

21 months ago[C++20] [Modules] Only allow redeclarations in partitions if they are in the same...
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.

21 months ago[C++20] [Modules] Remove assertion of current module when acting on import
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.

21 months ago[X86] Remove AVX512VP2INTERSECT from Sapphire Rapids.
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

21 months ago[LoongArch] Do not assert value type in isFPImmLegal
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

21 months ago[ARM64EC][clang-cl] Add arm64EC test; NFC
chenglin.bi [Sat, 8 Oct 2022 06:47:50 +0000 (14:47 +0800)]
[ARM64EC][clang-cl] Add arm64EC test; NFC

21 months ago[clangd] Enable standard library index by default.
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

21 months agoBareMetal: detect usr/include/c++/v1 path in sysroot
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

21 months ago[LoongArch] Set correct encodings for DWARF exception handling
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

21 months ago[GlobalISel] Add commutative matchers for compares.
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

21 months ago[memprof] dump memprof profile when receive deadly signals
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

21 months ago[mlir][vector] Merge accumulator/result transpose into contract
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

21 months ago[RISCV] Fix incorrect parenthese placement in comment. NFC
Craig Topper [Sat, 8 Oct 2022 00:16:38 +0000 (17:16 -0700)]
[RISCV] Fix incorrect parenthese placement in comment. NFC

21 months ago[VP][RISCV] Add vp.smax/smin/umax/umin intrinsics
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

21 months ago[libc] Document which date funcs are needed/done
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

21 months ago[libFuzzer] update the libFuzzer docs to reflect the current state.
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

21 months ago[llvm-reduce] Fail verifier less when removing debug metadata
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

21 months ago[libc][nfc] fix comment in clock_gettime
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

21 months ago[Hexagon] Implement helper to get intrinsic for instruction opcode
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.

21 months ago[DAGCombine] Deduplicate addcarry node using commutativity.
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

21 months ago[GlobalISel] Mark mi_match as nodiscard
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

21 months ago[JITLink][aarch64] Fix typo in error message.
Lang Hames [Fri, 7 Oct 2022 21:56:04 +0000 (14:56 -0700)]
[JITLink][aarch64] Fix typo in error message.

21 months ago[opt] Don't translate legacy -analysis flag to require<analysis>
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'.

21 months ago[BOLT][TEST] Fix section order test
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

21 months ago[Clang] Use C++17 in constant-builtins-fmax.cpp test
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

21 months agoFix warnings in build done by clang-based compiler
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

21 months agoAdd support for CUDA-11.8 and sm_{87,89,90} GPUs.
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

21 months agoRefactored CUDA version housekeeping to use less boilerplate.
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

21 months ago[opt] Remove legacy -print-dom-info pass
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.

21 months ago[LoopSimplifyCFG] Invalidate SCEV dispositions.
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.

21 months ago[Clang] Support constexpr builtin fmax
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

21 months agoAMDGPU: Update SlotIndexes independently of LiveIntervals
Matt Arsenault [Thu, 15 Sep 2022 19:42:17 +0000 (15:42 -0400)]
AMDGPU: Update SlotIndexes independently of LiveIntervals

Apparently StackColoring depends on SlotIndexes, but not
LiveIntervals. If regalloc fast were manually requested, LiveIntervals
would be dropped before SILowerSGPRSpills but not SlotIndexes.

SILowerSGPRSpills preserved SlotIndexes, but only through
LiveIntervals. As a result, SILowerSGPRSpills was incorrectly
reporting it preserved SlotIndexes. Start updating these directly,
instead of depending on LiveIntervals also being available.

21 months agollvm-reduce: Fix another invalid reduction with repeated input phis
Matt Arsenault [Thu, 6 Oct 2022 22:04:25 +0000 (15:04 -0700)]
llvm-reduce: Fix another invalid reduction with repeated input phis

ReduceOperandsSkip had the same issue as ReduceOperands when handling
phis with repeated predecessors.

21 months agollvm-reduce: Fix invalid reduction for phis with repeat inputs
Matt Arsenault [Thu, 6 Oct 2022 18:06:02 +0000 (11:06 -0700)]
llvm-reduce: Fix invalid reduction for phis with repeat inputs

Phis have a quirk where the same predecessor block may appear multiple times
if the same block branches to it multiple ways. All the values need to match,
but this was replacing each operand independently. If an operand can be simplified,
make sure to replace every instance of the incoming block's value.

21 months agollvm-reduce: Use -abort-on-invalid-reduction in a test
Matt Arsenault [Tue, 4 Oct 2022 01:34:51 +0000 (18:34 -0700)]
llvm-reduce: Use -abort-on-invalid-reduction in a test

Also stop using cat

21 months agollvm-reduce: Fix missing C++ mode comments
Matt Arsenault [Wed, 5 Oct 2022 04:09:45 +0000 (21:09 -0700)]
llvm-reduce: Fix missing C++ mode comments

21 months ago[mlir][arith] Expose dedicated API for expanding ceil/floor division
Lei Zhang [Fri, 7 Oct 2022 19:42:08 +0000 (19:42 +0000)]
[mlir][arith] Expose dedicated API for expanding ceil/floor division

This allows more precise control over which patterns to pick to
expand arithmetic ops. Previously ceil/floor division epxansion
is only available together with various min/max op expansion.

Reviewed By: ThomasRaoux

Differential Revision: https://reviews.llvm.org/D135479

21 months ago[ConstraintElimination] Add test for regression after 3771310eede.
Florian Hahn [Fri, 7 Oct 2022 19:42:15 +0000 (20:42 +0100)]
[ConstraintElimination] Add test for regression after 3771310eede.

21 months agoRecommit "[SCEV] Support clearing Block/LoopDispositions for a single value."
Florian Hahn [Fri, 7 Oct 2022 19:15:44 +0000 (20:15 +0100)]
Recommit "[SCEV] Support clearing Block/LoopDispositions for a single value."

This reverts commit 92f698f01fa0bb8967233a6391ada2d51849fa68.

The updated version of the patch includes handling for non-SCEVable
types. A test case has been added in ec86e9a99bca802.

21 months ago[llvm-reduce] Fix di-metadata pass test failures
Matthew Voss [Fri, 7 Oct 2022 19:00:22 +0000 (12:00 -0700)]
[llvm-reduce] Fix di-metadata pass test failures

We're seeing intermittent failures in upstream bots. See:

https://lab.llvm.org/buildbot/#/builders/139/builds/29185
https://lab.llvm.org/buildbot/#/builders/238/builds/295

This appears to be due to the unstable iteration order of DenseSet.
Since we're trying to reduce a tree, it makes sense to attempt
reductions from the top down.

This also addresses post-review comments from @MatzeB.

Differential Revision: https://reviews.llvm.org/D135473

21 months ago[LoopUnroll] Add test for crash exposed by 9e931439.
Florian Hahn [Fri, 7 Oct 2022 19:02:57 +0000 (20:02 +0100)]
[LoopUnroll] Add test for crash exposed by 9e931439.

21 months ago[opt] Remove -passes=asan-pipeline
Arthur Eubanks [Fri, 7 Oct 2022 18:55:36 +0000 (11:55 -0700)]
[opt] Remove -passes=asan-pipeline

It was obsoleted when the asan pass was changed to just be one module pass.