platform/upstream/llvm.git
15 months ago[LLD][COFF] Add LLVM toolchain library paths by default.
Tobias Hieta [Fri, 14 Jul 2023 07:46:54 +0000 (09:46 +0200)]
[LLD][COFF] Add LLVM toolchain library paths by default.

We want lld-link to automatically find compiler-rt's and
libc++ when it's in the same directory as the rest of the
toolchain. This is because on Windows linking isn't done
via the clang driver - but instead invoked directly.

This prepends: <llvm>/lib <llvm>/lib/clang/XX/lib and
<llvm>/lib/clang/XX/lib/windows automatically to the library
search paths.

Related to #63827

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

15 months ago[InstCombine] Fold cttz of lowest set bit
Nikita Popov [Fri, 14 Jul 2023 10:20:04 +0000 (12:20 +0200)]
[InstCombine] Fold cttz of lowest set bit

cttz(-a & a) is the same as cttz(a). -a & a is an idiom to extract
the lowest set bit, which naturally does not affect the number of
trailing zeroes.

Proof: https://alive2.llvm.org/ce/z/Yp26x7

15 months ago[InstCombine] Add tests for cttz of lowest set bit (NFC)
Nikita Popov [Fri, 14 Jul 2023 10:13:48 +0000 (12:13 +0200)]
[InstCombine] Add tests for cttz of lowest set bit (NFC)

15 months ago[RISCV][test] Add RV32I and RV64I RUN lines to condops.ll test
Alex Bradbury [Fri, 14 Jul 2023 12:28:58 +0000 (13:28 +0100)]
[RISCV][test] Add RV32I and RV64I RUN lines to condops.ll test

Some of these test cases will be changed by upcoming combines, even in
the non-zicond case.

15 months ago[mlir][linalg] BufferizeToAllocationOp: Add option to specify custom alloc op
Matthias Springer [Fri, 14 Jul 2023 09:58:08 +0000 (11:58 +0200)]
[mlir][linalg] BufferizeToAllocationOp: Add option to specify custom alloc op

Supported ops are "memref.alloc" and "memref.alloca".

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

15 months ago[mlir][bufferization] OneShotBufferizeOp: Add options to use linalg.copy
Matthias Springer [Fri, 14 Jul 2023 09:57:54 +0000 (11:57 +0200)]
[mlir][bufferization] OneShotBufferizeOp: Add options to use linalg.copy

This new option allows users to specify a custom memcpy op.

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

15 months ago[EarlyCSE] Do not CSE convergent calls with memory effects
Jay Foad [Fri, 16 Jun 2023 16:09:49 +0000 (17:09 +0100)]
[EarlyCSE] Do not CSE convergent calls with memory effects

D149348 did this for readnone calls, which are handled by SimpleValue.
This patch does the same for all other CSEable calls, which are handled
by CallValue.

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

15 months ago[EarlyCSE] Precommit test for D153151
Jay Foad [Fri, 16 Jun 2023 16:08:40 +0000 (17:08 +0100)]
[EarlyCSE] Precommit test for D153151

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

15 months ago[RISCV] Introduce RISCVISD::CZERO_{EQZ,NEZ} nodes produce them when zicond is present...
Alex Bradbury [Fri, 14 Jul 2023 10:29:01 +0000 (11:29 +0100)]
[RISCV] Introduce RISCVISD::CZERO_{EQZ,NEZ} nodes produce them when zicond is present in lowerSELECT

This patch is a step towards altering how we handle the emission of
condops. Marking ISD::SELECT as legal is a major change in the codegen
path, and gives few options for maintaining the old codegen path when
it is believed to be better (e.g. a better branchless sequence is
possible using non-zicond instructions, or the branch-based sequence is
preferable).

This removes the existing SelectionDAG patterns and moves the logic into
lowerSELECT. Along some small codegen changes you'll note a few minor
regressions in the generated code quality - this are due to the fact
that by lowering the SELECT node early we miss out on combines that
would kick in later when setcc condcodes that aren't natively supported
have been expanded (thus exposing opportunities for optimisation by
performing logical negation and swapping truev/falsev). I've opted to
split out work that addresses these into follow-on patches (especially
as zicond is still 'experimental').

matchSetCC is a straight-forward translation from the version in
RISCVISelDAGToDAG. Ideally, in the future it can be converted to a
helper shared between both files.

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

15 months ago[lld][COFF] Find libraries with relative paths.
Tobias Hieta [Fri, 14 Jul 2023 07:40:35 +0000 (09:40 +0200)]
[lld][COFF] Find libraries with relative paths.

This patch is spun out of https://reviews.llvm.org/D151188
and makes it possible for lld-link to find libraries with
relative paths. This will be used later to implement the
changes to autolinking runtimes explained in #63827

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

15 months ago[InstCombine] Handle const select arm in foldSelectCtlzToCttz()
Nikita Popov [Fri, 14 Jul 2023 09:59:22 +0000 (11:59 +0200)]
[InstCombine] Handle const select arm in foldSelectCtlzToCttz()

The select arm that takes the ctlz result can also instead be a
constant with the bit width (as this is what the ctlz evaluates to
for a==0).

This avoids a regression when strengthening the
simplifyWithOpReplaced() fold.

Proof: https://alive2.llvm.org/ce/z/DMRL5A

15 months ago[InstCombine] Add test for ctlz->cttz fold with constant in select (NFC)
Nikita Popov [Fri, 14 Jul 2023 09:47:45 +0000 (11:47 +0200)]
[InstCombine] Add test for ctlz->cttz fold with constant in select (NFC)

15 months ago[llvm] Remove uses of getNonOpaquePointerElementType() (NFC)
Nikita Popov [Fri, 14 Jul 2023 08:51:59 +0000 (10:51 +0200)]
[llvm] Remove uses of getNonOpaquePointerElementType() (NFC)

15 months ago[X86] Fold PACKSS(NOT(X),NOT(Y)) -> NOT(PACKSS(X,Y))
Simon Pilgrim [Fri, 14 Jul 2023 09:34:58 +0000 (10:34 +0100)]
[X86] Fold PACKSS(NOT(X),NOT(Y)) -> NOT(PACKSS(X,Y))

15 months ago[HexagonVectorCombine] Remove use of getNonOpaquePointerElementType() (NFC)
Nikita Popov [Fri, 14 Jul 2023 09:31:09 +0000 (11:31 +0200)]
[HexagonVectorCombine] Remove use of getNonOpaquePointerElementType() (NFC)

15 months ago[AArch64] Handle 64bit vector s/umull from extracts
David Green [Fri, 14 Jul 2023 09:25:12 +0000 (10:25 +0100)]
[AArch64] Handle 64bit vector s/umull from extracts

This is similar to D153632, but for mul nodes instead of add/sub. They get
recognised in LowerMUL in order to detect the mul(ext, ext), in a way that will
work for i64 nodes as well as i16/i32. This extends it to look for
mul(subvector_extract(ext(x), 0), subvector_extract(ext(y), 0)), generating a
subvector_extract(mull(x,y)) if it matches.

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

15 months ago[mlir][memref] NFC - Move utility function declaration from IR/MemRef.h to Utils...
Nicolas Vasilache [Fri, 14 Jul 2023 09:22:45 +0000 (11:22 +0200)]
[mlir][memref] NFC - Move utility function declaration from IR/MemRef.h to Utils/MemRefUtils.h

15 months agoRevert "[RandomIRBuilder] Remove use of getNonOpaquePointerElementType() (NFC)"
Nicolas Vasilache [Fri, 14 Jul 2023 09:20:00 +0000 (11:20 +0200)]
Revert "[RandomIRBuilder] Remove use of getNonOpaquePointerElementType() (NFC)"

This reverts commit afdb83b19c674dd2a622697863a201cd44e2458a.

This was landed with a bad description.

15 months ago[Flang][OpenMP] Use typed assignment in Atomic Write lowering
Kiran Chandramohan [Fri, 14 Jul 2023 09:05:03 +0000 (09:05 +0000)]
[Flang][OpenMP] Use typed assignment in Atomic Write lowering

Use typed assignment in Atomic Write lowering to better handle
type conversions of allowed types.

Note: We should make similar changes for other constructs in
later patches.

Reviewed By: NimishMishra

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

15 months ago[mlir][LLVM] Convert alias metadata to using attributes instead of ops
Markus Böck [Wed, 12 Jul 2023 13:13:18 +0000 (15:13 +0200)]
[mlir][LLVM] Convert alias metadata to using attributes instead of ops

Using MLIR attributes instead of metadata has many advantages:
* No indirection: Attributes can simply refer to each other seemlessly without having to use the indirection of `SymbolRefAttr`. This also gives us correctness by construction in a lot of places as well
* Multithreading save: The Attribute infrastructure gives us thread-safety for free. Creating operations and inserting them into a block is not thread-safe. This is a major use case for e.g. the inliner in MLIR which runs in parallel
* Easier to create: There is no need for a builder or a metadata region

This patch therefore does exactly that. It leverages the new distinct attributes to create distinct alias domains and scopes in a deterministic and threadsafe manner.

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

15 months ago[RandomIRBuilder] Remove use of getNonOpaquePointerElementType() (NFC)
Nikita Popov [Fri, 14 Jul 2023 08:54:38 +0000 (10:54 +0200)]
[RandomIRBuilder] Remove use of getNonOpaquePointerElementType() (NFC)

15 months ago[RandomIRBuilder] Remove use of getNonOpaquePointerElementType() (NFC)
Nikita Popov [Fri, 14 Jul 2023 08:54:38 +0000 (10:54 +0200)]
[RandomIRBuilder] Remove use of getNonOpaquePointerElementType() (NFC)

15 months ago[LLParser] Remove checks related to typed pointers (NFC)
Nikita Popov [Fri, 14 Jul 2023 08:41:34 +0000 (10:41 +0200)]
[LLParser] Remove checks related to typed pointers (NFC)

15 months ago[Verifier] Remove typed pointer verification (NFC)
Nikita Popov [Fri, 14 Jul 2023 08:37:48 +0000 (10:37 +0200)]
[Verifier] Remove typed pointer verification (NFC)

15 months ago[llvm] Remove uses of hasSameElemenTypeAs() (NFC)
Nikita Popov [Fri, 14 Jul 2023 08:32:43 +0000 (10:32 +0200)]
[llvm] Remove uses of hasSameElemenTypeAs() (NFC)

Always returns true with opaque pointers.

15 months ago[llvm][clang] Remove uses of isOpaquePointerTy() (NFC)
Nikita Popov [Fri, 14 Jul 2023 07:44:31 +0000 (09:44 +0200)]
[llvm][clang] Remove uses of isOpaquePointerTy() (NFC)

This now always returns true (for pointer types).

15 months ago[RISCV] Fix required features checking with empty string
Jim Lin [Fri, 14 Jul 2023 06:47:58 +0000 (14:47 +0800)]
[RISCV] Fix required features checking with empty string

In our downstream, we define some intrinsics that don't require any
extra extension enabled. Such as

TARGET_BUILTIN(__builtin_riscv_xxx, "LiLi", "nc", "")

But `split` function's `KeepEmpty` argument is True. Got the error message

error: builtin requires at least one of the following extensions support to be enabled : ''

when we use our customized intrinsic.

Reviewed By: craig.topper, wangpc

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

15 months ago[include-cleaner] Bail out in the standalone tool for invalid ignore-headers
Haojian Wu [Fri, 14 Jul 2023 07:59:54 +0000 (09:59 +0200)]
[include-cleaner] Bail out in the standalone tool for invalid ignore-headers
flag

15 months ago[mlir][vector] VectorToSCF: Omit redundant out-of-bounds check
Matthias Springer [Fri, 14 Jul 2023 07:49:20 +0000 (09:49 +0200)]
[mlir][vector] VectorToSCF: Omit redundant out-of-bounds check

There was a bug in `TransferWriteNonPermutationLowering`, a pattern that extends the permutation map of a TransferWriteOp with leading transfer dimensions of size ones. These newly added transfer dimensions are always in-bounds, because the starting point of any dimension is in-bounds. VectorToSCF inserts out-of-bounds checks based on the "in_bounds" attribute and dims that are marked as out-of-bounds but that are actually always in-bounds lead to unnecessary "scf.if" ops.

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

15 months ago[RISCV] Narrow types of index operand matched pattern (shl (zext), C).
Yeting Kuo [Fri, 7 Jul 2023 05:47:48 +0000 (13:47 +0800)]
[RISCV] Narrow types of index operand matched pattern (shl (zext), C).

(shl (zext to iXLenVec), C) is a possible pattern in auto-vectorized code for
indexed loads/stores. But extending to iXLen might be too aggressive, RVV
indexed load/store instructions zero extend their indexed operand to XLEN.
The patch tries to narrow the type of the zero extension. It's benefit to
decrease register pressure.

Reviewed By: craig.topper

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

15 months ago[X86]Recommit D154193 - Remove TEST in AND32ri+TEST16rr in peephole-opt
XinWang10 [Mon, 10 Jul 2023 03:21:02 +0000 (23:21 -0400)]
[X86]Recommit D154193 - Remove TEST in AND32ri+TEST16rr in peephole-opt

Previously we remove a pattern like:
  %reg = and32ri %in_reg, 5
  ...                         // EFLAGS not changed.
  %src_reg = subreg_to_reg 0, %reg, %subreg.sub_index
  test64rr %src_reg, %src_reg, implicit-def $eflags
We can remove test64rr since it has same functionality as and subreg_to_reg avoid the opt in previous code, so we handle this case specially.
And this case is also can be opted for the same reason, like:
  %reg = and32ri %in_reg, 5
  ...                         // EFLAGS not changed.
  %src_reg = copy %reg.sub_16bit:gr32
  test16rr %src_reg, %src_reg, implicit-def $eflags
The COPY from gr32 to gr16 prevent the opt in previous code too, just handle it specially as what we did for test64rr.

Reviewed By: skan

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

15 months ago[llvm] Remove calls to supportsTypedPointers() (NFC)
Nikita Popov [Fri, 14 Jul 2023 07:34:46 +0000 (09:34 +0200)]
[llvm] Remove calls to supportsTypedPointers() (NFC)

Always returns false now.

15 months ago[llvm] Remove calls to setOpaquePointers() (NFC)
Nikita Popov [Fri, 14 Jul 2023 07:31:55 +0000 (09:31 +0200)]
[llvm] Remove calls to setOpaquePointers() (NFC)

True is the default (and only possible) value.

15 months ago[IR] Remove LLVMPointerToElt and LLVMAnyPointerToElt intrinsic types (NFC)
Nikita Popov [Thu, 13 Jul 2023 09:26:42 +0000 (11:26 +0200)]
[IR] Remove LLVMPointerToElt and LLVMAnyPointerToElt intrinsic types (NFC)

With opaque pointers, LLVMPointerToElt can be replaced by llvm_ptr_ty
and LLVMAnyPointerToElt by llvm_anyptr_ty.

This still leaves LLVMVectorOfAnyPointersToElt, where we can't just
replace with an existing IIT descriptor.

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

15 months ago[clangd] Fix an assertion failure in NamedDecl::getName during the prepareRename
Haojian Wu [Fri, 14 Jul 2023 07:08:53 +0000 (09:08 +0200)]
[clangd] Fix an assertion failure in NamedDecl::getName during the prepareRename

getName method required to be called on a simple-identifier NamedDecl,
otherwise it will trigger an assertion.

Reviewed By: kadircet

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

15 months ago[MLIR] Remove explicit -opaque-pointers flag from test (NFC)
Nikita Popov [Fri, 14 Jul 2023 07:15:11 +0000 (09:15 +0200)]
[MLIR] Remove explicit -opaque-pointers flag from test (NFC)

15 months ago[IR] Remove -opaque-pointers option
Nikita Popov [Wed, 12 Jul 2023 12:43:16 +0000 (14:43 +0200)]
[IR] Remove -opaque-pointers option

The test migration to opaque pointers has finished, so we can finally
drop typed pointer support from LLVM \o/

This removes the ability to disable typed pointers, as well as the
-opaque-pointers option, but otherwise doesn't yet touch any API
surface. I'll leave deprecation/removal of compatibility APIs to
future changes.

This also drops a few tests: These are either testing errors that
only occur with typed pointers, or type linking behavior that, to
the best of my knowledge, only applies to typed pointers.

Note that this will break some tests in the experimental SPIRV
backend, because the maintainers have failed to update their tests
in a reasonable time-frame, despite multiple warnings. In accordance
with our experimental target policy, this is not a blocking concern.
This issue is tracked at https://github.com/llvm/llvm-project/issues/60133.

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

15 months ago[AMDGPU] Relax restrictions on unbreakable PHI users in BreakLargePHis
pvanhout [Thu, 13 Jul 2023 11:49:43 +0000 (13:49 +0200)]
[AMDGPU] Relax restrictions on unbreakable PHI users in BreakLargePHis

The previous heuristic rejected a PHI if one of its user was an unbreakable PHI, no matter what the other users were.

This worked well in most cases, but there's one case in rocRAND where
it doesn't work. In that case, a PHI node has 2 PHI users where one is
breakable but not the other. When that PHI node isn't broken performance falls by 35%.

Relaxing the restriction to "require that  half of the PHI node users are breakable" fixes the issue, and seems like a sensible change.

Solves SWDEV-409648, SWDEV-398393

Reviewed By: #amdgpu, arsenm

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

15 months ago[libcxx] [test] Skip timezone formatting tests on Windows
Martin Storsjö [Thu, 13 Jul 2023 10:52:06 +0000 (13:52 +0300)]
[libcxx] [test] Skip timezone formatting tests on Windows

While these tests do pass in the CI environment, they fail elsewhere.
On GitHub Action runners, they produce '+0000' instead of '-0000' for
the UTC offset, and on local machines, it outputs the UTC offset of
the local timezone.

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

15 months ago[libc++] Implement istringstream members of P0408R7 (Efficient Access to basic_string...
Piotr Fusik [Mon, 10 Jul 2023 18:09:14 +0000 (20:09 +0200)]
[libc++] Implement istringstream members of P0408R7 (Efficient Access to basic_stringbuf's Buffer)

Reviewed By: #libc, Mordante

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

15 months ago[mlir] Improve syntax of `distinct[n]<unit>`
Markus Böck [Thu, 13 Jul 2023 08:39:08 +0000 (10:39 +0200)]
[mlir] Improve syntax of `distinct[n]<unit>`

In cases where memory is of less of a concern (e.g. small attributes where all instances have to be distinct by definition), using `DistinctAttr` with a unit attribute is a useful and conscious way of generating deterministic unique IDs.
The syntax as is however, makes them less useful to use, as it 1) always prints `<unit>` at the back and 2) always aliases them leading to not very useful `#distinct = distinct[n]<unit>` lines in the printer output.

This patch fixes that by special casing `UnitAttr` to simply elide the `unit` attribute in the back and not printing it as alias in that case.

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

15 months ago[mlir] Don't emit forward declaration for user defined storage classes
Hideto Ueno [Fri, 14 Jul 2023 04:14:48 +0000 (21:14 -0700)]
[mlir] Don't emit forward declaration for user defined storage classes

Currently DefGen::emitDecl always emits forward declarations of storage classes even for user define ones, which makes it difficult to use template class directly in ODS. This patch changes `DefGen` not to emit forward decl when `genStorageClass` is false.

Original discussion: https://discourse.llvm.org/t/use-template-classes-as-user-defined-storage-classes/72015

Reviewed By: mehdi_amini, rriddle

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

15 months agoFix comparison of constrained deduced return types in explicit
Richard Smith [Fri, 14 Jul 2023 02:46:15 +0000 (19:46 -0700)]
Fix comparison of constrained deduced return types in explicit
instantiations.

Fixes #62272.

15 months agoRemove unnecessary std::moves [NFC]
Sterling Augustine [Fri, 14 Jul 2023 02:22:45 +0000 (19:22 -0700)]
Remove unnecessary std::moves [NFC]

These trigger the following error:

error: moving a temporary object prevents copy elision [-Werror,-Wpessimizing-move]

15 months ago[XRay] Add initial support for loongarch64
Weining Lu [Fri, 14 Jul 2023 01:23:53 +0000 (09:23 +0800)]
[XRay] Add initial support for loongarch64

Only support patching FunctionEntry/FunctionExit/FunctionTailExit for now.

Reviewed By: MaskRay, xen0n
Co-Authored-By: zhanglimin <zhanglimin@loongson.cn>
Differential Revision: https://reviews.llvm.org/D140727

15 months ago[mlir][sparse][gpu] remove zero init memset
Aart Bik [Fri, 14 Jul 2023 00:05:01 +0000 (17:05 -0700)]
[mlir][sparse][gpu] remove zero init memset

avoids quite a big memory fill for each setup

Reviewed By: K-Wu

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

15 months ago[MC/AsmLexer] Add '?' (Question) token
Sergei Barannikov [Fri, 30 Jun 2023 10:51:11 +0000 (13:51 +0300)]
[MC/AsmLexer] Add '?' (Question) token

'?' is a valid token in our downstream target. There seem to be no way
to do target-specific lexing, so just add make AsmParser recognize it.

Reviewed By: MaskRay

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

15 months ago[XCOFF][AIX] Peephole optimization for toc-data.
Sean Fertile [Thu, 13 Jul 2023 19:12:15 +0000 (15:12 -0400)]
[XCOFF][AIX] Peephole optimization for toc-data.

Followup to D101178 - peephole optimization that converts a
load address instruction and a consuming load/store into just the
load/store when its safe to do so.

eg: converts the 2 instruction code sequence
  la 4, i[TD](2)
  stw 3, 0(4)
to
  stw 3, i[TD](2)

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

15 months ago[InstCombine] Transform `icmp eq/ne ({su}div exact X,Y),C` -> `icmp eq/ne X, Y*C`
Noah Goldstein [Fri, 14 Jul 2023 00:13:51 +0000 (19:13 -0500)]
[InstCombine] Transform `icmp eq/ne ({su}div exact X,Y),C` -> `icmp eq/ne X, Y*C`

We can do this if `Y*C` doesn't overflow. This is trivial if `C` is
0/1. Otherwise we actually generate a `mul` instruction iff the `div`
has one use.

Alive2 Links:
    udiv: https://alive2.llvm.org/ce/z/GWPW67
    sdiv: https://alive2.llvm.org/ce/z/bUoX9h

Reviewed By: nikic

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

15 months ago[InstCombine] Add tests for `icmp eq/ne ({su}div exact X, Y), C`; NFC
Noah Goldstein [Sun, 7 May 2023 21:44:15 +0000 (16:44 -0500)]
[InstCombine] Add tests for `icmp eq/ne ({su}div exact X, Y), C`; NFC

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

15 months ago[DebugInfo] Add missing dependency on intrinsics_gen
Jon Roelofs [Fri, 14 Jul 2023 00:11:08 +0000 (17:11 -0700)]
[DebugInfo] Add missing dependency on intrinsics_gen

15 months ago[clang] Support '-fgpu-default-stream=per-thread' for NVIDIA CUDA
boxu.zhang [Wed, 12 Jul 2023 17:44:45 +0000 (10:44 -0700)]
[clang] Support '-fgpu-default-stream=per-thread' for NVIDIA CUDA

I'm using clang to compile CUDA code. And just found that clang doesn't support the per-thread stream option for NV CUDA. I don't know if there is another solution.

Reviewed By: tra

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

15 months ago[compiler-rt][AArch64] Correct how FMV use ifunc resolver abi.
Pavel Iliin [Tue, 11 Jul 2023 11:46:28 +0000 (12:46 +0100)]
[compiler-rt][AArch64] Correct how FMV use ifunc resolver abi.

The patch fixes second argument of Function Multi Versioning resolvers,
it is pointer to an extendible struct containing hwcap and hwcap2 not a
unsigned long hwcap2. Also fixes FMV features caching in resolver.

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

15 months ago[amdgpu] Delete elide-module-lds attribute
Jon Chesterfield [Thu, 13 Jul 2023 23:36:33 +0000 (00:36 +0100)]
[amdgpu] Delete elide-module-lds attribute

Requires D155190

Reviewed By: arsenm

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

15 months ago[ARM] Replace OperandMatchResultTy with ParseStatus (NFC)
Sergei Barannikov [Sat, 1 Jul 2023 23:46:05 +0000 (02:46 +0300)]
[ARM] Replace OperandMatchResultTy with ParseStatus (NFC)

ParseStatus is slightly more convenient to use due to implicit
conversion from bool, which allows to do something like:
```
  return Error(L, "msg");
```
when with MatchOperandResultTy it had to be:
```
  Error(L, "msg");
  return MatchOperand_ParseFail;
```
It also has more appropriate name since parse* methods are not only for
parsing operands.

Reviewed By: olista01

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

15 months ago[AArch64] Replace OperandMatchResultTy with ParseStatus (NFC)
Sergei Barannikov [Sun, 2 Jul 2023 00:20:11 +0000 (03:20 +0300)]
[AArch64] Replace OperandMatchResultTy with ParseStatus (NFC)

ParseStatus is slightly more convenient to use due to implicit
conversion from bool, which allows to do something like:
```
  return Error(L, "msg");
```
when with MatchOperandResultTy it had to be:
```
  Error(L, "msg");
  return MatchOperand_ParseFail;
```
It also has more appropriate name since parse* methods are not only for
parsing operands.

Reviewed By: david-arm

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

15 months ago[mlir][sparse][gpu] minor improvements in 2:4 example
Aart Bik [Thu, 13 Jul 2023 23:01:22 +0000 (16:01 -0700)]
[mlir][sparse][gpu] minor improvements in 2:4 example

Reviewed By: K-Wu

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

15 months ago[amdgpu][lds] Remove recalculation of LDS frame from backend
Jon Chesterfield [Thu, 13 Jul 2023 22:54:37 +0000 (23:54 +0100)]
[amdgpu][lds] Remove recalculation of LDS frame from backend

Do the LDS frame calculation once, in the IR pass, instead of repeating the work in the backend.

Prior to this patch:
The IR lowering pass sets up a per-kernel LDS frame and annotates the variables with absolute_symbol
metadata so that the assembler can build lookup tables out of it. There is a fragile association between
kernel functions and named structs which is used to recompute the frame layout in the backend, with
fatal_errors catching inconsistencies in the second calculation.

After this patch:
The IR lowering pass additionally sets a frame size attribute on kernels. The backend uses the same
absolute_symbol metadata that the assembler uses to place objects within that frame size.

Deleted the now dead allocation code from the backend. Left for a later cleanup:
- enabling lowering for anonymous functions
- removing the elide-module-lds attribute (test churn, it's not used by llc any more)
- adjusting the dynamic alignment check to not use symbol names

Reviewed By: arsenm

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

15 months ago[libc++][NFC] Suppress -Wdeprecated-literal-operator
Po-yao Chang [Thu, 13 Jul 2023 13:30:19 +0000 (21:30 +0800)]
[libc++][NFC] Suppress -Wdeprecated-literal-operator

Remove spaces between operator"" and identifier to suppress
-Wdeprecated-literal-operator, and between operator and ""
like how they are written in [string.view.literals] and [basic.string.literals].

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

15 months ago[llvm][utils] Disable lldb formatters for PointerIntPair and PointerUnion
Dave Lee [Thu, 13 Jul 2023 17:00:50 +0000 (10:00 -0700)]
[llvm][utils] Disable lldb formatters for PointerIntPair and PointerUnion

These synthetic providers use expression evaluation and fail in some cases.

Examples:

```
llvm::PointerIntPair<llvm::PointerUnion<const Type *, const ExtQuals *>,
                     Qualifiers::FastWidth> Value;
```

and

```
typedef llvm::PointerUnion<const ValueDecl *, const Expr *, TypeInfoLValue,
                           DynamicAllocLValue>
        PtrTy;
```

Original contribution: D117779

rdar://110791233
rdar://112195543

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

15 months ago[lldb] Move decorators to test method
Jonas Devlieghere [Thu, 13 Jul 2023 22:42:59 +0000 (15:42 -0700)]
[lldb] Move decorators to test method

Make sure TestCTF only run on Darwin when ctfconvert and llvm-objdump
are available.

15 months ago[SLP]Add a test with the stores with long distances between them, NFC.
Alexey Bataev [Thu, 13 Jul 2023 21:47:58 +0000 (14:47 -0700)]
[SLP]Add a test with the stores with long distances between them, NFC.

15 months ago[lldb] Support compressed CTF
Jonas Devlieghere [Thu, 13 Jul 2023 21:36:56 +0000 (14:36 -0700)]
[lldb] Support compressed CTF

Add support for compressed CTF data. The flags in the header can
indicate whether the CTF body is compressed with zlib deflate. This
patch supports inflating the data before parsing.

Differential revision: https://reviews.llvm.org/D155221

15 months ago[clang][modules] Deserialize included files lazily
Jan Svoboda [Thu, 13 Jul 2023 18:28:03 +0000 (11:28 -0700)]
[clang][modules] Deserialize included files lazily

In D114095, `HeaderFileInfo::NumIncludes` was moved into `Preprocessor`. This still makes sense, because we want to track this on the granularity of submodules (D112915, D114173), but the way this information is serialized is not ideal. In `ASTWriter`, the set of included files gets deserialized eagerly, issuing lots of calls to `FileManager::getFile()` for input files the PCM consumer might not be interested in.

This patch makes the information part of the header file info table, taking advantage of its lazy deserialization which typically happens when a file is about to be included.

Reviewed By: benlangmuir

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

15 months ago[llvm-debuginfod] Include llvm/Support/StringExtras.h after D155178
Fangrui Song [Thu, 13 Jul 2023 21:46:59 +0000 (14:46 -0700)]
[llvm-debuginfod] Include llvm/Support/StringExtras.h after D155178

To fix undefined errors like to_float. This tool is often not built as
LLVM_ENABLE_HTTPLIB defaults to off (and the external dependency
cpp-httplib is difficult to set up due to a dependency on brotli) and
LLVM_TOOL_LLVM_DEBUGINFOD_BUILD disabling logic in D147185.

15 months ago[mlir][MemRef] Move narrow type emulation common methods to MemRefUtils.
Hanhan Wang [Tue, 11 Jul 2023 21:13:07 +0000 (14:13 -0700)]
[mlir][MemRef] Move narrow type emulation common methods to MemRefUtils.

It also unifies the computation of StridedLayoutAttr. If the stride is
static known value, we can just use it.

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

15 months agoInclude some llvm/Support/StringExtras.h after D155178
Fangrui Song [Thu, 13 Jul 2023 21:21:14 +0000 (14:21 -0700)]
Include some llvm/Support/StringExtras.h after D155178

15 months ago[mlir] Don't make the ROCm conversions depend on the execution engine
Krzysztof Drewniak [Thu, 13 Jul 2023 18:56:35 +0000 (18:56 +0000)]
[mlir] Don't make the ROCm conversions depend on the execution engine

During a conversion to MLIR_ENABLE_EXECUTION_ENGINE from checking for
the native target, the ROCm conversion passes (--serialize-to-hsaco)
were mistakenly flagged for being disabled if the execution ending is
not being built.

These passes use LLVM to build binaries for AMD GPUs, and so require
that backend to be enabled. However, they do not produce native code,
nor do they interact with the JIT or any of the execution engine
support libraries.

When building MLIR into a compiler library that's intended to produce
GPU binaries, we want to build only the AMDGPU backend and have the
binary serialization passes available. This change makes that
possible.

It looks like the CUDA path might currently require a native target,
it's hard to tell, so this commit leaves that if statement untouched.

Reviewed By: fmorac

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

15 months ago[AMDGPU] Support -mcpu=native for OpenCL
Yaxun (Sam) Liu [Wed, 5 Jul 2023 15:56:55 +0000 (11:56 -0400)]
[AMDGPU] Support -mcpu=native for OpenCL

When -mcpu=native is specified, try detecting GPU
on the system by using amdgpu-arch tool. If it
fails to detect GPU, emit an error about GPU
not detected. If multiple GPUs are detected,
use the first GPU and emit a warning.

Reviewed by: Matt Arsenault, Fangrui Song

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

15 months ago[Support] Move StringExtras.h include from Error.h to Error.cpp
Elliot Goodrich [Sat, 8 Jul 2023 09:16:12 +0000 (10:16 +0100)]
[Support] Move StringExtras.h include from Error.h to Error.cpp

Move the implementation of the `toString` function from
`llvm/Support/Error.h` to the source file, which allows us to move
`#include "llvm/ADT/StringExtras.h"` to the source file as well.

As `Error.h` is present in a large number of translation units this
means we are unnecessarily bringing in the contents of
`StringExtras.h` - itself a large file with lots of includes - and
slowing down compilation.

Also move the `#include "llvm/ADT/SmallVector.h"` directive to the
source file as it's no longer needed, but this does not give as much of
a benefit.

This reduces the total number of preprocessing tokens across the LLVM
source files in lib from (roughly) 1,920,413,050 to 1,903,629,230 - a
reduction of ~0.87%. This should result in a small improvement in
compilation time.

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

15 months ago[lldb] Add missing StringExtras.h includes
Elliot Goodrich [Thu, 13 Jul 2023 11:24:07 +0000 (12:24 +0100)]
[lldb] Add missing StringExtras.h includes

In preparation for removing the #include "llvm/ADT/StringExtras.h"
from the header to source file of llvm/Support/Error.h, first add in
all the missing includes that were previously included transitively
through this header.

This is fixing all files missed in b0abd4893fa139d8e6e22cd1,
a11efd49266f5551657b310b, and 90bfe2df25e7.

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

15 months ago[AMDGPU] Move SIEncodingFamily into SIDefines.h. NFC.
Stanislav Mekhanoshin [Thu, 13 Jul 2023 19:24:25 +0000 (12:24 -0700)]
[AMDGPU] Move SIEncodingFamily into SIDefines.h. NFC.

I need this for future patch in the MC, while TII is not available
in the llvm-mc. Besides this is not a first time I want it there.

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

15 months ago[RISCV] Add Zce extension.
Craig Topper [Thu, 13 Jul 2023 19:22:06 +0000 (12:22 -0700)]
[RISCV] Add Zce extension.

According to the spec, Zce is an alias for Zca, Zcb, Zcmp, and Zcmt.
If F is enabled on RV32 it also includes Zcf.

This patch adds the Zce and the implication rule which unfortunately
requires custom handling for adding Zcf.

I've also made all the Zc* extensions imply Zca.

I've also added an error for Zcf without RV32.

Reviewed By: asb

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

15 months ago[PowerPC] Improve code gen for vector add
Nemanja Ivanovic [Tue, 4 Jul 2023 14:48:12 +0000 (10:48 -0400)]
[PowerPC] Improve code gen for vector add

Improve codegen for vectors modulo additions.

Reviewed By: nemanjai

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

15 months ago[mlir][gpu] Add dump-ptx option
Guray Ozen [Thu, 13 Jul 2023 12:41:31 +0000 (14:41 +0200)]
[mlir][gpu] Add dump-ptx option

When targeting NVIDIA GPUs, seeing the generated PTX is important. Currently, we don't have simple way to do it.

This work adds dump-ptx to gpu-to-cubin pass. One can use it like `gpu-to-cubin{chip=sm_90 features=+ptx80 dump-ptx}`.

Reviewed By: nicolasvasilache

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

15 months ago[AMDGPU][IGLP] Add iglp_opt(1) strategy for single wave gemms
Jeffrey Byrnes [Fri, 28 Apr 2023 23:47:31 +0000 (16:47 -0700)]
[AMDGPU][IGLP] Add iglp_opt(1) strategy for single wave gemms

This adds the IGLP strategy for single-wave gemms. The SchedGroup pipeline is laid out in multiple phases, with each phase corresponding to a distinct pattern present in gemm kernels. The resilience of the optimization is dependent upon IR (as seen by pre-RA scheduling) continuing to have these patterns (as defined by instruction class and dependencies) in their current relative ordering.

The kernels of interest have these specific phases:
NT: 1, 2a, 2c
NN: 1, 2a, 2b
TT: 1, 2b, 2c
TN: 1, 2b

The general approach taken was to have a long SchedGroup pipeline. In this way the scheduler will have less capability of doing the wrong thing. In order to resolve the challenge of correctly fitting these long pipelines, we leverage the rules infrastructure to help the solver.

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

Change-Id: I1a35962a95b4bdf740602b8f110d3297c6fb9d96

15 months ago[flang][runtime] Support in-tree device build of Flang runtime.
Slava Zakharin [Thu, 13 Jul 2023 18:18:58 +0000 (11:18 -0700)]
[flang][runtime] Support in-tree device build of Flang runtime.

I changed the set of files that are built for experimental CUDA/OMP
builds, i.e. the files with enabled device support are built
as such and the rest of the files are built just for the host target.
With this change we can build Flang runtime library that is fully functional
on the host target, so in-tree targets like check-flang become operational.

Reviewed By: klausler, PeteSteinfeld

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

15 months ago[AMDGPU][AsmParser][NFC] Translate parsed MIMG instructions to MCInsts automatically.
Ivan Kosarev [Thu, 13 Jul 2023 18:47:07 +0000 (19:47 +0100)]
[AMDGPU][AsmParser][NFC] Translate parsed MIMG instructions to MCInsts automatically.

Part of <https://github.com/llvm/llvm-project/issues/62629>.

Reviewed By: foad

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

15 months ago[AMDGPU][MC] Fix handling of A16 operands in intersect_ray instructions.
Ivan Kosarev [Thu, 13 Jul 2023 18:38:48 +0000 (19:38 +0100)]
[AMDGPU][MC] Fix handling of A16 operands in intersect_ray instructions.

The patch adds the support for 'noa16' operands in non-A16 variants of
the instructions, fixes validation of A16 operands and eliminates the
custom conversion to MCInst.

Part of <https://github.com/llvm/llvm-project/issues/62629>.

Reviewed By: arsenm

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

15 months ago[RISCV] Add initial SDNode patterns for unary zvbb instructions
Luke Lau [Thu, 13 Jul 2023 16:21:04 +0000 (17:21 +0100)]
[RISCV] Add initial SDNode patterns for unary zvbb instructions

This patch adds pseudos and SDNode patterns for vbrev.v, vrev8.v, vclz.v,
vctz.v and vcpop.v.
I've only added them for integer element types so far since we're lacking tests
for floats.

Reviewed By: craig.topper

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

15 months ago[RISCV] Correct resource cycles for vzext/vsext in SiFive7 scheduler.
Craig Topper [Thu, 13 Jul 2023 18:13:14 +0000 (11:13 -0700)]
[RISCV] Correct resource cycles for vzext/vsext in SiFive7 scheduler.

The instructions produce DLEN bits per cycle. The vsetvli LMUL for these
instructions is the output EMUL. The input EMUL is scaled down by
the vector factor suffix on the instruction name.

So for LMUL=1 there are 2*DLEN bits of result produced over 2 cycles.
This makes SiFive7GetCyclesDefault the correct resource cycles.

Reviewed By: monkchiang

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

15 months ago[AMDGPU][MC] Pre-commit tests for the noa16 intersect_ray instructions fix, D155057.
Ivan Kosarev [Thu, 13 Jul 2023 18:22:59 +0000 (19:22 +0100)]
[AMDGPU][MC] Pre-commit tests for the noa16 intersect_ray instructions fix, D155057.

The added instructions are incorrectly encoded as a16 ones despite the
'noa16' modifiers.

Reviewed By: foad

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

15 months ago[DebugInfo] Force users of DWARFDebugAbbrev to call parse before iterating
Alex Langford [Thu, 6 Jul 2023 19:46:58 +0000 (12:46 -0700)]
[DebugInfo] Force users of DWARFDebugAbbrev to call parse before iterating

In an attempt to make it easier to catch errors when parsing the
debug_abbrev section, we should force users to call `parse` before
calling `begin`. In a follow-up change, I will change the return type of
`parse` from `void` to `Error`.

I also explored using the fallible_iterator pattern instead of forcing
users to parse everything up front. I think it would be a useful and
interesting pattern to implement, but it would require more extensive
changes to both DWARFDebugAbbrev and its users. Because my top priority
is improving the safety around parsing debug_abbrev, I'm opting to
preserve existing behavior until I or somebody else has time to refactor
to be able to implement a fallible_iterator.

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

15 months ago[lldb] Support Compact C Type Format (CTF)
Jonas Devlieghere [Mon, 10 Jul 2023 03:32:38 +0000 (20:32 -0700)]
[lldb] Support Compact C Type Format (CTF)

Add support for the Compact C Type Format (CTF) in LLDB. The format
describes the layout and sizes of C types. It is most commonly consumed
by dtrace.

We generate CTF for the XNU kernel and want to be able to use this in
LLDB to debug kernels for which we don't have dSYMs (anymore). CTF is a
much more limited debug format than DWARF which allows is to be an order
of magnitude smaller: a 1GB dSYM can be converted to a handful of
megabytes of CTF. For XNU, the goal is not to replace DWARF, but rather
to have CTF serve as a "better than nothing" debug info format when
DWARF is not available.

It's worth noting that the LLVM toolchain does not support emitting CTF.
XNU uses ctfconvert to generate CTF from DWARF which is used for
testing.

Differential revision: https://reviews.llvm.org/D154862

15 months ago[lldb] Support Compact C Type Format (CTF) section
Jonas Devlieghere [Thu, 6 Jul 2023 23:49:55 +0000 (16:49 -0700)]
[lldb] Support Compact C Type Format (CTF) section

Teach LLDB about the ctf (Compact C Type Format) section.

Differential revision: https://reviews.llvm.org/D154668

15 months ago[RISCV] Common remaining operand logic in performCombineVMergeAndVOps [nfc]
Philip Reames [Thu, 13 Jul 2023 18:25:09 +0000 (11:25 -0700)]
[RISCV] Common remaining operand logic in performCombineVMergeAndVOps [nfc]

We can share the code for both the unmasked and masked cases, and add a missing consistency assert in the process.

This is a subset of Luke's D155063.  I'm splitting pieces and landing them in the process of convincing myself all the individual transforms are in fact correct.  This is the last major piece.

15 months ago[lldb] Move CommandOverrideCallbackWithResult to lldb_private namespace
Alex Langford [Wed, 12 Jul 2023 22:22:50 +0000 (15:22 -0700)]
[lldb] Move CommandOverrideCallbackWithResult to lldb_private namespace

This has an `lldb_private` type in its parameter, it should be in
`lldb-private-types.h`

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

15 months ago[flang][openacc] Add support for complex mul reduction
Valentin Clement [Thu, 13 Jul 2023 18:17:42 +0000 (11:17 -0700)]
[flang][openacc] Add support for complex mul reduction

Add support to lower reduction with the multiply operator and
complex type.

Depends on D155007

Reviewed By: razvanlupusoru

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

15 months agoSwitch to strncpy to silence GCC stringop overflow warnings.
Lang Hames [Thu, 13 Jul 2023 18:15:41 +0000 (11:15 -0700)]
Switch to strncpy to silence GCC stringop overflow warnings.

Thanks to Simon Pilgrim for letting me know about these in
https://reviews.llvm.org/rG9d701c8a8d65.

15 months ago[BOLT] Attach ORC info to instructions in CFG
Maksim Panchenko [Thu, 13 Jul 2023 05:19:15 +0000 (22:19 -0700)]
[BOLT] Attach ORC info to instructions in CFG

Propagate Linux Kernel ORC information read from the file to the whole
function CFG once the graph has been built. We have a choice to either
attach ORC state annotation to every instruction, or to the first
instruction in the basic block to conserve processing memory. I chose to
attach to every instruction under --print-orc option which is currently
on by default.

Depends on D155153, D154815

Reviewed By: Amir

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

15 months ago[BOLT][NFC] Add post-CFG processing to MetadataRewriter interface
Maksim Panchenko [Thu, 13 Jul 2023 04:36:29 +0000 (21:36 -0700)]
[BOLT][NFC] Add post-CFG processing to MetadataRewriter interface

Add MetadataRewriter::postCFGInitializer().

Reviewed By: jobnoorman

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

15 months ago[RISCV] Reason explicitly about mask and rounding mode in performCombineVMergeAndVOps...
Philip Reames [Thu, 13 Jul 2023 18:07:01 +0000 (11:07 -0700)]
[RISCV] Reason explicitly about mask and rounding mode in performCombineVMergeAndVOps [nfc]

This is a subset of Luke's D155063.  I'm splitting pieces and landing them in the process of convincing myself all the individual transforms are in fact correct.

The code structure here is overly verbose.  I'm landing this staging change with the code structure exactly matching the non-masked case to make the following cleanup that commons this all obviously correct.

15 months ago[BOLT] Add reading support for Linux ORC sections
Maksim Panchenko [Mon, 10 Jul 2023 04:36:49 +0000 (21:36 -0700)]
[BOLT] Add reading support for Linux ORC sections

Read ORC (oops rewind capability) info used for unwinding the stack by
Linux Kernel. The info is stored in .orc_unwind and .orc_unwind_ip
sections. There is also a related .orc_lookup section that is being
populated by the kernel during runtime. Contents of the sections are
sorted for quicker lookup by a post-link objtool.

Unless we modify stack access instructions, we don't have to change ORC
info attributed to instructions in the binary. However, we need to
update instruction addresses and sort both sections based on the new
layout.

For pretty printing, we add "--print-orc" option that prints ORC info
next to instructions in code dumps.

Reviewed By: Amir

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

15 months agoRemove Clang :: CodeGenCXX/unified-cfi-lto.cpp due to buildbot failures
Matthew Voss [Thu, 13 Jul 2023 18:04:32 +0000 (11:04 -0700)]
Remove Clang :: CodeGenCXX/unified-cfi-lto.cpp due to buildbot failures

This test has been failing on sanitizer-x86_64-linux-bootstrap-asan
since it was commited. Removing this test while I work on reproducing
this.

Example: https://lab.llvm.org/buildbot/#/builders/168/builds/14579

15 months ago[libc++] Fix filesystem tests on platforms that don't have IO
Louis Dionne [Tue, 11 Jul 2023 21:45:57 +0000 (17:45 -0400)]
[libc++] Fix filesystem tests on platforms that don't have IO

This patch moves a few tests that were still using std::fprintf to
using TEST_REQUIRE instead, which provides a single point to tweak
for platforms that don't implement fprintf. As a fly-by fix, it also
avoids including `time_utils.h` in filesystem_clock.cpp when it is
not required, since that header makes some pretty large assumptions
about the platform it is on.

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

15 months ago[BOLT][DWARF] Fix adding DW_AT_GNU_ranges_base
Alexander Yermolovich [Thu, 13 Jul 2023 17:54:37 +0000 (10:54 -0700)]
[BOLT][DWARF] Fix adding DW_AT_GNU_ranges_base

There are cases in DWARF4 when Skeleton CU has ranges, but dwo CU doesn't.
Bug was introduced in new DWARFRewriter where for DWARF4 it would fall through
to DWARF5 case.

Reviewed By: maksfb

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

15 months ago[lldb] Forward declare SBPlatform and SBTypeMember in SBDefines
Alex Langford [Wed, 12 Jul 2023 23:29:16 +0000 (16:29 -0700)]
[lldb] Forward declare SBPlatform and SBTypeMember in SBDefines

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

15 months ago[BOLT][DWARF][NFC] Fix false positive error
Alexander Yermolovich [Thu, 13 Jul 2023 17:50:05 +0000 (10:50 -0700)]
[BOLT][DWARF][NFC] Fix false positive error

The DWO Unit DIE, doesn't have low_pc/high_pc, so we were printing this error
for valid cases.

Reviewed By: maksfb

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

15 months agoDon't assert on a non-pointer value being used for a "p" inline asm constraint.
Amara Emerson [Tue, 11 Jul 2023 22:34:04 +0000 (15:34 -0700)]
Don't assert on a non-pointer value being used for a "p" inline asm constraint.

GCC and existing codebases allow the use of integral values to be used
with this constraint. A recent change D133914 in this area started causing asserts.
Removing the assert is enough as the rest of the code works fine.

rdar://109675485

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

15 months ago[RISCV] Update test after the addition for rounding mode to vfadd intrinsic. NFC
Craig Topper [Thu, 13 Jul 2023 17:39:26 +0000 (10:39 -0700)]
[RISCV] Update test after the addition for rounding mode to vfadd intrinsic. NFC

The greediness of the operand matching regular expressions made
the test pass even though an operand is missing.