platform/upstream/llvm.git
14 months ago[RISCV] Support LLVM IR intrinsics for xsfvcp extension.
Nelson Chu [Wed, 18 May 2022 09:26:16 +0000 (02:26 -0700)]
[RISCV] Support LLVM IR intrinsics for xsfvcp extension.

The sf.vc.x and sf.vc.i intrinsics don't have any vector types in the output
and inputs, but the intrinsic spec said that we still need to add vetvli for
them. Therefore, we need to encode the VTYPE to these IR names.

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

14 months ago[llvm][docs] Update "Adding a Builder" docs
David Spickett [Fri, 21 Apr 2023 09:53:50 +0000 (10:53 +0100)]
[llvm][docs] Update "Adding a Builder" docs

* Move step 8 to later, after worker credentials have
  been added to the buildmaster.
* Added command for starting the worker, in addition
  to creating the worker. The latter only sets up the
  directories.
* Noted that in step 6, it is expected that you get a
  refused connection.
* Stated that the connection should be tried once,
  and the worker then stopped.

We could mention that repeated connections with invalid
credentials will result in an IP ban, but it's probably
detail people don't need here.

If it did happen, then you would not know until you tried
the later steps. At which point you are already in contact
with Galina, who is the person who would help you with that
issue in any case.

Reviewed By: gkistanova

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

14 months ago[CodeGenPrepare] Estimate liveness of loop invariants when checking for address foldi...
Momchil Velikov [Mon, 24 Apr 2023 08:50:28 +0000 (09:50 +0100)]
[CodeGenPrepare] Estimate liveness of loop invariants when checking for address folding profitability

When checking the profitability of folding an address computation
into a memory instruction, the compiler tries to determine the liveness
of the values, comprising the address, at the point of the memory instruction.
This patch improves on the live variable estimates by including
the loop invariants which are references in the loop body.

Reviewed By: dmgreen

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

14 months ago[clang] Return `std::string_view` from `TargetInfo::getClobbers()`
Stoorx [Fri, 21 Apr 2023 14:33:15 +0000 (17:33 +0300)]
[clang] Return `std::string_view` from `TargetInfo::getClobbers()`

Change the return type of `getClobbers` function from `const char*`
to `std::string_view`. Update the function usages in CodeGen module.

The reasoning of these changes is to remove unsafe `const char*`
strings and prevent unnecessary allocations for constructing the
`std::string` in usages of `getClobbers()` function.

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

14 months ago[clang] Remove unnecessary virtual inheritance in `TargetInfo`
Stoorx [Fri, 21 Apr 2023 21:06:58 +0000 (00:06 +0300)]
[clang] Remove unnecessary virtual inheritance in `TargetInfo`

Since the `TargetInfo` has no diamond-like inheritance diagram,
the `virtual` keyword is not necessary.

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

14 months ago[clang] Make access to submodules via `iterator_range`
Stoorx [Tue, 18 Apr 2023 20:49:00 +0000 (23:49 +0300)]
[clang] Make access to submodules via `iterator_range`

In file `clang/lib/Basic/Module.cpp` the `Module` class had `submodule_begin()` and `submodule_end()` functions to retrieve corresponding iterators for private vector of Modules. This commit removes mentioned functions, and replaces all of theirs usages with `submodules()` function and range-based for-loops.

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

14 months ago[clang] Mark CWG2009 as N/A
Vlad Serebrennikov [Mon, 24 Apr 2023 08:52:31 +0000 (11:52 +0300)]
[clang] Mark CWG2009 as N/A

[[https://wg21.link/p1787 | P1787]]: CWG2331 is resolved by defining lookup from complete-class contexts and out-of-line member definitions. The rest of CWG2009 is resolved by making it ill-formed NDR for forward lookup outside a complete-class context to change the results (before overload resolution, to avoid differences in instantiation).
Wording: The result of the search is the declaration set of S(N, T). If it is an invalid set, the program is ill-formed. If it differs from the result of a search in T for N from immediately after the class-specifier of T, the program is ill-formed, no diagnostic required. ([class.member.lookup]/7)

Reviewed By: #clang-language-wg, shafik

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

14 months agoRevert "[SCEV] Precise trip multiples"
Joshua Cao [Mon, 24 Apr 2023 08:39:13 +0000 (01:39 -0700)]
Revert "[SCEV] Precise trip multiples"

This reverts commit 027a4c8b96c7f97df8e98b1dac069b956810ab94.

14 months ago[llvm][ADT] Fix Any linker error with multiple compilers
Sebastian Neubauer [Mon, 24 Apr 2023 08:34:59 +0000 (10:34 +0200)]
[llvm][ADT] Fix Any linker error with multiple compilers

Citing the comment in the source:

Define the type id and initialize with a non-zero value.
Initializing with a zero value means the variab can end up in either the
.data or the .bss section. This can lead to multiple definition linker
errors when some object files are compiled with a compiler that puts the
variable into .data but they are linked to object files from a different
compiler that put the variable into .bss. To prevent this issue from
happening, initialize the variable with a non-zero value, which forces
it to land in .data (because .bss is zero-initialized).

Fixes https://github.com/llvm/llvm-project/issues/62270
A regression of D139974.

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

14 months agoDrop MLIR Bazel dependency on LLVM Analysis
Alex Zinenko [Mon, 24 Apr 2023 07:33:51 +0000 (07:33 +0000)]
Drop MLIR Bazel dependency on LLVM Analysis

This is no longer necessary after f5425c128a30 and significatly
decreases the build time and the binary footprint.

Reviewed By: Dinistro

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

14 months ago[Pipelines] Don't run ForceFunctionAttrs post-link
Nikita Popov [Fri, 21 Apr 2023 08:17:03 +0000 (10:17 +0200)]
[Pipelines] Don't run ForceFunctionAttrs post-link

This is effectively a debugging pass to adjust function attributes.
I don't think it makes sense to run it in the post-link pipeline.

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

14 months ago[bazel] update for ba38640b9901d239e32e12c6569f7364d00af922
Mikhail Goncharov [Mon, 24 Apr 2023 07:35:06 +0000 (09:35 +0200)]
[bazel] update for ba38640b9901d239e32e12c6569f7364d00af922

14 months ago[SCEV] Precise trip multiples
Joshua Cao [Tue, 11 Apr 2023 06:52:06 +0000 (23:52 -0700)]
[SCEV] Precise trip multiples

We currently have getMinTrailingZeros(), from which we can get a SCEV's
multiple by computing 1 << MinTrailingZeroes. However, this only gets us
multiples that are a power of 2. This patch introduces a way to get max
constant multiples that are not just a power of 2. The logic is similar
to that of getMinTrailingZeros. getMinTrailingZeros is replaced by
computing the max constant multiple, and counting the number of trailing
bits.

This is applied in two places:

1) Computing unsigned constant ranges. For example, if we have i8
   {10,+,10}<nuw>, we know the max constant it can be is 250.

2) Computing trip multiples as shown in SCEV output. This is useful if
   for example, we are unrolling a loop by a factor of 5, and we know
   the trip multiple is 5, then we don't need a loop epilog.

If the code sees that a SCEV does not have <nuw>, it will fall back to
finding the max multiple that is a power of 2. Multiples that are a
power of 2 will still be a multiple even after the SCEV overflows.

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

14 months ago[SCEV] Add trip multiple tests
Joshua Cao [Fri, 14 Apr 2023 07:23:04 +0000 (00:23 -0700)]
[SCEV] Add trip multiple tests

14 months ago[SCEV] Add ranges tests
Joshua Cao [Fri, 14 Apr 2023 07:01:44 +0000 (00:01 -0700)]
[SCEV] Add ranges tests

14 months ago[Clang][Driver] Handle LoongArch multiarch tuples
WANG Xuerui [Mon, 24 Apr 2023 07:18:46 +0000 (15:18 +0800)]
[Clang][Driver] Handle LoongArch multiarch tuples

This follows v1.00 of the [[ https://loongson.github.io/LoongArch-Documentation/LoongArch-toolchain-conventions-EN.html | LoongArch Toolchain Conventions ]],
but notably with [[ https://github.com/loongson/LoongArch-Documentation/pull/80 | this patch ]]
applied (a proper version bump to v2.00 was not done, so it is
indistinguishable from the "original" but now incompatible v1.00
otherwise).

Only `loongarch64` is implemented in `Linux::getMultiarchTriple`
because support for LA32 and ILP32* ABIs are incomplete right now.

The Debian sysroot layout is based on Han Gao's recent porting effort,
specifically the ghcr.io/rabenda/beige:loong64-v23-preview-20230330
container image.

Reviewed By: SixWeining

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

14 months ago[flang] Turn on use-desc-for-alloc by default
Jean Perier [Mon, 24 Apr 2023 07:04:57 +0000 (09:04 +0200)]
[flang] Turn on use-desc-for-alloc by default

Currently, local allocatables and contiguous/scalar pointers (and some
other conditions) are lowered to a set of independent variables in FIR
(one for the address, one for each bound and one for character length).
The intention was to help LLVM get rids of descriptors. But LLVM knows
how to do that anyway in those cases:

```
subroutine foo(x)
 real, target :: x(100)
 real, pointer, contiguous :: p(:)
 p => x
 call bar(p(50))
end subroutine
```

The output fir the option on or off is the same after llvm opt -O1,
there is no descriptor anymore, the indirection is removed.

```
define void @foo_(ptr %0) local_unnamed_addr {
  %2 = getelementptr [100 x float], ptr %0, i64 0, i64 49
  tail call void @bar_(ptr %2)
  ret void
}
```

So the benefit of not using a descriptor in lowering is questionable,
and although it is abstracted as much as possible in the so called
MutableBoxValue class that represent allocatable/pointer in lowering
it is still causing bugs from time to time, and will also be a bit
problematic when emitting debug info for the pointer/allocatable.

In HLFIR lowering, the simplification to always use a descriptor in
lowering was already made. This patch allows decorrelating the impact
from this change from the bigger impact HLFIR will have so that it
is easier to get feedback if this causes performance issues.

The lowering tests relying on the previous behavior are only updated
to set back this option to true. The reason is that I think we should
preserve coverage of the code dealing with the "non descriptor" approach
in lowering until we actually get rid of it. The other reason is that
the test will have to be or are already covered by equivalent HLFIR
tests, which use descriptors.

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

14 months ago[TableGen] Make getRegisterValueType stricter about HwModes.
Craig Topper [Mon, 24 Apr 2023 06:28:23 +0000 (23:28 -0700)]
[TableGen] Make getRegisterValueType stricter about HwModes.

I don't think this code would work correctly if the register class
used used HwModes. Add asserts to make sure it's not used with HwModes.

Also fix a long outdated comment on the function.

14 months ago[lsan][test] Obtaining page size using sysconf(_SC_PAGESIZE)
zhanglimin [Mon, 24 Apr 2023 06:27:37 +0000 (14:27 +0800)]
[lsan][test] Obtaining page size using sysconf(_SC_PAGESIZE)

The effectiveness of the mprotect function depends on whether
the first argument is aligned to a page boundary. If mprotect
doesn't work, the kernel will not generate a SIGSEGV signal for
the process when the calling process tries to access memory in
a manner that violates the protection. If so, this test fails.

The problem for this test is that it uses a fixed 4 kB page size
and is aligned. This fails when the page size is not 4 kB. For
example, this fails on LoongArch which uses a 16 kB pagesize.

Reviewed By: SixWeining, xen0n, MaskRay, vitalybuka

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

14 months ago[LoopInfo] SFINAE mechanism for hoist into check
Christian Ulmann [Mon, 24 Apr 2023 06:20:46 +0000 (06:20 +0000)]
[LoopInfo] SFINAE mechanism for hoist into check

This commit introduces an SFINAE mechanism to make the LLVM hoist into
check member function not leak into the users of LoopInfo.

Depends on D148235

Reviewed By: ftynse

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

14 months ago[LoopInfo] Move generic LoopInfo into own files
Christian Ulmann [Mon, 24 Apr 2023 06:06:45 +0000 (06:06 +0000)]
[LoopInfo] Move generic LoopInfo into own files

This commit splits the generic part of `LoopInfo` into separate files.
These new `GenericLoopInfo` files are located in `llvm/Support` to be inline
with `GenericDomTree`.

Furthermore, this change ensures that MLIR's Bazel build does not have
to link against `LLVMAnalysis` just to use these template headers.

Depends on D148219

Reviewed By: ftynse

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

14 months ago[X86][tablgen] Fix typo in comments, NFC
Shengchen Kan [Mon, 24 Apr 2023 05:24:25 +0000 (13:24 +0800)]
[X86][tablgen] Fix typo in comments, NFC

14 months agoRemove `-action` suffix from the tag defining an Action: it is redundant here
Mehdi Amini [Sun, 23 Apr 2023 22:07:51 +0000 (16:07 -0600)]
Remove `-action` suffix from the tag defining an Action: it is redundant here

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

14 months ago[TableGen] Remove unused ForceMode and CodeGen fields from TypeInfer. NFC
Craig Topper [Mon, 24 Apr 2023 03:32:14 +0000 (20:32 -0700)]
[TableGen] Remove unused ForceMode and CodeGen fields from TypeInfer. NFC

As well as the ForceMode field in PatternToMatch.

14 months agoClean come dead code
Wang, Xin10 [Mon, 24 Apr 2023 00:45:43 +0000 (20:45 -0400)]
Clean come dead code

These codes deleted are dead code, we never go into it.
1. In AggressiveAntiDepBreaker.cpp, have assert AntiDepReg != 0.
2. IfConversion.cpp, Kind can only be one unique value, so isFalse && isRev
    can never be true.
3. DAGCombiner.cpp, at line 3675, we have considered the condition like
```
  // fold (sub x, c) -> (add x, -c)
  if (N1C) {
    return DAG.getNode(ISD::ADD, DL, VT, N0,
                       DAG.getConstant(-N1C->getAPIntValue(), DL, VT));
  }
```
4. ScheduleDAGSDNodes.cpp, we have Latency > 1 at line 663
5. MasmParser.cpp, code exists in a switch-case block which decided by
    the value FirstTokenKind, at line 1621, FirstTokenKind could only be
    one of AsmToken::Dollar, AsmToken::At and AsmToken::Identifier.

Reviewed By: skan

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

14 months ago[NFC] Fix typos in APFloat.h
Fabian Tschopp [Sun, 23 Apr 2023 15:15:16 +0000 (17:15 +0200)]
[NFC] Fix typos in APFloat.h

represnted -> represented

Reviewed By: lattner

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

14 months ago[NFC][clang] Fix static analyzer concerns
Manna, Soumi [Sun, 23 Apr 2023 22:17:28 +0000 (18:17 -0400)]
[NFC][clang] Fix static analyzer concerns

Reported by Coverity:

AUTO_CAUSES_COPY
Unnecessary object copies can affect performance.

1. Inside "SemaDeclCXX.cpp" file, in <unnamed>::DiagnoseUninitializedFields(clang::Sema &, clang::CXXConstructorDecl const *): Using the auto keyword without an & causes the copy of an object of type CXXBaseSpecifier.

2. Inside "ClangAttrEmitter.cpp" file, in clang::EmitClangAttrParsedAttrImpl(llvm::RecordKeeper &, llvm::raw_ostream &): Using the auto keyword without an & causes the copy of an object of type pair.

3. Inside "Marshallers.h" file, in clang::ast_matchers::dynamic::internal::MapAnyOfBuilderDescriptor::buildMatcherCtor(clang::ast_matchers::dynamic::SourceRange, llvm::ArrayRef<clang::ast_matchers::dynamic::ParserValue>, clang::ast_matchers::dynamic::Diagnostics *): Using the auto keyword without an & causes the copy of an object of type ParserValue.

4. Inside "CGVTables.cpp" file, in clang::CodeGen::CodeGenModule::GetVCallVisibilityLevel(clang::CXXRecordDecl const *, llvm::DenseSet<clang::CXXRecordDecl const *, llvm::DenseMapInfo<clang::CXXRecordDecl const *, void>> &): Using the auto keyword without an & causes the copy of an object of type CXXBaseSpecifier.

5. Inside "ASTContext.cpp" file, in hasTemplateSpecializationInEncodedString(clang::Type const *, bool): Using the auto keyword without an & causes the copy of an object of type CXXBaseSpecifier.

6. Inside "ComputeDependence.cpp" file, in clang::computeDependence(clang::DependentScopeDeclRefExpr *): Using the auto keyword without an & causes the copy of an object of type TemplateArgumentLoc.

Reviewed By: tahonermann, erichkeane

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

14 months ago[MemProf] Don't use constexpr via lambda capture due to MSVC issues (NFC)
Teresa Johnson [Sun, 23 Apr 2023 22:00:18 +0000 (15:00 -0700)]
[MemProf] Don't use constexpr via lambda capture due to MSVC issues (NFC)

Modifies a104e27030587507a711cef0e2b0ddb447fe68fe slightly to switch a
constexpr used via a lambda capture to a const, due to issues with MSVC.
See https://reviews.llvm.org/D140949#inline-1438809 for context.

14 months ago[test] Simplify libunwind REQUIRES
Fangrui Song [Sun, 23 Apr 2023 21:58:46 +0000 (14:58 -0700)]
[test] Simplify libunwind REQUIRES

14 months ago[bazel] Port for 8ac8c922fb3f15706f5cb1db2cc655d30b095766
Haojian Wu [Sun, 23 Apr 2023 21:54:29 +0000 (23:54 +0200)]
[bazel] Port for 8ac8c922fb3f15706f5cb1db2cc655d30b095766

14 months ago[lld][AArch64] Add BTI landing pad to PLT when it is accessed by a range extension...
Daniel Kiss [Sun, 23 Apr 2023 21:16:11 +0000 (23:16 +0200)]
[lld][AArch64] Add BTI landing pad to PLT when it is accessed by a range extension thunk.

Adding BTI to those PLT's which accessed with by a range extension thunk due to those preform an indirect call.
Fixes: #62140

Reviewed By: MaskRay

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

14 months ago[CostModel][X86] getMemoryOpCost - increase cost of sub-32-bit vector load/stores
Simon Pilgrim [Sun, 23 Apr 2023 20:48:25 +0000 (21:48 +0100)]
[CostModel][X86] getMemoryOpCost - increase cost of sub-32-bit vector load/stores

For 8-bit/16-bit vector loads/stores we scalarize and transfer to/from the vector unit, or use the (usually slow) PINSR/PEXTR instructions.

Fixes #59867

14 months ago[SLP][X86] Add test coverage for Issue #59867
Simon Pilgrim [Sun, 23 Apr 2023 20:20:44 +0000 (21:20 +0100)]
[SLP][X86] Add test coverage for Issue #59867

14 months agoRemove ExplicitEmulatedTLS and simplify -femulated-tls handling
Fangrui Song [Sun, 23 Apr 2023 18:55:12 +0000 (11:55 -0700)]
Remove ExplicitEmulatedTLS and simplify -femulated-tls handling

Currently clangDriver passes -femulated-tls and -fno-emulated-tls to cc1.
cc1 forwards the option to LLVMCodeGen and ExplicitEmulatedTLS is used
to decide the value. Simplify this by moving the Clang decision to
clangDriver and moving the LLVM decision to InitTargetOptionsFromCodeGenFlags.

14 months ago[mlir][Vector] Add 16x16 strategy to vector.transpose lowering.
Hanhan Wang [Thu, 20 Apr 2023 21:46:40 +0000 (14:46 -0700)]
[mlir][Vector] Add 16x16 strategy to vector.transpose lowering.

It adds a `shuffle_16x16` strategy LowerVectorTranspose and renames `shuffle` to `shuffle_1d`. The idea is similar to 8x8 cases in x86Vector::avx2. The general algorithm is:

```
interleave 32-bit lanes using
    8x _mm512_unpacklo_epi32
    8x _mm512_unpackhi_epi32
interleave 64-bit lanes using
    8x _mm512_unpacklo_epi64
    8x _mm512_unpackhi_epi64
permute 128-bit lanes using
   16x _mm512_shuffle_i32x4
permute 256-bit lanes using again
   16x _mm512_shuffle_i32x4
```

After the first stage, they got transposed to

```
 0  16   1  17   4  20   5  21   8  24   9  25  12  28  13  29
 2  18   3  19   6  22   7  23  10  26  11  27  14  30  15  31
32  48  33  49 ...
34  50  35  51 ...
64  80  65  81 ...
...
```

After the second stage, they got transposed to

```
 0  16  32  48 ...
 1  17  33  49 ...
 2  18  34  49 ...
 3  19  35  51 ...
64  80  96 112 ...
65  81  97 114 ...
66  82  98 113 ...
67  83  99 115 ...
...
```

After the thrid stage, they got transposed to

```
  0  16  32  48   8  24  40  56  64  80  96  112 ...
  1  17  33  49 ...
  2  18  34  50 ...
  3  19  35  51 ...
  4  20  36  52 ...
  5  21  37  53 ...
  6  22  38  54 ...
  7  23  39  55 ...
128 144 160 176 ...
129 145 161 177 ...
...
```

After the last stage, they got transposed to

```
0  16  32  48  64  80  96 112 ... 240
1  17  33  49  66  81  97 113 ... 241
2  18  34  50  67  82  98 114 ... 242
...
15  31  47  63  79  96 111 127 ... 255
```

Reviewed By: dcaballe

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

14 months ago[X86] Add DAG test coverage for Issue #59867 patterns
Simon Pilgrim [Sun, 23 Apr 2023 17:39:45 +0000 (18:39 +0100)]
[X86] Add DAG test coverage for Issue #59867 patterns

14 months ago[BOLT] Remove unsupported ELF type reloc handling
Nathan Sidwell [Fri, 21 Apr 2023 17:42:20 +0000 (13:42 -0400)]
[BOLT] Remove unsupported ELF type reloc handling

Drop unsupported ELF format reloc handling -- RewriteInstance lacks
this flexibility elsewhere.

Reviewed By: rafauler

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

14 months ago[ARM] Fix qsat for armv5te/armv6 + thumb-mode
David Green [Sun, 23 Apr 2023 16:20:28 +0000 (17:20 +0100)]
[ARM] Fix qsat for armv5te/armv6 + thumb-mode

This is a Thumb1 target, so will not have qsat instructions available. There
was a mismatch between hasBaseDSP and the instruction patterns when +dsp was
present, which is set by clang (but maybe shouldn't be). The target being
thumb1-only should override that, implying that it does not have any qadds.

Fixes #62273

14 months ago[clang-tidy] Modernize FileState (NFC)
Kazu Hirata [Sun, 23 Apr 2023 16:07:23 +0000 (09:07 -0700)]
[clang-tidy] Modernize FileState (NFC)

14 months ago[mlir][irdl] Add IRDL registration
Mathieu Fehr [Fri, 10 Mar 2023 21:53:06 +0000 (22:53 +0100)]
[mlir][irdl] Add IRDL registration

This patch add support for loading IRDL dialects at runtime
with `mlir-opt`.

Given the following `dialect.irdl` file:
```mlir
module {
  irdl.dialect @cmath {
    irdl.type @complex {
      %0 = irdl.is f32
      %1 = irdl.is f64
      %2 = irdl.any_of(%0, %1)
      irdl.parameters(%2)
    }

    irdl.operation @norm {
      %0 = irdl.any
      %1 = irdl.parametric @complex<%0>
      irdl.operands(%1)
      irdl.results(%0)
    }
}
```

the IRDL file can be loaded with the `mlir-opt --irdl-file=dialect.irdl`
command, and the following file can then be parsed:

```mlir
func.func @conorm(%p: !cmath.complex<f32>, %q: !cmath.complex<f32>) -> f32 {
  %norm_p = "cmath.norm"(%p) : (!cmath.complex<f32>) -> f32
  %norm_q = "cmath.norm"(%q) : (!cmath.complex<f32>) -> f32
  %pq = arith.mulf %norm_p, %norm_q : f32
  return %pq : f32
}
```

To minimize the size of this patch, the operation, attribute, and type verifier are all always returning `success()`.

Depends on D144692

Reviewed By: rriddle, Mogball, mehdi_amini

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

14 months ago[X86] X86FixupInstTunings - add VPERMILPDri -> VSHUFPDrri mapping
Simon Pilgrim [Sun, 23 Apr 2023 10:48:50 +0000 (11:48 +0100)]
[X86] X86FixupInstTunings - add VPERMILPDri -> VSHUFPDrri mapping

Similar to the original VPERMILPSri -> VSHUFPSrri mapping added in D143787, replacing VPERMILPDri -> VSHUFPDrri should never be any slower and saves an encoding byte.

The sibling VPERMILPDmi -> VPSHUFDmi mapping is trickier as we need the same shuffle mask in every lane (and it needs to be adjusted) - I haven't attempted that yet but we can investigate it in the future if there's interest.

Fixes #61060

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

14 months agoRe-apply "[ORC][LLJIT] Use JITLink by default on ELF/x86-64." with fixes.
Lang Hames [Fri, 21 Apr 2023 04:45:46 +0000 (04:45 +0000)]
Re-apply "[ORC][LLJIT] Use JITLink by default on ELF/x86-64." with fixes.

This reapplies 85c649bc02a, which was reverted in 35767e43d62 due to failures
with some example programs. The fix was to add export_executable_symbols to the
example programs.

14 months ago[X86] X86FixupInstTuning.cpp - fix comment in ProcessVPERMILPSri. NFC.
Simon Pilgrim [Sun, 23 Apr 2023 09:32:04 +0000 (10:32 +0100)]
[X86] X86FixupInstTuning.cpp - fix comment in ProcessVPERMILPSri. NFC.

PERMILPS is only available on AVX or later (VEX/EVEX encoding)

14 months ago[X86] Precommit test case for D148980.
Luo, Yuanke [Sun, 23 Apr 2023 04:49:29 +0000 (12:49 +0800)]
[X86] Precommit test case for D148980.

14 months ago[TableGen] Remove unused method form ScopeMatcher. NFC
Craig Topper [Sun, 23 Apr 2023 07:44:39 +0000 (00:44 -0700)]
[TableGen] Remove unused method form ScopeMatcher. NFC

14 months ago[Coverity] Fix uninitialized scalar members in MC
Akshay Khadse [Sun, 23 Apr 2023 07:28:59 +0000 (15:28 +0800)]
[Coverity] Fix uninitialized scalar members in MC

This change fixes static code analysis errors

Reviewed By: pengfei

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

14 months ago[X86] Transform `(cmp eq/ne trunc(X), C)` -> `(cmp eq/ne X, Zext(C))`
Noah Goldstein [Sun, 23 Apr 2023 06:57:55 +0000 (01:57 -0500)]
[X86] Transform `(cmp eq/ne trunc(X), C)` -> `(cmp eq/ne X, Zext(C))`

This previously existed for `C == 0`, but is mostly beneficial for any
`C`.

There is a slight codesize cost as we get more imm32 (as opposed to
imm8) constants in some cases. But the benefit is was get less imm16
constants (LCP stalls) and save instructions in some vec -> scalar
codegen.

Reviewed By: RKSimon

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

14 months ago[symbolizer] Change error message if module not found (recommit)
Serge Pavlov [Sun, 23 Apr 2023 06:35:35 +0000 (06:35 +0000)]
[symbolizer] Change error message if module not found (recommit)

This is a recommit of 75f1f158812d, reverted in 7a443b1c493d, because
it caused compilation error in
compiler-rt/lib/sanitizer_common/symbolizer/sanitizer_symbolize.cpp.
The error was fixed by Kasimir Georgiev in de4c038c7ba2, but this
commit was reverted in de088dd3a0aa, because the initial commit was
reverted.

This commit reverts both the reverting commits, 7a443b1c493d and
de088dd3a0aa.

Original commit message is below.

If llvm-symbolize did not find module, the error looked like:

    LLVMSymbolizer: error reading file: No such file or directory

This message does not follow common practice: LLVMSymbolizer is not an
utility name. Also the message did not not contain the name of missed file.

With this change the error message looks differently:

    llvm-symbolizer: error: 'abc': No such file or directory

This format is closer to messages produced by other utilities and allow
proper coloring.

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

14 months ago[TableGen] Intialize vector with constructor instead of assign. NFC
Craig Topper [Sun, 23 Apr 2023 05:37:57 +0000 (22:37 -0700)]
[TableGen] Intialize vector with constructor instead of assign. NFC

14 months ago[Coverity] Fix explicit null dereferences
Akshay Khadse [Sun, 23 Apr 2023 04:06:54 +0000 (12:06 +0800)]
[Coverity] Fix explicit null dereferences

This change fixes static code analysis errors

Reviewed By: skan

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

14 months ago[TableGen] Re-work FactorNodes to avoid an extra temporary vector.
Craig Topper [Sun, 23 Apr 2023 04:04:55 +0000 (21:04 -0700)]
[TableGen] Re-work FactorNodes to avoid an extra temporary vector.

Instead of copying elements to the NewOptionsToMatchVector, we
now shift down elements in OptionsToMatch as we create holes by
pulling out equal matchers. After we finish processing the vector,
we'll trim the size to just the elements that are still in use.

14 months ago[Driver][NFC] Simplify code.
Jianjian GUAN [Fri, 21 Apr 2023 02:27:17 +0000 (10:27 +0800)]
[Driver][NFC] Simplify code.

Reviewed By: benshi001, jhuber6

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

14 months ago[Bazel] Rename LLVMTableGenGlobalISel to TableGenGlobalISel
NAKAMURA Takumi [Wed, 19 Apr 2023 14:27:20 +0000 (23:27 +0900)]
[Bazel] Rename LLVMTableGenGlobalISel to TableGenGlobalISel

14 months ago[CMake] Target/DirectX: Update deps
NAKAMURA Takumi [Sun, 23 Apr 2023 01:26:26 +0000 (10:26 +0900)]
[CMake] Target/DirectX: Update deps

14 months ago[CMake] Reorder deps and reformat
NAKAMURA Takumi [Sun, 23 Apr 2023 02:07:22 +0000 (11:07 +0900)]
[CMake] Reorder deps and reformat

14 months agoRevert "[OpenMP] Introduce kernel environment"
Shilei Tian [Sun, 23 Apr 2023 00:56:35 +0000 (20:56 -0400)]
Revert "[OpenMP] Introduce kernel environment"

This reverts commit 35cfadfbe2decd9633560b3046fa6c17523b2fa9.

It makes a couple of buildbots unhappy because of the following test failures:
- `Transforms/OpenMP/add_attributes.ll'`
- `mapping/declare_mapper_target_data.cpp` on AMDGPU

14 months ago[OpenMP] Introduce kernel environment
Shilei Tian [Sun, 23 Apr 2023 00:45:00 +0000 (20:45 -0400)]
[OpenMP] Introduce kernel environment

This patch introduces per kernel environment. Previously, flags such as execution mode are set through global variables with name like `__kernel_name_exec_mode`. They are accessible on the host by reading the corresponding global variable, but not from the device. Besides, some assumptions, such as no nested parallelism, are not per kernel basis, preventing us applying per kernel optimization in the device runtime.

This is a combination and refinement of patch series D116908, D116909, and D116910.

Reviewed By: jdoerfert

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

14 months ago[compiler-rt] [test] [asan] Skip the static asan testsuites on mingw targets
Martin Storsjö [Fri, 14 Apr 2023 09:26:14 +0000 (09:26 +0000)]
[compiler-rt] [test] [asan] Skip the static asan testsuites on mingw targets

Mingw only provides a dynamically linked CRT (contrary to
MSVC/clang-cl), so it is expected that the static asan test
configuration doesn't work.

Skip adding these test suites in mingw configurations.

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

14 months ago[libunwind] [SEH] Clear DISPATCHER_CONTEXT when initializing a cursor
Martin Storsjö [Tue, 18 Apr 2023 12:42:35 +0000 (15:42 +0300)]
[libunwind] [SEH] Clear DISPATCHER_CONTEXT when initializing a cursor

We only initialize a few fields in DISPATCHER_CONTEXT - don't leave
the rest in an uninitialized state; make sure the whole struct is
in a deterministic state.

This makes nondeterministic failures deterministic, for some cases
relating to forced unwinding on aarch64/arm (which requires filling
in parsing of the xdata for finding the exception handler and LSDA).

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

14 months ago[M68k] Override `CanLowerReturn` to fix assertion with large return
Ian Douglas Scott [Sat, 22 Apr 2023 19:01:28 +0000 (12:01 -0700)]
[M68k] Override `CanLowerReturn` to fix assertion with large return

If it couldn't fit the return value in two registers, this caused an
error during codegen. It seems this method is implemented in other
backends but not here, and allows it to pass return values in memory
when it isn't able to do so in registers.

Seems to fix compilation of Rust code with certain return types:
https://github.com/rust-lang/rust/issues/89498

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

14 months ago[X86] Fold PSHUF(VSHIFT(X,Y)) -> VSHIFT(PSHUF(X),Y)
Simon Pilgrim [Sat, 22 Apr 2023 19:02:27 +0000 (20:02 +0100)]
[X86] Fold PSHUF(VSHIFT(X,Y)) -> VSHIFT(PSHUF(X),Y)

PSHUFD/PSHUFLW/PSHUFHW can act as a vector move / folded load, notably helping simplify pre-AVX cases in particular.

This is a much milder alternative to refactoring canonicalizeShuffleWithBinOps to support SSE shifts nodes.

14 months ago[libc++] Remove the chrono include from algorithm
Ian Anderson [Sat, 15 Apr 2023 00:51:41 +0000 (17:51 -0700)]
[libc++] Remove the chrono include from algorithm

algorithm's include of chrono causes include cycles:

```
algorithm -> chrono -> __chrono/convert_to_tm.h -> __chrono/statically_widen.h -> __format/concepts.h -> __format/format_parse_context.h -> string_view -> algorithm

algorithm -> chrono -> __chrono/convert_to_tm.h -> __chrono/statically_widen.h -> __format/concepts.h -> __format/format_parse_context.h -> string_view -> functional -> __functional/boyer_moore_searcher.h -> array -> algorithm

algorithm -> chrono -> __chrono/convert_to_tm.h -> __chrono/statically_widen.h -> __format/concepts.h -> __format/format_parse_context.h -> string_view -> functional -> __functional/boyer_moore_searcher.h -> unordered_map -> algorithm

algorithm -> chrono -> __chrono/convert_to_tm.h -> __chrono/statically_widen.h -> __format/concepts.h -> __format/format_parse_context.h -> string_view -> functional -> __functional/boyer_moore_searcher.h -> vector -> algorithm
```

This is a problem for clang modules after the std mega module is broken up, because it becomes a module cycle which is a hard error.

All of the includes in the `__chrono` and `__format` headers are being used and so can't be removed. algorithm's include of chrono is already removed in C++20, whereas the array, string_view, unordered_map, vector includes of algorithm aren't removed until C++23 (and it's 4x the includes that would need removing). Unconditionally remove the chrono include from algorithm in all versions, so that the module breakup can happen (the module has to apply to all C++ versions).

Reviewed By: Mordante, #libc

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

14 months ago[X86] Add PERMILPD tuning test coverage for Issue #61060
Simon Pilgrim [Sat, 22 Apr 2023 16:49:51 +0000 (17:49 +0100)]
[X86] Add PERMILPD tuning test coverage for Issue #61060

14 months ago[X86] combineSetCCMOVMSK - fold allof movmskps/movmskpd -> testps/testpd
Simon Pilgrim [Sat, 22 Apr 2023 16:00:35 +0000 (17:00 +0100)]
[X86] combineSetCCMOVMSK - fold allof movmskps/movmskpd -> testps/testpd

Fixes #60007

14 months ago[X86] LowerBUILD_VECTOR - narrow 256/512-bit vector containing undef/freeze(undef...
Simon Pilgrim [Sat, 22 Apr 2023 14:27:40 +0000 (15:27 +0100)]
[X86] LowerBUILD_VECTOR - narrow 256/512-bit vector containing undef/freeze(undef)/zero in the upper half

Fixes #62286

14 months ago[X86] LowerBUILD_VECTOR - fold build_vector(undef,freeze(undef)) -> freeze(undef)
Simon Pilgrim [Sat, 22 Apr 2023 13:54:27 +0000 (14:54 +0100)]
[X86] LowerBUILD_VECTOR - fold build_vector(undef,freeze(undef)) -> freeze(undef)

Noticed while triaging #62286

14 months agoRevert "Revert "Fix handling of special and large vals in expand pattern for `round...
Ramiro Leal-Cavazos [Sat, 22 Apr 2023 14:15:26 +0000 (07:15 -0700)]
Revert "Revert "Fix handling of special and large vals in expand pattern for `round`" and "Add pattern that expands `math.roundeven` into `math.round` + arith""

This reverts commit 87cef78fa1c7bf6efc544e990894a6062d56abec.

The issue in the original revert is that a lit test expecting a `-nan`
as an output was failing on M2. Since the IEEE 754-2008 standard does
not require the sign to be printed when displaying a `nan`, this
commit changes the `CHECK` for `-nan` to one that checks the result
value bitcasted to an `i32` to ensure that input is being left
unchanged. This check should now be independent of platform being used
to run test.

Reviewed By: jpienaar, mehdi_amini

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

14 months ago[X86] Precommit test case for D148980.
Luo, Yuanke [Sat, 22 Apr 2023 12:02:14 +0000 (20:02 +0800)]
[X86] Precommit test case for D148980.

There is no cross-loop dependency for this case.

14 months ago[bazel] Fix bazel build for 7f069f5ef4fee00520ed0c350dca42c3c4b72b61
Haojian Wu [Sat, 22 Apr 2023 11:59:45 +0000 (13:59 +0200)]
[bazel] Fix bazel build for 7f069f5ef4fee00520ed0c350dca42c3c4b72b61

14 months ago[gn build] Port cd893308b5d4
LLVM GN Syncbot [Sat, 22 Apr 2023 10:56:47 +0000 (10:56 +0000)]
[gn build] Port cd893308b5d4

14 months ago[clang-tidy][NFC] Fix documentation for performance-avoid-endl
Piotr Zegar [Sat, 22 Apr 2023 10:54:51 +0000 (10:54 +0000)]
[clang-tidy][NFC] Fix documentation for performance-avoid-endl

Added missing new line after code block markup and before code.

14 months ago[clang-tidy] Add `performance-avoid-endl` check
AMS21 [Sat, 22 Apr 2023 10:50:42 +0000 (10:50 +0000)]
[clang-tidy] Add `performance-avoid-endl` check

This check flags uses of `std::endl` on streams and suggests using the newline character `'\n'` instead. `std::endl` performs two operations: it writes a newline character to the output stream and then flushes the stream buffer, which can be less efficient than writing a single newline character using `'\n'`.

This fixes llvm#35321

Reviewed By: PiotrZSL

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

14 months ago[libc++][regex] Uses operator<=> in sub_match.
Mark de Wever [Fri, 15 Jul 2022 06:21:19 +0000 (08:21 +0200)]
[libc++][regex] Uses operator<=> in sub_match.

The removal of operator!= in this header will be done in a separate
commit.

Note in the synopsis of P1614R2 there is a constexpr
  template<class BiIter>
    constexpr auto operator<=>(const sub_match<BiIter>& lhs, const sub_match<BiIter>& rhs);

In the implementation of P1614R2 there isn't a constexpr
  template<class BiIter>
    auto operator<=>(const sub_match<BiIter>& lhs, const sub_match<BiIter>& rhs);

There doesn't seem to be an LWG-issue, but it was fixed in the Standard
by removing the constexpr in b050fd474f11441942c88ef69b8622c8036656ac.

Implements part of:
- P1614R2 The Mothership has Landed

Reviewed By: #libc, ldionne

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

14 months agoFix use of unitialized variable 'mapperFunc' to prevent unexpected behaviour.
Akash Banerjee [Sat, 22 Apr 2023 09:50:35 +0000 (10:50 +0100)]
Fix use of unitialized variable 'mapperFunc' to prevent unexpected behaviour.

14 months ago[X86] Precommit test case for D148980.
Luo, Yuanke [Sat, 22 Apr 2023 07:39:00 +0000 (15:39 +0800)]
[X86] Precommit test case for D148980.

14 months ago[mlir] Fix i8/f32 confusion in comment
Rishabh Bali [Sat, 22 Apr 2023 06:29:17 +0000 (08:29 +0200)]
[mlir] Fix i8/f32 confusion in comment

Fixes https://github.com/llvm/llvm-project/issues/62275

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

14 months ago[clang][Sema][NFC] Add const where appropriate
Timm Bäder [Fri, 21 Apr 2023 06:20:51 +0000 (08:20 +0200)]
[clang][Sema][NFC] Add const where appropriate

14 months agoRevert "[OpenMP] Additional APIs used by the MSVC compiler for loop collapse"
Slava Zakharin [Sat, 22 Apr 2023 06:03:33 +0000 (23:03 -0700)]
Revert "[OpenMP] Additional APIs used by the MSVC compiler for loop collapse"

This reverts commit 7aa815fc782c5e39aefeec10d9c7c4cea7231975.

Buildbots are failing, e.g.:
https://lab.llvm.org/buildbot/#/builders/84/builds/36964
https://lab.llvm.org/buildbot/#/builders/193/builds/30096

14 months agoAdd a breakpoint manager that matches based on File/Line/Col Locations
Mehdi Amini [Mon, 6 Feb 2023 05:11:30 +0000 (21:11 -0800)]
Add a breakpoint manager that matches based on File/Line/Col Locations

This will match the locations attached to the IRunits passed in as context
with an action.

This is a recommit of d09c80515d0e after fixing the test on Windows.

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

14 months ago[mlir] tosa.reshape - Add InferTensorType interface
Aviad Cohen [Mon, 17 Apr 2023 06:44:06 +0000 (09:44 +0300)]
[mlir] tosa.reshape - Add InferTensorType interface

When this interface is used, a call to inferReturnTypeComponents()
is generated on creation and verification of the op.

Reviewed By: jpienaar

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

14 months agoRevert "Add a breakpoint manager that matches based on File/Line/Col Locations"
Mehdi Amini [Sat, 22 Apr 2023 05:24:05 +0000 (23:24 -0600)]
Revert "Add a breakpoint manager that matches based on File/Line/Col Locations"

This reverts commit d09c80515d0e7b1f1a81d3f18a3e799565f5e969.

This is broken on Windows

14 months ago[LVI][CVP] Don't compute CR at SelectInst Use if Cond value may not be well-defined
luxufan [Wed, 19 Apr 2023 11:57:27 +0000 (19:57 +0800)]
[LVI][CVP] Don't compute CR at SelectInst Use if Cond value may not be well-defined

If the condition value of SelectInst may be a poison or undef value,
infer constant range at SelectInst use is in correct.

See https://alive2.llvm.org/ce/z/MWMTYn

Fixes: https://github.com/llvm/llvm-project/issues/62200

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

14 months agoAdd a breakpoint manager that matches based on File/Line/Col Locations
Mehdi Amini [Mon, 6 Feb 2023 05:11:30 +0000 (21:11 -0800)]
Add a breakpoint manager that matches based on File/Line/Col Locations

This will match the locations attached to the IRunits passed in as context
with an action.

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

14 months ago[mlir] Check FunctionOpInterface castable type
Kai Sasaki [Sat, 22 Apr 2023 03:39:50 +0000 (12:39 +0900)]
[mlir] Check FunctionOpInterface castable type

As convertFuncOpTypes does not support other FuncOpInterface types, we should check the type to avoid assertion failure. The original issue was reported https://github.com/llvm/llvm-project/issues/61858.

Reviewed By: mehdi_amini

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

14 months ago[bazel] Update Bazel version to 6.1.2.
Aaron Siddhartha Mondal [Sat, 22 Apr 2023 02:54:49 +0000 (04:54 +0200)]
[bazel] Update Bazel version to 6.1.2.

Reviewed By: #bazel_build, MaskRay, akuegel, rupprecht

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

14 months agoRestore "[MemProf] Context disambiguation cloning pass [patch 2/3]"
Teresa Johnson [Fri, 21 Apr 2023 21:49:35 +0000 (14:49 -0700)]
Restore "[MemProf] Context disambiguation cloning pass [patch 2/3]"

This restores d0649a6ad8be778abf7569f502148d577f8bc6f1 (reverted in
commit 03bf59d275a16815dc5a2e3f279815554f7cd0ca), with fixes for bot
failures. Confirmed that gcc, which reproduced both failures, now
builds it fine.

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

14 months ago[libc] Do not include the RPC targets if we're not in GPU mode.
Joseph Huber [Sat, 22 Apr 2023 01:02:26 +0000 (20:02 -0500)]
[libc] Do not include the RPC targets if we're not in GPU mode.

Summary:
The RPC targets assume a GPU environment. Theoretically we can build
this in all cases, but it is unused in any other target so it shouldn't
be listed.

14 months ago[OpenMP] Additional APIs used by the MSVC compiler for loop collapse
Natalia Glagoleva [Sat, 22 Apr 2023 00:47:00 +0000 (17:47 -0700)]
[OpenMP] Additional APIs used by the MSVC compiler for loop collapse
(rectangular and non-rectangular loops)

Submitting on behalf of Natalia Glagoleva <natgla@microsoft.com>

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

14 months ago[TableGen] Early exit from ExpandHwModeBasedTypes when there are no HwModes.
Craig Topper [Sat, 22 Apr 2023 00:27:06 +0000 (17:27 -0700)]
[TableGen] Early exit from ExpandHwModeBasedTypes when there are no HwModes.

Most targets don't use HwModes. For these targets we can skip
collecting the HwModes and copying all the pattern pointers.

14 months ago[libc] [NFC] Fixed comments formatting style.
Raman Tenneti [Sat, 22 Apr 2023 00:02:04 +0000 (17:02 -0700)]
[libc] [NFC] Fixed comments formatting style.

Fixed comments formatting style.

Reviewed By: rtenneti

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

14 months ago[TableGen] Remove some unnecessary TreePatternNodePtrs. NFC
Craig Topper [Sat, 22 Apr 2023 00:09:44 +0000 (17:09 -0700)]
[TableGen] Remove some unnecessary TreePatternNodePtrs. NFC

The patterns we're referring are still owned by the PatternToMatch
object. We don't need to increment their reference count here.

14 months ago[Object] Always initialized StartOfFile in Archive::Child::Child constructor.
Jacek Caban [Fri, 21 Apr 2023 23:47:55 +0000 (23:47 +0000)]
[Object] Always initialized StartOfFile in Archive::Child::Child constructor.

Fixes uninitialized memory access revealed by https://reviews.llvm.org/D146534.

In empty archives, we use Child(nullptr,nullptr,nullptr) in Archive constructor in setFirstRegular. This copies unitialized StartOfFile to FirstRegularStartOfFile, which child_begin may use later.

Reviewed By: efriedma

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

14 months ago[FuzzMutate] Correct type cast and add unit test for FCmp
Peter Rong [Fri, 21 Apr 2023 23:35:45 +0000 (16:35 -0700)]
[FuzzMutate] Correct type cast and add unit test for FCmp

This revision fixes an incorrect type cast from Instruction to ICmpInstr, which should have been to FCmpInstr instead. It turns out that StrategiesTest.cpp was missing a test case for InstModificationIRStrategy and FCmp, which is also now implemented in this revision. After this revision, [[ https://reviews.llvm.org/D148854 | llvm-stress in D148854 ]] no longer crashes randomly.

Reviewed By: Peter

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

14 months ago[mlir][sparse] avoid slice rewriting when conditions are not met
Aart Bik [Fri, 21 Apr 2023 21:40:31 +0000 (14:40 -0700)]
[mlir][sparse] avoid slice rewriting when conditions are not met

Reviewed By: Peiming

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

14 months ago[RISCV] Pass data EEW instead of index EEW to V*Sched for indexed loads and stores
Nitin John Raj [Wed, 19 Apr 2023 23:08:55 +0000 (16:08 -0700)]
[RISCV] Pass data EEW instead of index EEW to V*Sched for indexed loads and stores

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

14 months ago[RISCV] Rename some variables to improve code clarity
Nitin John Raj [Wed, 19 Apr 2023 23:28:29 +0000 (16:28 -0700)]
[RISCV] Rename some variables to improve code clarity

14 months ago[Demangle] replace std::string_view::substr which may throw
Nick Desaulniers [Fri, 21 Apr 2023 22:51:29 +0000 (15:51 -0700)]
[Demangle] replace std::string_view::substr which may throw

llvm/Demangle copies the implementation from libcxxabi/src/demangle/.
libcxxabi/ cannot use potentially-throwing std::string_view::substr, so
change llvm/Demangle to avoid these function calls.

I ran into linkage failures stemming from the usage of
std::string_view::substr. substr does a bounds check and may throw.

Fixes: f198e0b594aa ("[StringView] remove dropFront")

Reviewed By: MaskRay

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

14 months ago[Demangle] remove unused params of microsoftDemangle
Nick Desaulniers [Fri, 21 Apr 2023 22:26:51 +0000 (15:26 -0700)]
[Demangle] remove unused params of microsoftDemangle

No call sites use these parameters, so drop them.

Reviewed By: MaskRay

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

14 months ago[CMake] Add missing find_package for LibEdit
Petr Hosek [Fri, 21 Apr 2023 22:34:11 +0000 (22:34 +0000)]
[CMake] Add missing find_package for LibEdit

After building and installing LLVM with LibEdit as a dependency, it is
necessary to find it again when LLVM is consumed by another CMake
project, otherwise CMake will report an error about a missing target.

Note that the FindLibEdit.cmake file is in the "LLVM Common CMake
Utils" directory, outside of the LLVM sub-project source directory, so
the installed LLVMConfig.cmake relies on the user having installed the
LLVM common CMake modules or make available their own Find module.

Also note that the controlling HAVE_LIBEDIT CMake variable in
LLVMConfig.cmake.in has a different naming convention compared to
other similar variables like 'LLVM_ENABLE_TERMINFO'. Refactoring this
name would involve touching additional files and should be a follow-up
commit.

Patch By: ekilmer

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

14 months ago[mlir][openacc] NFC Fix acc.databounds description incorrect bullet
Razvan Lupusoru [Fri, 21 Apr 2023 22:14:22 +0000 (15:14 -0700)]
[mlir][openacc] NFC Fix acc.databounds description incorrect bullet

A dash used in description is an automatic bullet in documentation
if it is the first character of the line. The dash used in the
particular location being fixed was intended to be a separator.
Thus move it to previous line to fix incorrect bullet-ization.

Reviewed By: clementval

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