platform/upstream/llvm.git
13 months ago[AMDGPU] Fix lowering of @llvm.amdgcn.set.inactive(imm, poison)
Jay Foad [Mon, 22 May 2023 14:40:57 +0000 (15:40 +0100)]
[AMDGPU] Fix lowering of @llvm.amdgcn.set.inactive(imm, poison)

If the second argument of V_SET_INACTIVE is undef/poison,
SIWholeQuadMode lowered it to a COPY from the first argument, but that
caused invalid MIR if the first argument was an immediate rather than a
register.

Fix this by lowering to a V_MOV instruction instead of a COPY.

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

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

13 months ago[Clang][Docs] Add help test to `-march` and `-mcpu` to suggest `-mcpu=help`
Joseph Huber [Mon, 22 May 2023 13:57:54 +0000 (08:57 -0500)]
[Clang][Docs] Add help test to `-march` and `-mcpu` to suggest `-mcpu=help`

Currently there is no documentation for these flags, users might find it
confusing to know which values are permitted. This change simply adds
documentation to suggest using `-mcpu=help` to list the availible target
names.

Reviewed By: aaron.ballman

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

13 months ago[bazel] Port 231a6959025b3101942701b214c64762b55222c6
Benjamin Kramer [Mon, 22 May 2023 15:11:25 +0000 (17:11 +0200)]
[bazel] Port 231a6959025b3101942701b214c64762b55222c6

13 months ago[llvm-profdata] Fix test on Windows
Michael Platings [Mon, 22 May 2023 14:56:29 +0000 (15:56 +0100)]
[llvm-profdata] Fix test on Windows

Output on Windows is "llvm-profdata.exe"

13 months agoAdd missing header for uint64_t
Paulo Matos [Mon, 22 May 2023 14:32:28 +0000 (16:32 +0200)]
Add missing header for uint64_t

LLVM fails to build in some environments with EXPENSIVE_CHECKS
due to the use of uint64_t without including cstdint.

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

13 months ago[InstCombine] Insert a bitcast to enable merging similar store insts
Anshil Gandhi [Fri, 19 May 2023 16:32:12 +0000 (10:32 -0600)]
[InstCombine] Insert a bitcast to enable merging similar store insts

Given two Store instructions with equivalent pointer operands,
they could be merged into their common successor basic block if
the value operand of one is bitcasted to match the type of the
other.

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

13 months ago[SME2/SVE2p1] Extend llvm.aarch64.sve.convert.to/from.svbool to accept target("aarch6...
Sander de Smalen [Mon, 22 May 2023 13:52:18 +0000 (13:52 +0000)]
[SME2/SVE2p1] Extend llvm.aarch64.sve.convert.to/from.svbool to accept target("aarch64.svcount")

The convert intrinsics can be used to implement existing operations on svcount_t
when the actual bits/content of the predicate register doesn't matter (such
as PSEL, which copies the full contents of the first source register to the
destination register).

Reviewed By: CarolineConcatto, david-arm

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

13 months ago[SME2/SVE2p1] Change psel intrinsic such that the result/first operand are not overlo...
Sander de Smalen [Mon, 22 May 2023 13:52:06 +0000 (13:52 +0000)]
[SME2/SVE2p1] Change psel intrinsic such that the result/first operand are not overloaded.

All the bits of the first operand are copied to the destination register,
if the tested bit (in the second source operand) is active. This means we
copy over all vscale x 16 x i1's of the first operand. There is no need to
overload that type.

Reviewed By: david-arm

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

13 months ago[AArch64][SME2/SVE2p1] Add predicate-as-counter intrinsics for ld1/ldnt1/st1/stnt1
Sander de Smalen [Mon, 22 May 2023 13:37:34 +0000 (13:37 +0000)]
[AArch64][SME2/SVE2p1] Add predicate-as-counter intrinsics for ld1/ldnt1/st1/stnt1

These intrinsics are used to implement multi-vector load/store intrinsics that loads
or stores a tuple of 2 or 4 values, based on a predicate-as-counter operand, e.g.

  __attribute__((arm_streaming))
  svuint8x2_t svld1[_u8]_x2(svcount_t png, const uint8_t *rn);

  __attribute__((arm_streaming))
  void svst1[_u8_x2](svcount_t png, uint8_t *rn, svuint8x2_t zt);

As described in https://github.com/ARM-software/acle/pull/217

Reviewed By: CarolineConcatto

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

13 months ago[AArch64][SME2/SVE2p1] Add predicate-as-counter intrinsics for sel
Sander de Smalen [Mon, 22 May 2023 13:37:19 +0000 (13:37 +0000)]
[AArch64][SME2/SVE2p1] Add predicate-as-counter intrinsics for sel

These intrinsics are used to implement the sel intrinsics that selects
a tuple of 2 or 4 values based on a predicate-as-counter operand, e.g.

  __attribute__((arm_streaming))
  svuint8x2_t svsel[_u8_x2](svcount_t png, svuint8x2_t zn, svuint8x2_t zm);

  __attribute__((arm_streaming))
  svuint8x4_t svsel[_u8_x4](svcount_t png, svuint8x4_t zn, svuint8x4_t zm);

As described in https://github.com/ARM-software/acle/pull/217

Reviewed By: CarolineConcatto

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

13 months ago[PostOrderIterator] Store end iterator (NFC)
Nikita Popov [Mon, 22 May 2023 13:04:18 +0000 (15:04 +0200)]
[PostOrderIterator] Store end iterator (NFC)

Store the end iterator on the VisitStack, instead of recomputing
it every time, as doing so is not free.

13 months ago[llvm-profdata] Accept --version argument
Michael Platings [Mon, 22 May 2023 13:43:25 +0000 (14:43 +0100)]
[llvm-profdata] Accept --version argument

The `llvm-profdata --version` output now looks like:

  llvm-profdata
  LLVM (http://llvm.org/):
    LLVM version 17.0.0git
    Optimized build with assertions.

This makes llvm-profdata more consistent with other tools.

Reviewed By: simon_tatham

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

13 months ago[RISCV][test] Finish removing unneeded (implied) 'f' from Zvfbfwma, Zvfbfmin attribut...
Alex Bradbury [Mon, 22 May 2023 13:38:05 +0000 (14:38 +0100)]
[RISCV][test] Finish removing unneeded (implied) 'f' from Zvfbfwma, Zvfbfmin attribute tests

Missed a hunk in a6e2b1ee49f553a06e22729d90e0a2738caf052e.

13 months ago[RISCV][test] Remove unneeded (implied) 'f' from Zvfbfwma, Zvfbfmin attribute tests
Alex Bradbury [Mon, 22 May 2023 13:33:38 +0000 (14:33 +0100)]
[RISCV][test] Remove unneeded (implied) 'f' from Zvfbfwma, Zvfbfmin attribute tests

This means the test properly checks that RISCVISAInfo includes the
implication for the F extension (directly, or indirectly through
zve32f).

13 months ago[clang] Fix crash on attempt to initialize union with flexible array member
Mariya Podchishchaeva [Mon, 22 May 2023 13:08:57 +0000 (09:08 -0400)]
[clang] Fix crash on attempt to initialize union with flexible array member

Due to missing check on union, there was a null expression
added to init list that caused crash later.

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

Reviewed By: aaron.ballman, shafik

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

13 months ago[RISCV][test][NFC] Trim unneeded +f/+d from -mattr in bfloat16 extension tests
Alex Bradbury [Mon, 22 May 2023 13:21:28 +0000 (14:21 +0100)]
[RISCV][test][NFC] Trim unneeded +f/+d from -mattr in bfloat16 extension tests

13 months ago[SCEV] Replace NumTripCountsComputed stat with NumExitCountsComputed
Dmitry Makogon [Wed, 3 May 2023 07:19:57 +0000 (14:19 +0700)]
[SCEV] Replace NumTripCountsComputed stat with NumExitCountsComputed

This fixes assertion crash in https://github.com/llvm/llvm-project/issues/62380.

In the beginning of ScalarEvolution::getBackedgeTakenInfo
we make sure that BackedgeTakenCounts contains an entry
for the given loop.
Then we call computeBackedgeTakenCount which computes the result,
and in the end we insert it in the map like so:

  return BackedgeTakenCounts.find(L)->second = std::move(Result);

So we expect that the entry for L still exists in the cache.
However, it can get deleted. When it has computed the result,
getBackedgeTakenInfo clears all the cached SCEVs that use the AddRecs in the loop.

In the crashing example, getBackedgeTakenInfo first gets called on an inner loop,
and during this call it gets called again on its parent loop.
This recursion happens after the call to computeBackedgeTakenCount.
And it happens so that some SCEV from the BTI of the child loop uses
an AddRec of the parent loop. So when we successfully compute BTI
for the parent loop, we erase already computed result for the child one.

The recursion happens in some debug only code that
updates statistics. The algorithm itself is non-recursive.
Namely the recursive call happens in BackedgeTakenInfo::getExact function
and its return value is only used to compare it against SCEVCouldNotCompute.

As suggested by nikic I replaced the NumTripCountsComputed and NumTripCountsNotComputed
with NumExitCountsComputed and NumExitCountsNotComputed respectively.
They are updated during computations made for single exits. It relieves us of the need
to compute exact exit count for the loop just to update the named
statistic and thus the recursion cannot happen anymore.

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

13 months ago[SLP][RISCV] Account for offset folding in getPointersChainCost
Luke Lau [Tue, 2 May 2023 13:46:22 +0000 (14:46 +0100)]
[SLP][RISCV] Account for offset folding in getPointersChainCost

For a GEP in a pointer chain, if:
1) a pointer chain is unit-strided
2) the base pointer wasn't folded and is sitting in a register somewhere
3) the distance between the GEP and the base pointer is small enough and
   can be folded into the addressing mode of the using load/store

Then we can exclude that GEP from the total cost of the pointer chain,
as it will likely be folded away.

In order to check if 3) holds, we need to know the type of memory access
being made by the users of the pointer chain. For that, we need to pass
along a new argument to getPointersChainCost. (Using the source pointer
type of the GEP isn't accurate, see https://reviews.llvm.org/D149889 for
more details).

Also note that 2) is currently an assumption, and could be modelled more
accurately.

This prevents some unprofitable cases from being SLP vectorized on
RISC-V by making the scalar costs cheaper and closer to the actual
codegen.

For now the getPointersChainCost hook is duplicated for RISC-V to prevent
disturbing other targets, but could be merged back in and shared with
other targets in a following patch.

Reviewed By: ABataev

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

13 months ago[flang] Handle array constants of any rank
Leandro Lupori [Tue, 16 May 2023 13:06:13 +0000 (13:06 +0000)]
[flang] Handle array constants of any rank

Add support for representing array constants of any rank with MLIR
dense attribute. This greatly improves compile time and memory
usage of programs with large array constants. We still support only
arrays of a few basic types, such as integer, real and logic.

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

Reviewed By: jeanPerier

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

13 months agoRevert "Revert "[Flang][OpenMP][MLIR] Add declare target attribute set and interface...
Andrew Gozillon [Mon, 22 May 2023 12:30:41 +0000 (07:30 -0500)]
Revert "Revert "[Flang][OpenMP][MLIR] Add declare target attribute set and interface for the OpenMP dialect""

This reverts commit aa6b47cdaf3cddc70b7af33c1edbda502ecb3d05.

And adds a fix (adding missing libraries
to CMakeLists.txt for the OpenMPDialect)
that allows failing builds to succeed.

13 months ago[mlir][tensor][bufferize] Bufferize tensor.splat op
Matthias Springer [Mon, 22 May 2023 12:13:08 +0000 (14:13 +0200)]
[mlir][tensor][bufferize] Bufferize tensor.splat op

The op bufferizes similarly to tensor.generate: it is lowered to a linalg.map, which may then lower to a loop nest that fills the buffer.

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

13 months ago[clang][dataflow] Fix a null pointer crash in `computeBlockInputState()`.
Martin Braenne [Mon, 22 May 2023 09:52:31 +0000 (09:52 +0000)]
[clang][dataflow] Fix a null pointer crash in `computeBlockInputState()`.

The crash was due to unconditionally calling
`Block.succ_begin()->getReachableBlock()->hasNoReturnElement()`, but
`getReachableBlock()` can return null now that we have turned
`PruneTriviallyFalseEdges` on.

This patch adds two tests that crash without the fix.

Reviewed By: ymandel

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

13 months agoAdd WG14 N2607 to the list of backported features
Aaron Ballman [Mon, 22 May 2023 12:14:42 +0000 (08:14 -0400)]
Add WG14 N2607 to the list of backported features

Arrays and their element types are identically qualified as of C2x,
and we support that behavior as far back as C89.

As a drive-by, this adds the paper number for designated initializers
so that all the WG14 features can be uniquely identified despite the
lack of a feature testing macro.

13 months ago[MLIR][LLVM] Allow inlining llvm.intr.assume.
Johannes de Fine Licht [Mon, 22 May 2023 12:00:22 +0000 (12:00 +0000)]
[MLIR][LLVM] Allow inlining llvm.intr.assume.

This operation is not marked pure because it needs to survive DCE, but
is otherwise safe to inline.

Reviewed By: Dinistro

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

13 months ago[MLIR][LLVM] Allow inlining noalias attributes.
Johannes de Fine Licht [Mon, 22 May 2023 11:54:36 +0000 (11:54 +0000)]
[MLIR][LLVM] Allow inlining noalias attributes.

We can not yet generate new aliasing metadata based on these arguments
because their global nature does not allow parallel inlining, but since
this is not necessary for correctness, we allow inlining functions that
have arguments with the noalias attribute for now.

Reviewed By: gysit

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

13 months ago[LLDB] Fix missing import in TestInterruptBacktrace.py
Muhammad Omair Javaid [Mon, 22 May 2023 11:46:11 +0000 (15:46 +0400)]
[LLDB] Fix missing import in TestInterruptBacktrace.py

This fixed missing import of lldbsuite.test.decorators in TestInterruptBacktrace.py.

13 months ago[AMDGPU] Handle multiple occurences of an incoming value in break large PHIs
pvanhout [Mon, 22 May 2023 09:15:15 +0000 (11:15 +0200)]
[AMDGPU] Handle multiple occurences of an incoming value in break large PHIs

We naively broke all incoming values, assuming they'd be unique.
However it's not illegal to have multiple occurences of, e.g. `[BB0, V0]`
in a PHI node. What's illegal though is having the same basic block
multiple times but with different values, and it's exactly what the
transform caused. This broke in some rare applications where the pattern
arised.

Now we cache the `BasicBlock, Value` pairs we're breaking so we can reuse the values and preserve this invariant.

Solves SWDEV-399460

Reviewed By: #amdgpu, rovka

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

13 months ago[11/11][POC][Clang][RISCV] Define vset for tuple type
eopXD [Mon, 10 Apr 2023 07:36:44 +0000 (00:36 -0700)]
[11/11][POC][Clang][RISCV] Define vset for tuple type

For the cover letter of this patch-set, please checkout D146872.

Depends on D147916.

This is the 11th patch of the patch-set.

This patch is a proof-of-concept and will be extended to full coverage
in the future. Only vset for tuple type of NF=2, EEW=32, LMUL=1 is
defined now.

Reviewed By: craig.topper

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

13 months ago[10/11][POC][Clang][RISCV] Define vget for tuple type
eopXD [Mon, 10 Apr 2023 07:18:34 +0000 (00:18 -0700)]
[10/11][POC][Clang][RISCV] Define vget for tuple type

For the cover letter of this patch-set, please checkout D146872.

Depends on D147915.

This is the 10th patch of the patch-set.

This patch is a proof-of-concept and will be extended to full coverage
in the future. Only vget for tuple type of NF=2, EEW=32, LMUL=1 is
defined now.

Reviewed By: craig.topper

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

13 months ago[9/11][POC][Clang][RISCV] Define tuple type variant of vsoxseg2ei32 vsuxseg2ei32
eopXD [Sat, 8 Apr 2023 19:14:54 +0000 (12:14 -0700)]
[9/11][POC][Clang][RISCV] Define tuple type variant of vsoxseg2ei32 vsuxseg2ei32

For the cover letter of this patch-set, please checkout D146872.

Depends on D147914.

This is the 9th patch of the patch-set.

This patch is a proof-of-concept and will be extended to full coverage
in the future. Currently, the old non-tuple indexed segment store is
not removed, and only signed integer indexed segment store of NF=2,
EEW=32 is defined here.

Reviewed By: craig.topper

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

13 months ago[8/11][POC][Clang][RISCV] Define tuple type variant of vloxseg2ei32 vluxseg2ei32
eopXD [Sat, 8 Apr 2023 19:00:28 +0000 (12:00 -0700)]
[8/11][POC][Clang][RISCV] Define tuple type variant of vloxseg2ei32 vluxseg2ei32

For the cover letter of this patch-set, please checkout D146872.

Depends on D147913.

This is the 8th patch of the patch-set.

This patch is a proof-of-concept and will be extended to full coverage
in the future. Currently, the old non-tuple indexed segment load is
not removed, and only signed integer indexed segment load of NF=2,
EEW=32 is defined here.

Reviewed By: craig.topper

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

13 months ago[Bazel] Add missing tablegen.
Johannes Reifferscheid [Mon, 22 May 2023 11:07:45 +0000 (13:07 +0200)]
[Bazel] Add missing tablegen.

(For MemorySlotTypeInterfaces)

Summary:

Reviewers: khasanovaa

Subscribers:

13 months ago[7/11][POC][Clang][RISCV] Define tuple type variant of vssseg2e32
eopXD [Sat, 8 Apr 2023 18:15:33 +0000 (11:15 -0700)]
[7/11][POC][Clang][RISCV] Define tuple type variant of vssseg2e32

For the cover letter of this patch-set, please checkout D146872.

Depends on D147912.

This is the 7th patch of the patch-set.

This patch is a proof-of-concept and will be extended to full coverage
in the future. Currently, the old non-tuple strided segment store is
not removed, and only signed integer strided segment store of NF=2,
EEW=32 is defined here.

Reviewed By: craig.topper

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

13 months ago[6/11][POC][Clang][RISCV] Define tuple type variant of vlsseg2e32
eopXD [Sat, 8 Apr 2023 15:40:49 +0000 (08:40 -0700)]
[6/11][POC][Clang][RISCV] Define tuple type variant of vlsseg2e32

For the cover letter of this patch-set, please checkout D146872.

Depends on D147911.

This is the 6th patch of the patch-set.

This patch is a proof-of-concept and will be extended to full coverage
in the future. Currently, the old non-tuple strided segment load is not
removed, and only signed integer strided segment load of NF=2, EEW=32
is defined here.

Reviewed By: craig.topper

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

13 months ago[5/11][POC][Clang][RISCV] Define tuple type variant of vlseg2e32ff
eopXD [Sat, 8 Apr 2023 15:25:49 +0000 (08:25 -0700)]
[5/11][POC][Clang][RISCV] Define tuple type variant of vlseg2e32ff

For the cover letter of this patch-set, please checkout D146872.

Depends on D147774.

This is the 5th patch of the patch-set.

This patch is a proof-of-concept and will be extended to full coverage
in the future. Currently, the old non-tuple unit-stride fault-first
segment load is not removed, and only signed integer unit-stride
fault-first segment load of NF=2, EEW=32 is defined here.

Reviewed By: craig.topper

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

13 months agoRevert "[Flang][OpenMP][MLIR] Add declare target attribute set and interface for...
Andrew Gozillon [Mon, 22 May 2023 11:03:21 +0000 (06:03 -0500)]
Revert "[Flang][OpenMP][MLIR] Add declare target attribute set and interface for the OpenMP dialect"

This reverts commit 95b0b867b0d19919133693b8e75b170fd25a9cec.

Revert until fix found for certain failing buildbots

13 months ago[AMDGPU] Simplify scavenging in indirectCopyToAGPR
Jay Foad [Wed, 17 May 2023 13:15:02 +0000 (14:15 +0100)]
[AMDGPU] Simplify scavenging in indirectCopyToAGPR

This just makes it clearer that we do not want the scavenger to spill
here. NFCI.

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

13 months ago[LLDB] Skip TestInterruptBacktrace.py on Arm/Linux
Muhammad Omair Javaid [Mon, 22 May 2023 10:43:52 +0000 (14:43 +0400)]
[LLDB] Skip TestInterruptBacktrace.py on Arm/Linux

TestInterruptBacktrace.py started randonmly failing on Arm/Linux
buildbot since e19387e6936c. This patch marks it skipped.

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

13 months ago[flang][hlfir] Lower hlfir.where when there are no conflicts
Jean Perier [Mon, 22 May 2023 08:14:34 +0000 (10:14 +0200)]
[flang][hlfir] Lower hlfir.where when there are no conflicts

Lower hlfir.where when the scheduling analysis determined that no
temporary storage is needed.

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

13 months ago[clangd] Renaming: Treat member functions like other functions
Christian Kandeler [Tue, 16 May 2023 15:41:30 +0000 (17:41 +0200)]
[clangd] Renaming: Treat member functions like other functions

... by skipping the conflict check. The same considerations apply.

Reviewed By: hokein

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

13 months ago[flang][hlfir] Enable WHERE scheduling in LowerHLFIROrderedAssignments
Jean Perier [Mon, 22 May 2023 10:48:58 +0000 (12:48 +0200)]
[flang][hlfir] Enable WHERE scheduling in LowerHLFIROrderedAssignments

Nothing special is needed, other than adding the logging code for where
masks and to plug the pattern. This tests mainly adds test.

Note that some of the justifications to create temps shows some lacks of
side effect interface on operations (like hlfir.transpose), or on some
transparent llvm intrinsic calls (llvm.stacksave/restore).
I think we should as much as possible try to improve this on the ops
generate code rather than special casing it here.

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

13 months ago[MLIR][OpenMP] Set AllocaIP correctly for constructs nested in task
Kiran Chandramohan [Mon, 22 May 2023 09:50:28 +0000 (09:50 +0000)]
[MLIR][OpenMP] Set AllocaIP correctly for constructs nested in task

Fixes #60874

Reviewed By: psoni2628, NimishMishra

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

13 months ago[Flang][OpenMP][MLIR] Add declare target attribute set and interface for the OpenMP...
Andrew Gozillon [Mon, 22 May 2023 10:40:16 +0000 (05:40 -0500)]
[Flang][OpenMP][MLIR] Add declare target attribute set and interface for the OpenMP dialect

This attribute represents the OpenMP declare target directive, it marks a function
or global as declare target by being present but also contains information on
the device_type and capture clause (link or to). It being an attribute allows it to
mark existing constructs and be converted trivially on lowering from the OpenMP
dialect to MLIR using amendOperation.

An interface has been made for the declare target attribute, with several helper
methods for managing the attribute, this interface can be applied to MLIR
operations that are allowed to be marked as declare target (as an example, it
is by default applied to func.func, LLVMFunc, fir.GlobalOps and LLVMGlobalOps).

Reviewers: kiranchandramohan

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

13 months ago[Clang][RISCV] Remove unused variable `IsTuple` for structure `RVVIntrinsic`
eopXD [Mon, 22 May 2023 10:39:12 +0000 (03:39 -0700)]
[Clang][RISCV] Remove unused variable `IsTuple` for structure `RVVIntrinsic`

Signed-off by: eop Chen <eop.chen@sifive.com>

13 months ago[libclc] Fix linking against libLLVMSupport
Thomas Debesse [Mon, 22 May 2023 10:20:59 +0000 (12:20 +0200)]
[libclc] Fix linking against libLLVMSupport

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

13 months agoAdd missing includes.
Johannes Reifferscheid [Mon, 22 May 2023 09:52:10 +0000 (11:52 +0200)]
Add missing includes.

Reviewed By: khasanovaa

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

13 months ago[4/11][POC][Clang][RISCV] Define tuple type variant of vsseg2e32
eopXD [Fri, 7 Apr 2023 09:21:44 +0000 (02:21 -0700)]
[4/11][POC][Clang][RISCV] Define tuple type variant of vsseg2e32

For the cover letter of this patch-set, please checkout D146872.

Depends on D147731.

This is the 4th patch of the patch-set.

This patch is a proof-of-concept and will be extended to full coverage
in the future. Currently, the old non-tuple unit-stride segment store is
not removed, and only signed integer unit-strided segment store of NF=2,
EEW=32 is defined here.

Reviewed By: craig.topper

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

13 months ago[3/11][POC][Clang][RISCV] Add typedef of the tuple type and define tuple type variant...
eopXD [Thu, 6 Apr 2023 08:29:18 +0000 (01:29 -0700)]
[3/11][POC][Clang][RISCV] Add typedef of the tuple type and define tuple type variant of vlseg2e32

For the cover letter of this patch-set, please checkout D146872.

Depends on D146873.

This is the 3rd patch of the patch-set. This patch originates from
D99593.

Note: This patch is a proof-of-concept and will be extended to full
coverage in the future. Currently, the old non-tuple unit-stride
segment load is not removed, and only signed integer unit-strided
segment load of NF=2, EEW=32 is defined here.

When replacing the old intrinsics, the extra `IsTuple` parameter under
various places will be redundant and removed.

Authored-by: eop Chen <eop.chen@sifive.com>
Co-Authored-by: Hsiangkai Wang <kai.wang@sifive.com>
Reviewed By: craig.topper

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

13 months agoValueTracking: Drop rounding mode check for constrained_sqrt in CannotBeNegativeZero
Matt Arsenault [Tue, 16 May 2023 20:47:39 +0000 (21:47 +0100)]
ValueTracking: Drop rounding mode check for constrained_sqrt in CannotBeNegativeZero

The only value that can produce -0 is exactly -0, no rounding is involved. If the
denormal mode has flushed denormal inputs, a negative value could produce -0.
The constrained intrinsics do not track the denormal mode, and this is just
generally broken in the current set of FP predicates. The move to computeKnownFPClass
will address some of these issues.

13 months ago[VPlan] Add missing ifdef after 96686796f606.
Florian Hahn [Mon, 22 May 2023 09:44:17 +0000 (10:44 +0100)]
[VPlan] Add missing ifdef after 96686796f606.

Fixes build with debug printing disabled.

13 months agoValueTracking: Fix broken fabs implementation for computeKnownFPClass, again
Matt Arsenault [Sat, 20 May 2023 09:23:16 +0000 (10:23 +0100)]
ValueTracking: Fix broken fabs implementation for computeKnownFPClass, again

This was only half complete. We need to enable the positive fields
for any negative classes.

13 months agoValueTracking: Add some regression tests for fabs handling in computeKnownFPClass
Matt Arsenault [Sat, 20 May 2023 09:07:56 +0000 (10:07 +0100)]
ValueTracking: Add some regression tests for fabs handling in computeKnownFPClass

13 months ago[Bazel] Fixup for 612781918fb01a2a0985a1c4c9200f5d5d1581cc
Krasimir Georgiev [Mon, 22 May 2023 09:18:48 +0000 (09:18 +0000)]
[Bazel] Fixup for 612781918fb01a2a0985a1c4c9200f5d5d1581cc

13 months ago[SLP][RISCV] Add test for folding offsets in GEP pointer chains
Luke Lau [Mon, 22 May 2023 08:50:23 +0000 (09:50 +0100)]
[SLP][RISCV] Add test for folding offsets in GEP pointer chains

13 months ago[mlir] Add a generic SROA implementation.
Théo Degioanni [Mon, 22 May 2023 08:49:31 +0000 (08:49 +0000)]
[mlir] Add a generic SROA implementation.

This revision introduces a generic implementation of Scalar Replacement
Of Aggregates. In contrast to the implementation in LLVM, this focuses
on the core of SROA: destructuring aggregates. By implementing
interfaces on allocators and accessors, memory allocators can be
destructured into smaller allocators, through the MemorySlot
abstraction.

This pass only works on aggregates that are accessed in a "type-safe"
way, that is within the bounds and respecting the type of a given memory
slot. The destructuring pattern and functions only peel off the first
layer of aggregates and can safely be applied repeatedly. For
convenience, the transformation is also available as a pass that will
apply the pattern repeatedly.

Depends on D149958

Reviewed By: gysit

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

13 months ago[VPlan] Move live-out printing to VPLiveOut::print (NFC).
Florian Hahn [Mon, 22 May 2023 08:53:52 +0000 (09:53 +0100)]
[VPlan] Move live-out printing to VPLiveOut::print (NFC).

Preparation for D150398. This brings live-out printing in line with how
printing for recipes is handled.

13 months ago[JITLink][RISCV] Consider relaxable call edges for PLT edges
Job Noorman [Mon, 22 May 2023 08:38:01 +0000 (10:38 +0200)]
[JITLink][RISCV] Consider relaxable call edges for PLT edges

For linker relaxation (D149526), a new edge kind (`CallRelaxable`) was
introduced. However, this new kind was not taken into account by
`PerGraphGOTAndPLTStubsBuilder_ELF_riscv`. This patch fixes this.

Reviewed By: StephenFan

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

13 months ago[lldb] Fix enumeration value 'RvvInt32m1x2' not handled in switch (NFC)
Jie Fu [Mon, 22 May 2023 08:27:50 +0000 (16:27 +0800)]
[lldb] Fix enumeration value 'RvvInt32m1x2' not handled in switch (NFC)

/data/llvm-project/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp:4851:13: error: enumeration value 'RvvInt32m1x2' not handled in switch [-Werror,-Wswitch]
    switch (llvm::cast<clang::BuiltinType>(qual_type)->getKind()) {
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
ninja: build stopped: subcommand failed.

13 months ago[Bazel] Fixup for 3128b3105d7a226fc26174be265da479ff619f3e
Krasimir Georgiev [Mon, 22 May 2023 08:23:57 +0000 (08:23 +0000)]
[Bazel] Fixup for 3128b3105d7a226fc26174be265da479ff619f3e

13 months ago[mlir] don't hardcode PDL_Operation in TestTransformDialectExtensions
Alex Zinenko [Wed, 17 May 2023 15:06:41 +0000 (15:06 +0000)]
[mlir] don't hardcode PDL_Operation in TestTransformDialectExtensions

Update operations in Transform dialect extensions used for testing to
use the more generic `TransformHandleTypeInterface` type constraint
instead of hardcoding `PDL_Operation`. See
https://discourse.llvm.org/t/rfc-type-system-for-the-transform-dialect/65702
for motivation. This is particularly important as these tests are often
used as source of best practices.

Update tests to use `!transform.any_op` instead of `!pdl.operation`.

Depends On D150785

Reviewed By: nicolasvasilache

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

13 months ago[mlir] NFC: use !transform.any_op in relevant tests
Alex Zinenko [Wed, 17 May 2023 14:40:44 +0000 (14:40 +0000)]
[mlir] NFC: use !transform.any_op in relevant tests

Update various tests using Transform dialect extensions to pervasively
use `!transform.any_op` instead of `!pdl.operation`. Tests are sometimes
used as source of knowledge for best practices and these were doing the
opposite of what is considered best practices per
https://discourse.llvm.org/t/rfc-type-system-for-the-transform-dialect/65702.

Reviewed By: nicolasvasilache

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

13 months ago[Clang][RISCV] Add missing requirement in test case rvv-tuple-type.c
eopXD [Mon, 22 May 2023 08:10:22 +0000 (01:10 -0700)]
[Clang][RISCV] Add missing requirement in test case rvv-tuple-type.c

Signed-off by: eop Chen <eop.chen@sifive.com>

13 months ago[2/11][POC][Clang][RISCV] Define RVV tuple types
eopXD [Sat, 25 Mar 2023 14:02:58 +0000 (07:02 -0700)]
[2/11][POC][Clang][RISCV] Define RVV tuple types

For the cover letter of this patch-set, please checkout D146872.

Depends on D146872.

This is the 2nd patch of the patch-set. This patch originates from
D97264. This patch further allows local variable declaration and
function parameter passing by adjustment in clang lowering.

Test cases are provided to demonstrate the LLVM IR generated.

Note: This patch is currently only a proof-of-concept with only a
single RVV tuple type declared here, the rest will be added when
the concept of this patch-set is accepted.

Authored-by: eop Chen <eop.chen@sifive.com>
Co-Authored-by: Hsiangkai Wang <kai.wang@sifive.com>
Reviewed By: craig.topper

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

13 months ago[clang][dataflow] Fix a bug in handling of `operator->` for optional checker.
Martin Braenne [Mon, 22 May 2023 06:17:55 +0000 (06:17 +0000)]
[clang][dataflow] Fix a bug in handling of `operator->` for optional checker.

Prior to this patch, `operator->` was being handled like `operator*`: It was
associating a `Value` of type `T` with the expression result (where `T` is the
template argument of the `optional<T>`). This is correct for `operator*`, which
returns a reference (of some flavor) to `T`, so that the result of the
`CXXOperatorCallExpr` is a glvalue of type `T`. However, `operator*` returns a
`T*`, so the result of the `CXXOperatorCallExpr` is a prvalue `T*`, which should
therefore be associated with `PointerValue` that in turn refers to a `T`.

I noticed this issue while working on the migration to strict handling of
value categories (see https://discourse.llvm.org/t/70086). The current behavior
also seems problematic more generally because it's plausible that the framework
may at some point introduce behavior that assumes an `Expr` of pointer type is
always associated with a `PointerValue`.

As it turns out, this patch fixes an existing FIXME in the test
`OptionalValueInitialization`.

Depends On D150657

Reviewed By: ymandel

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

13 months ago[clang][dataflow] Use `Strict` accessors in SignAnalysisTest.cpp.
Martin Braenne [Mon, 22 May 2023 06:17:43 +0000 (06:17 +0000)]
[clang][dataflow] Use `Strict` accessors in SignAnalysisTest.cpp.

This patch is part of the ongoing migration to strict handling of value categories (see https://discourse.llvm.org/t/70086 for details).

Depends On D150656

Reviewed By: sammccall, ymandel, xazax.hun

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

13 months ago[clang][dataflow] Use `Strict` accessors in TypeErasedDataflowAnalysis.cpp.
Martin Braenne [Mon, 22 May 2023 06:17:30 +0000 (06:17 +0000)]
[clang][dataflow] Use `Strict` accessors in TypeErasedDataflowAnalysis.cpp.

This patch is part of the ongoing migration to strict handling of value categories (see https://discourse.llvm.org/t/70086 for details).

Depends On D150655

Reviewed By: sammccall, ymandel, xazax.hun

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

13 months ago[clang][dataflow] Use `Strict` accessors in more places in Transfer.cpp.
Martin Braenne [Mon, 22 May 2023 06:17:17 +0000 (06:17 +0000)]
[clang][dataflow] Use `Strict` accessors in more places in Transfer.cpp.

This patch handles the straightforward cases. Upcoming separate patches will handle the cases that are more subtle.

This patch is part of the ongoing migration to strict handling of value categories (see https://discourse.llvm.org/t/70086 for details).

Depends On D150653

Reviewed By: sammccall, ymandel, xazax.hun

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

13 months ago[LICM] Reassociate & hoist add expressions
Max Kazantsev [Mon, 22 May 2023 06:02:47 +0000 (13:02 +0700)]
[LICM] Reassociate & hoist add expressions

This patch allows LICM to reassociate and hoist following expressions:
```
loop:
  %sum = add nsw %iv, %C1
  %cmp = icmp <signed pred> %sum, C2
```
where `C1` and `C2` are loop invariants. The reassociated version looks like
```
preheader:
  %inv_sum = C2 - C1
...
loop:
  %cmp = icmp <signed pred> %iv, %inv_sum
```
In order to prove legality, we need both initial addition and the newly created subtraction
to happen without overflow.

Differential Revision: https://reviews.llvm.org/D149132
Reviewed By: skatkov

13 months ago[mlir][tosa] Fold consecutive tosa.abs
Kai Sasaki [Mon, 22 May 2023 05:59:58 +0000 (14:59 +0900)]
[mlir][tosa] Fold consecutive tosa.abs

Consecutive tosa.abs can be fold as single abs operation since the second one has no impact.

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

13 months ago[AVR][NFC] Change the owner of the AVR backend
Ben Shi [Mon, 22 May 2023 05:21:15 +0000 (13:21 +0800)]
[AVR][NFC] Change the owner of the AVR backend

The former owner Dylan McKay (https://reviews.llvm.org/p/dylanmckay/)
has agreed to pass the responsibility to
Ben Shi (https://reviews.llvm.org/p/benshi001/). Please refer to
https://discourse.llvm.org/t/apply-for-the-ownership-of-the-avr-backend/70624

Reviewed By: MaskRay, lattner

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

13 months ago[X86] Don't crash on instruction prefetch intrinsics without PREFETCHI support.
Craig Topper [Mon, 22 May 2023 04:31:21 +0000 (21:31 -0700)]
[X86] Don't crash on instruction prefetch intrinsics without PREFETCHI support.

Instead of failing to select during isel, drop the intrinsic in
lowering.

Fixes PR62839.

Reviewed By: pengfei

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

13 months ago[PowerPC] Precommit test for D151055. NFC.
Kai Luo [Mon, 22 May 2023 04:14:22 +0000 (12:14 +0800)]
[PowerPC] Precommit test for D151055. NFC.

13 months agoFix memoery leak in MLIR use-def list ordering test
Mehdi Amini [Mon, 22 May 2023 03:11:30 +0000 (20:11 -0700)]
Fix memoery leak in MLIR use-def list ordering test

13 months ago[NFC][RISCV] Replace global def containing only one field with defvar
wangpc [Mon, 22 May 2023 02:34:08 +0000 (10:34 +0800)]
[NFC][RISCV] Replace global def containing only one field with defvar

This simplifies some code.

Reviewed By: asb

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

13 months ago[flang] Handle @PROCESS directive
Kelvin Li [Wed, 17 May 2023 12:58:35 +0000 (08:58 -0400)]
[flang] Handle @PROCESS directive

Treat lines that start with @process as a comment line. The directive
is accepted and ignored.

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

13 months ago[RISCV] Add missing test for ctz_32 on RV64
Jim Lin [Mon, 22 May 2023 01:26:37 +0000 (09:26 +0800)]
[RISCV] Add missing test for ctz_32 on RV64

Apparently, both of clz and ctz should have tests for _32 version on RV64.

Reviewed By: kito-cheng

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

13 months agoFix MLIR build on powerpc
Mehdi Amini [Mon, 22 May 2023 01:04:39 +0000 (18:04 -0700)]
Fix MLIR build on powerpc

The RNG initalization relied on implicit conversion that wasn't guaranteed in
the MLIR TestUseListOrders.
Also made the RNG state a pass member, the random sequence is not not reset
for each op anymore.

13 months agoPreserve use-list orders in mlir bytecode
Matteo Franciolini [Sun, 21 May 2023 23:46:59 +0000 (16:46 -0700)]
Preserve use-list orders in mlir bytecode

This patch implements a mechanism to read/write use-list orders from/to the mlir bytecode format. When producing bytecode, use-list orders are appended to each value of the IR. When reading bytecode, use-lists orders are loaded in memory and used at the end of parsing to sort the existing use-list chains.

Reviewed By: mehdi_amini

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

13 months ago[ExecutionEngine] Re-enable JIT tests on PowerPC.
Lang Hames [Fri, 19 May 2023 00:23:05 +0000 (17:23 -0700)]
[ExecutionEngine] Re-enable JIT tests on PowerPC.

These were previously re-enabled in d771f54107c, but had to be disabled again
in 2060a72b4d7 due to test failures.

This is a next step to landing https://reviews.llvm.org/D148192, which adds
a skeleton JITLink backend for PowerPC.

The fixes for those failures were (1) to explicitly specify IsLittleEndian =
true for the MachO YAML testcases, (2) disable some example tests for examples
that aren't supported on PowerPC yet, and (3) fixing the endianness of a
relocation read/write (for ELF R_AARCH64_TSTBR14) in RuntimeDyldELF.

13 months ago[Driver] Disable -fsanitize=function for ppc64be after D148573
Fangrui Song [Sun, 21 May 2023 16:14:40 +0000 (09:14 -0700)]
[Driver] Disable -fsanitize=function for ppc64be after D148573

ELFObjectWriter.cpp may report
```
error: Cannot represent a difference across sections
```
on some ppc64be configurations, likely related to some interaction
between the obsoleted ELFv1 and MC.
Unfortunately I cannot reproduce this locally with --target=powerpc64-linux-gnu.

13 months ago[ubsan][test] Unsupport function.cpp in Android non-x86 on sanitizer-x86_64-linux...
Fangrui Song [Sun, 21 May 2023 15:50:34 +0000 (08:50 -0700)]
[ubsan][test] Unsupport function.cpp in Android non-x86 on sanitizer-x86_64-linux-android after D148573

The qemu environment cannot run an executable with a link-time shared
object built during the test?
```
Input was:
<<<<<<
            1: CANNOT LINK EXECUTABLE "/data/local/tmp/Output/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_aarch64/test/ubsan/Standalone-aarch64/TestCases/TypeCheck/Function/Output/function.cpp.tmp": library "/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_aarch64/test/ubsan/Standalone-aarch64/TestCases/TypeCheck/Function/Output/function.cpp.tmp-so.so" not found: needed by main executable
```

13 months agoReland "[Driver] Support multi /guard: options"
Phoebe Wang [Thu, 18 May 2023 04:38:12 +0000 (12:38 +0800)]
Reland "[Driver] Support multi /guard: options"

Fixes unexpected warning.

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

13 months agoRevert "Reland "[Driver] Support multi /guard: options""
Phoebe Wang [Sun, 21 May 2023 14:39:37 +0000 (22:39 +0800)]
Revert "Reland "[Driver] Support multi /guard: options""

This reverts commit a4f366dcd85c440a611bbc82f1d24c2d9a735251.

Found a problem during backport it to 16.x branch.
https://github.com/llvm/llvm-project-release-prs/actions/runs/5036930270/jobs/9033427592?pr=451

The reason is `-implicit-check-not='warning'` may conflict with option
name, e.g., `-treat-scalable-fixed-error-as-warning`

13 months agoReland "[Driver] Support multi /guard: options"
Phoebe Wang [Thu, 18 May 2023 04:38:12 +0000 (12:38 +0800)]
Reland "[Driver] Support multi /guard: options"

Fixes unexpected warning.

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

13 months agoRevert "Reland "[Driver] Support multi /guard: options""
Phoebe Wang [Sun, 21 May 2023 14:39:37 +0000 (22:39 +0800)]
Revert "Reland "[Driver] Support multi /guard: options""

This reverts commit a4f366dcd85c440a611bbc82f1d24c2d9a735251.

Found a problem during backport it to 16.x branch.
https://github.com/llvm/llvm-project-release-prs/actions/runs/5036930270/jobs/9033427592?pr=451

The reason is `-implicit-check-not='warning'` may conflict with option
name, e.g., `-treat-scalable-fixed-error-as-warning`

13 months ago[ubsan][test] Unsupport function.cpp in Android armv7 on sanitizer-x86_64-linux-android
Fangrui Song [Sun, 21 May 2023 14:33:11 +0000 (07:33 -0700)]
[ubsan][test] Unsupport function.cpp in Android armv7 on sanitizer-x86_64-linux-android

The emulated environment has a spurious failure that causes many other
tests to XFAIL. Unsupport it for now.

```
1: CANNOT LINK EXECUTABLE "/data/local/tmp/Output/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/ubsan/Standalone-arm/TestCases/TypeCheck/Function/Output/function.cpp.tmp": library "/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/ubsan/Standalone-arm/TestCases/TypeCheck/Function/Output/function.cpp.tmp-so.so" not found: needed by main executable
```

13 months agoReplace `const std::string&` with StringRef in TargetRegistry APIs; NFC
Ondrej Sykora [Sun, 21 May 2023 13:52:21 +0000 (09:52 -0400)]
Replace `const std::string&` with StringRef in TargetRegistry APIs; NFC

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

14 months ago[NFC] remove duplicated dash in release note for #62447
Congcong Cai [Sun, 21 May 2023 09:26:16 +0000 (11:26 +0200)]
[NFC] remove duplicated dash in release note for #62447

14 months ago[X86][MC] Simplify some code in X86AsmBackend.cpp, NFCI
Shengchen Kan [Sun, 21 May 2023 05:42:31 +0000 (13:42 +0800)]
[X86][MC] Simplify some code in X86AsmBackend.cpp, NFCI

14 months ago[Bazel] Fixup for D149515 (MCTargetDesc/*.def)
NAKAMURA Takumi [Sun, 21 May 2023 04:03:53 +0000 (13:03 +0900)]
[Bazel] Fixup for D149515 (MCTargetDesc/*.def)

14 months ago[RISCV] Disable constant hoiting for multiply by a power of 2.
Craig Topper [Sun, 21 May 2023 02:20:49 +0000 (19:20 -0700)]
[RISCV] Disable constant hoiting for multiply by a power of 2.

14 months ago[RISCV] Update pr58511.ll to not use mul by constant that can be converted to shift.
Craig Topper [Sun, 21 May 2023 02:08:05 +0000 (19:08 -0700)]
[RISCV] Update pr58511.ll to not use mul by constant that can be converted to shift.

Normally a mul by a power 2 will be converted to shift by InstCombine.
Hoping this will make D127115 not affect this test so much.

I've verified the change still fails with the original DAGCombiner
bug.

14 months agoRevert "[msan] Don't intercept LFS prlimit64/getrlimit64 on musl"
Sam James [Sun, 21 May 2023 01:43:59 +0000 (02:43 +0100)]
Revert "[msan] Don't intercept LFS prlimit64/getrlimit64 on musl"

This reverts commit b297fd7974b282b66605547c7adb2eadbf82214f.

Reverting to investigate buildbot failures.

14 months ago[gn build] Port 3f1e9468f68d
LLVM GN Syncbot [Sun, 21 May 2023 01:32:17 +0000 (01:32 +0000)]
[gn build] Port 3f1e9468f68d

14 months ago[X86][MC][bolt] Share code between encoding optimization and assembler relaxation...
Shengchen Kan [Sat, 20 May 2023 11:17:15 +0000 (19:17 +0800)]
[X86][MC][bolt] Share code between encoding optimization and assembler relaxation, NFCI

PUSH[16|32|64]i[8|32] are not arithmetic instructions, so I renamed the
functions.

Reviewed By: Amir

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

14 months ago[msan] Don't intercept LFS prlimit64/getrlimit64 on musl
Sam James [Sun, 21 May 2023 01:06:14 +0000 (02:06 +0100)]
[msan] Don't intercept LFS prlimit64/getrlimit64 on musl

These are aliases on musl and as of 1.2.4, aren't visible by default
(only with -D_LARGEFILE64_SOURCE), and will be removed entirely in a future
release.

This fixes a runtime failure with msan on musl-1.2.4:
```
$ echo 'int main(){}' | clang -x c - -fsanitize=memory -o /dev/null
/usr/bin/x86_64-gentoo-linux-musl-ld.bfd: /usr/lib/llvm/16/bin/../../../../lib/clang/16/lib/linux/libclang_rt.msan-x86_64.a(msan_interceptors.cpp.o): in function `__interceptor_getrlimit64':
[...]
```

Bug: https://bugs.gentoo.org/906603

Reviewed By: MaskRay

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

14 months agoFix MLIR build with shared libraries enabled
Mehdi Amini [Sat, 20 May 2023 22:44:54 +0000 (15:44 -0700)]
Fix MLIR build with shared libraries enabled

Missing dependencies in CMake which does not impact static builds.

14 months ago[CMake][libc] Fix non-runtime build when other runtimes are enabled
Aiden Grossman [Sat, 20 May 2023 02:59:11 +0000 (02:59 +0000)]
[CMake][libc] Fix non-runtime build when other runtimes are enabled

Before this patch, when other runtimes were enabled by setting
LLVM_ENABLE_RUNTIMES and llvm libc was built as a project by setting
LLVM_ENABLE_PROJECTS, the llvm libc CMake system would delay
configuration until the runtime build which never started since libc
wasn't declared as one of the runtime builds. This patch fixes this
behavior by explicitly checking that libc is within LLVM_ENABLE_RUNTIMES
rather than just the variable being set at all.

Reviewed By: Intue

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

14 months agoAdd support for Lazyloading to the MLIR bytecode
Mehdi Amini [Sat, 29 Apr 2023 09:36:45 +0000 (02:36 -0700)]
Add support for Lazyloading to the MLIR bytecode

IsolatedRegions are emitted in sections in order for the reader to be
able to skip over them. A new class is exposed to manage the state and
allow the readers to load these IsolatedRegions on-demand.

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

14 months ago[NFC] improment release note word for #62447
Congcong Cai [Sat, 20 May 2023 21:29:20 +0000 (23:29 +0200)]
[NFC] improment release note word for #62447