platform/upstream/llvm.git
22 months ago[flang] Check C854, C855, & C856 on PROTECTED entities
Peter Klausler [Sat, 17 Dec 2022 17:47:21 +0000 (09:47 -0800)]
[flang] Check C854, C855, & C856 on PROTECTED entities

Check for things that are not allowed to bear the PROTECTED
attribute.

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

22 months ago[flang] Apply definability checks in ALLOCATE/DEALLOCATE statements
Peter Klausler [Sat, 17 Dec 2022 17:11:40 +0000 (09:11 -0800)]
[flang] Apply definability checks in ALLOCATE/DEALLOCATE statements

The pointers and allocatables that appear in ALLOCATE and DEALLOCATE
statements need to be subject to the general definability checks so
that problems with e.g. PROTECTED objects can be caught.

(Also: regularize the capitalization of the DEALLOCATE error messages
while I'm in here so that they're consistent with the messages that
can come out for ALLOCATE.)

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

22 months agoFix unused variable warnings in SIFrameLowering.cpp for release build, NFC
Haojian Wu [Sat, 17 Dec 2022 17:22:18 +0000 (18:22 +0100)]
Fix unused variable warnings in SIFrameLowering.cpp for release build, NFC

22 months agoUpdate the bazel's llvm-config.h.cmake file
Haojian Wu [Sat, 17 Dec 2022 17:14:10 +0000 (18:14 +0100)]
Update the bazel's llvm-config.h.cmake file

Reflect the change 7d2c1150d31bb3692c81f6ecb0dbe61170e31212, fix the bazel test
breakage.

22 months ago[flang] Enforce C1529 as a warning, C919 as an error
Peter Klausler [Sat, 17 Dec 2022 15:33:04 +0000 (07:33 -0800)]
[flang] Enforce C1529 as a warning, C919 as an error

Constraint C1529 requires that the base object of a type-bound procedure
reference be a scalar if the TBP has the NOPASS attribute.  Most
compilers do not enforce this constraint and it does not appear to
have any implementation justification, so emit portability warning.

On the other hand, we fail to enforce C919 for references to
procedure pointer components, whose base objects must of course
be scalars in order to avoid ambiguity and empty arrays, whether
NOPASS is present or not.

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

22 months agoFix unused variable warning in release build, NFC.
Haojian Wu [Sat, 17 Dec 2022 17:04:28 +0000 (18:04 +0100)]
Fix unused variable warning in release build, NFC.

22 months ago[X86] All the WriteBLS instructions take 2uops, not 1uop
Simon Pilgrim [Sat, 17 Dec 2022 15:33:04 +0000 (15:33 +0000)]
[X86] All the WriteBLS instructions take 2uops, not 1uop

Confirmed by AMD SoG + Agner + uops.info

22 months ago[AggressiveInstCombine] Fix invalid TypeSize conversion when combining loads.
Paul Walker [Thu, 15 Dec 2022 14:59:51 +0000 (14:59 +0000)]
[AggressiveInstCombine] Fix invalid TypeSize conversion when combining loads.

Much of foldLoadsRecursive relies on knowing the size of loaded
data, which is not possible for scalable vector types.  However,
the logic of combining two small loads into one bigger load does
not apply for vector types so rather than converting the algorithm
to use TypeSize I've simply added an early exit for vectors.

Fixes #59510

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

22 months ago[flang] Impose DATA initialization size limit to avoid crashing
Peter Klausler [Mon, 12 Dec 2022 21:58:07 +0000 (13:58 -0800)]
[flang] Impose DATA initialization size limit to avoid crashing

Impose a large but finite limit on the size of a variable being
initialized in a DATA statement to provide a readable error message
for artificial test cases that's better than a memory allocation
failure crash.

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

22 months ago[dsymutil] fix accidental 32bit truncation in patchFrameInfoForObject
Alessandro Arzilli [Sat, 17 Dec 2022 12:22:05 +0000 (13:22 +0100)]
[dsymutil] fix accidental 32bit truncation in patchFrameInfoForObject

patchFrameInfoForObject accidentally truncates FDE addresses
to the least significant 32bits, which causes the Go bug: https://github.com/golang/go/issues/25841.

Patch by Alessandro Arzilli

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

22 months agoRevert "Reland 2nd attempt: [lld-macho] Fix bug in reading cpuSubType field."
Nico Weber [Sat, 17 Dec 2022 14:25:42 +0000 (09:25 -0500)]
Revert "Reland 2nd attempt:  [lld-macho] Fix bug in reading cpuSubType field."

This reverts commit b08acee423935c16a1503335d78b84ccbbae4ef8.
Still breaks tests, see https://reviews.llvm.org/D139572#4003191

22 months ago[NFC][llvm-exegesis] LLVMState: only store references to reg/op names
Roman Lebedev [Sat, 17 Dec 2022 13:48:07 +0000 (16:48 +0300)]
[NFC][llvm-exegesis] LLVMState: only store references to reg/op names

We know that the original reference from which we've built these maps
will persist, so we do not need to copy the names.

22 months ago[llvm-exegesis][X86] Use the same AGU counter estimate mapping for znver1 as znver2...
Simon Pilgrim [Sat, 17 Dec 2022 14:06:26 +0000 (14:06 +0000)]
[llvm-exegesis][X86] Use the same AGU counter estimate mapping for znver1 as znver2, and count RMW ops as well

znver2 can use the ld/st dispatch counters to make a reasonable estimate for the AGU usage (although it misses complex LEA ops which I don't think we can fix), although it wasn't accounting for RMW ld-st uops which are counted separately - the same approach can be used for znver1 (ymm double-pumping ld/st agu is correctly measured as 2uops)

This change is mainly academic, but was noticed as the znver1/2 models incorrectly assume scalar RMW ops take 2uops

22 months ago[NFC][InstCombine] Move nested-select testcase into proper place, adjust comment
Roman Lebedev [Sat, 17 Dec 2022 13:38:24 +0000 (16:38 +0300)]
[NFC][InstCombine] Move nested-select testcase into proper place, adjust comment

22 months ago[libc++][format] Renames __null_sentinel.
Mark de Wever [Thu, 15 Dec 2022 17:58:17 +0000 (18:58 +0100)]
[libc++][format] Renames __null_sentinel.

While the FreeBSD CI was enabled in D128084 it was discovered libc++
uses the name of a system macro on FreeBSD. This renames the macro to
fix the issue.

Reviewed By: emaste, #libc, philnik

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

22 months ago[X86] AMD Zen 4 Initial enablement
Ganesh Gopalasubramanian [Thu, 15 Dec 2022 13:58:34 +0000 (19:28 +0530)]
[X86] AMD Zen 4 Initial enablement

Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/D139073

22 months agomlir/tblgen: use std::optional in generation
Ramkumar Ramachandra [Wed, 14 Dec 2022 10:39:19 +0000 (11:39 +0100)]
mlir/tblgen: use std::optional in generation

This is part of an effort to migrate from llvm::Optional to
std::optional. This patch changes the way mlir-tblgen generates .inc
files, and modifies tests and documentation appropriately. It is a "no
compromises" patch, and doesn't leave the user with an unpleasant mix of
llvm::Optional and std::optional.

A non-trivial change has been made to ControlFlowInterfaces to split one
constructor into two, relating to a build failure on Windows.

See also: https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

Signed-off-by: Ramkumar Ramachandra <r@artagnon.com>
Differential Revision: https://reviews.llvm.org/D138934

22 months agoRevert "[RISCV] Support the short-forward-branch predicatd ops in RISCVSExtWRemoval."
Craig Topper [Sat, 17 Dec 2022 08:11:19 +0000 (00:11 -0800)]
Revert "[RISCV] Support the short-forward-branch predicatd ops in RISCVSExtWRemoval."

This reverts commit 9e586217f4e331bca241df00648ca0b71edd3ef6.

I think there's at least one mistake in this.

22 months ago[clang] llvm::Optional::value => operator*/operator->
Fangrui Song [Sat, 17 Dec 2022 08:10:45 +0000 (08:10 +0000)]
[clang] llvm::Optional::value => operator*/operator->

std::optional::value() has undesired exception checking semantics and is
unavailable in older Xcode (see _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS). The
call sites block std::optional migration.

This makes `ninja check-clang` work in the absence of llvm::Optional::value.

22 months agoEnsure newlines at the end of files (NFC)
Kazu Hirata [Sat, 17 Dec 2022 07:36:51 +0000 (23:36 -0800)]
Ensure newlines at the end of files (NFC)

22 months ago[RISCV] Support the short-forward-branch predicatd ops in RISCVSExtWRemoval.
Craig Topper [Sat, 17 Dec 2022 07:25:20 +0000 (23:25 -0800)]
[RISCV] Support the short-forward-branch predicatd ops in RISCVSExtWRemoval.

22 months ago[BinaryFormat] Use std::optional instead of llvm::Optional (NFC)
Kazu Hirata [Sat, 17 Dec 2022 07:20:11 +0000 (23:20 -0800)]
[BinaryFormat] Use std::optional instead of llvm::Optional (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

22 months ago[MLIR] Enhance getLargestKnownDivisor for AffineExpr floordiv/ceildiv
Uday Bondhugula [Thu, 15 Dec 2022 15:24:19 +0000 (20:54 +0530)]
[MLIR] Enhance getLargestKnownDivisor for AffineExpr floordiv/ceildiv

The largest known divisor for expressions like (32 * d0 + 32, 128)
ceildiv 8 wasn't being computed tightly; a conservative value of 1 was
being returned. Address this. This leads to a broad improvement for
several affine analyses and rewrites that depend on knowing whether
something is a multiple of a specific constant or such largest known
constant.

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

22 months ago[NVPTX] Use std::optional instead of llvm::Optional (NFC)
Kazu Hirata [Sat, 17 Dec 2022 06:38:57 +0000 (22:38 -0800)]
[NVPTX] Use std::optional instead of llvm::Optional (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

22 months ago[RISCV] Add support for predicating AND/OR/XOR/ADD/SUB with short-forward-branch...
Craig Topper [Sat, 17 Dec 2022 06:37:14 +0000 (22:37 -0800)]
[RISCV] Add support for predicating AND/OR/XOR/ADD/SUB with short-forward-branch-opt.

sifive-7-series can predicate ALU instructions in the shadow of a
branch not just move instructions.

This patch implements analyzeSelect/optimizeSelect to predicate
these operations. This is based on ARM's implementation which can
predicate using flags and condition codes.

I've restricted it to just the instructions we have test cases for,
but it can be extended in the future.

Reviewed By: reames

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

22 months ago[M68k] Fix spillCalleeSavedRegisters after D138656
Fangrui Song [Sat, 17 Dec 2022 06:51:04 +0000 (06:51 +0000)]
[M68k] Fix spillCalleeSavedRegisters after D138656

22 months agollvm::Optional::value => operator*/operator->
Fangrui Song [Sat, 17 Dec 2022 06:37:59 +0000 (06:37 +0000)]
llvm::Optional::value => operator*/operator->

std::optional::value() has undesired exception checking semantics and is
unavailable in older Xcode (see _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS). The
call sites block std::optional migration.

This makes `ninja clang` work in the absence of llvm::Optional::value.

22 months ago[AMDGPU][SILowerSGPRSpills] Spill SGPRs to virtual VGPRs
Christudasan Devadasan [Thu, 14 Apr 2022 14:09:59 +0000 (19:39 +0530)]
[AMDGPU][SILowerSGPRSpills] Spill SGPRs to virtual VGPRs

Currently, the custom SGPR spill lowering pass spills
SGPRs into physical VGPR lanes and the remaining VGPRs
are used by regalloc for vector regclass allocation.
This imposes many restrictions that we ended up with
unsuccessful SGPR spilling when there won't be enough
VGPRs and we are forced to spill the leftover into
memory during PEI. The custom spill handling during PEI
has many edge cases and often breaks the compiler time
to time.

This patch implements spilling SGPRs into virtual VGPR
lanes. Since we now split the register allocation for
SGPRs and VGPRs, the virtual registers introduced for
the spill lanes would get allocated automatically in
the subsequent regalloc invocation for VGPRs.

Spill to virtual registers will always be successful,
even in the high-pressure situations, and hence it avoids
most of the edge cases during PEI. We are now left with
only the custom SGPR spills during PEI for special registers
like the frame pointer which isn an unproblematic case.

This patch also implements the whole wave spills which
might occur if RA spills any live range of virtual registers
involved in the whole wave operations. Earlier, we had
been hand-picking registers for such machine operands.
But now with SGPR spills into virtual VGPR lanes, we are
exposing them to the allocator.

Reviewed By: arsenm

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

22 months ago[CodeGen] Additional Register argument to storeRegToStackSlot/loadRegFromStackSlot
Christudasan Devadasan [Thu, 24 Nov 2022 08:17:01 +0000 (13:47 +0530)]
[CodeGen] Additional Register argument to storeRegToStackSlot/loadRegFromStackSlot

With D134950, targets get notified when a virtual register is created and/or
cloned. Targets can do the needful with the delegate callback. AMDGPU propagates
the virtual register flags maintained in the target file itself. They are useful
to identify a certain type of machine operands while inserting spill stores and
reloads. Since RegAllocFast spills the physical register itself, there is no way
its virtual register can be mapped back to retrieve the flags. It can be solved
by passing the virtual register as an additional argument. This argument has no
use when the spill interfaces are called during the greedy allocator or even the
PrologEpilogInserter and can pass a null register in such cases.

Reviewed By: arsenm

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

22 months ago[CodeGen] Use cloneVirtualRegister in LiveIntervals and LiveRangeEdit
Christudasan Devadasan [Tue, 22 Nov 2022 19:15:57 +0000 (00:45 +0530)]
[CodeGen] Use cloneVirtualRegister in LiveIntervals and LiveRangeEdit

It is needed to invoke the delegate methods effectively whenever a
virtual register is cloned from an existing register of the same class.

Reviewed By: qcolombet

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

22 months ago[CodeGen] Use delegate to notify targets when virtual registers are created
Christudasan Devadasan [Fri, 30 Sep 2022 07:50:58 +0000 (13:20 +0530)]
[CodeGen] Use delegate to notify targets when virtual registers are created

This will help targets to customize certain codegen decisions based on
the virtual registers involved in special operations. This patch also
extends the existing delegate in MRI to start support multicast.

Reviewed By: qcolombet

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

22 months ago[AMDGPU][SIFrameLowering] Use the right frame register in CSR spills
Christudasan Devadasan [Fri, 30 Sep 2022 03:17:06 +0000 (08:47 +0530)]
[AMDGPU][SIFrameLowering] Use the right frame register in CSR spills

Unlike the callee-saved VGPR spill instructions emitted by
`PEI::spillCalleeSavedRegs`, the CS VGPR spills inserted during
emitPrologue/emitEpilogue require the exec bits flipping to avoid
clobbering the inactive lanes of VGPRs used for SGPR spilling.
Currently, these spill instructions are referenced from the SP at
function entry and when the callee performs a stack realignment,
they ended up getting incorrect stack offsets. Even if we try to
adjust the offsets, the FP-SP becomes a runtime entity with dynamic
stack realignment and the offsets would still be inaccurate.

To fix it, use FP as the frame base in the spill instructions
whenever the function has FP. The offsets obtained for the CS
objects would always be the right values from FP.

Reviewed By: arsenm

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

22 months ago[AMDGPU] Preserve only the inactive lanes of scratch vgprs
Christudasan Devadasan [Fri, 23 Sep 2022 09:43:09 +0000 (15:13 +0530)]
[AMDGPU] Preserve only the inactive lanes of scratch vgprs

In general, a callee is free to use a scratch register without
preserving its previous state.  However, the VGPR used for SGPR
spilling can potentially have its inactive lanes overwritten by
the writelane instructions. When the function returns, it can
cause unexpected behavior if the VGPR value is not preserved
appropriately.

The current scheme to preserve the inactive lanes of such
scratch VGPRs is not done rightly. It preserves all lanes
and causes the outgoing values (if any) getting overwritten
by the epilog restores. It then corrupts the return value.

To avoid such situation with scratch VGPRs, this patch ensures
we preserve only their inactive lanes.

Reviewed By: arsenm

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

22 months ago[AMDGPU][SIFrameLowering] Unify PEI SGPR spill saves and restores
Christudasan Devadasan [Thu, 18 Aug 2022 04:56:09 +0000 (10:26 +0530)]
[AMDGPU][SIFrameLowering] Unify PEI SGPR spill saves and restores

There is a lot of customization and eventually code duplication in the
frame lowering that handles special SGPR spills like the one needed for
the Frame Pointer. Incorporating any additional SGPR spill currently
makes it difficult during PEI. This patch introduces a new spill builder
to efficiently handle such spill requirements. Various spill methods are
special handled using a separate class.

Reviewed By: sebastian-ne, scott.linder

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

22 months ago[AMDGPU] Separate out SGPR spills to VGPR lanes during PEI
Christudasan Devadasan [Wed, 13 Apr 2022 05:58:59 +0000 (11:28 +0530)]
[AMDGPU] Separate out SGPR spills to VGPR lanes during PEI

SILowerSGPRSpills pass handles the lowering of SGPR spills
into VGPR lanes. Some SGPR spills are handled later during
PEI. There is a common function used in both places to find
the free VGPR lane. This patch eliminates that dependency to
find the free VGPR by handling it separately for PEI. It is a
prerequisite patch for a future work to allow SGPR spills to
virtual VGPR lanes during SILowerSGPRSpills.

Reviewed By: arsenm

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

22 months ago[AMDGPU] Correctly set IsKill flag for VGPR spills in the prolog
Christudasan Devadasan [Sun, 17 Apr 2022 12:14:39 +0000 (17:44 +0530)]
[AMDGPU] Correctly set IsKill flag for VGPR spills in the prolog

We always assume the vector register is dead or killed while
inserting the VGPR spills in the prolog. It is not always
true. Used the entry block liveIn data while setting the flag.

Reviewed By: arsenm

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

22 months ago[AMDGPU] Add WWM reserved VGPRs to WWMSpills
Christudasan Devadasan [Tue, 19 Apr 2022 07:04:12 +0000 (12:34 +0530)]
[AMDGPU] Add WWM reserved VGPRs to WWMSpills

The custom VGPR spills inserted during frame lowering
maintain a separate list for WWM reserved registers.
Added them into WWMSpills that already tracks such
reserved registers. It unifies the spill insertion.

Reviewed By: nhaehnle, arsenm

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

22 months ago[AMDGPU] Callee must always spill writelane VGPRs
Christudasan Devadasan [Mon, 13 Jun 2022 13:12:02 +0000 (18:42 +0530)]
[AMDGPU] Callee must always spill writelane VGPRs

Since the writelane instruction used for SGPR spills can
modify inactive lanes, the callee must preserve the VGPR
this instruction modifies even if it was marked Caller-saved.

Reviewed By: arsenm, nhaehnle

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

22 months ago[mlir] llvm::Optional::value => operator*/operator->
Fangrui Song [Sat, 17 Dec 2022 05:27:33 +0000 (05:27 +0000)]
[mlir] llvm::Optional::value => operator*/operator->

std::optional::value() has undesired exception checking semantics and is
unavailable in some older Xcode. The call sites block std::optional migration.

22 months ago[llvm] llvm::Optional::value => operator*/operator->
Fangrui Song [Sat, 17 Dec 2022 05:23:45 +0000 (05:23 +0000)]
[llvm] llvm::Optional::value => operator*/operator->

std::optional::value() has undesired exception checking semantics and is
unavailable in some older Xcode. The call sites block std::optional migration.

22 months ago[clang] llvm::Optional::value => operator*/operator->
Fangrui Song [Sat, 17 Dec 2022 05:15:07 +0000 (05:15 +0000)]
[clang] llvm::Optional::value => operator*/operator->

std::optional::value() has undesired exception checking semantics and is
unavailable in some older Xcode. The call sites block std::optional migration.

22 months ago[clangd] llvm::Optional::value => operator*/operator->
Fangrui Song [Sat, 17 Dec 2022 05:11:01 +0000 (05:11 +0000)]
[clangd] llvm::Optional::value => operator*/operator->

std::optional::value() has undesired exception checking semantics and is
unavailable in some older Xcode. The call sites block std::optional migration.

22 months ago[-Wunsafe-buffer-usage] Ignore array subscript on literal zero
ziqingluo-90 [Sat, 17 Dec 2022 04:59:40 +0000 (20:59 -0800)]
[-Wunsafe-buffer-usage] Ignore array subscript on literal zero

Unsafe Buffer Usage analysis only warns unsafe buffer accesses but not
pointer dereferences.  An array subscript on a literal zero is
equivalent to dereference a pointer thus we do not want to warn it.

Reviewed By: NoQ

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

22 months ago[lld] llvm::Optional::value => operator*/operator->
Fangrui Song [Sat, 17 Dec 2022 05:03:57 +0000 (05:03 +0000)]
[lld] llvm::Optional::value => operator*/operator->

std::optional::value() has undesired exception checking semantics and is
unavailable in some older Xcode. The call sites block std::optional migration.

22 months ago[lldb] llvm::Optional::value => operator*/operator->
Fangrui Song [Sat, 17 Dec 2022 05:01:54 +0000 (05:01 +0000)]
[lldb] llvm::Optional::value => operator*/operator->

std::optional::value() has undesired exception checking semantics and is
unavailable in some older Xcode. The call sites block std::optional migration.

22 months agollvm::Optional::value => operator*/operator->
Fangrui Song [Sat, 17 Dec 2022 04:45:11 +0000 (04:45 +0000)]
llvm::Optional::value => operator*/operator->

std::optional::value() has undesired exception checking semantics and is
unavailable in some older Xcode. The call sites block std::optional migration.

22 months ago[-Wunsafe-buffer-usage] Improve pointer matching pattern
ziqingluo-90 [Sat, 17 Dec 2022 04:35:41 +0000 (20:35 -0800)]
[-Wunsafe-buffer-usage] Improve pointer matching pattern

Generalize the pointer expression AST matcher in Unsafe Buffer Usage analysis.
Add test cases for various kinds of pointer usages.

Reviewed By: NoQ, aaron.ballman, xazax.hun

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

22 months ago[mlir] std::optional::value => operator*/operator->
Fangrui Song [Sat, 17 Dec 2022 04:38:27 +0000 (04:38 +0000)]
[mlir] std::optional::value => operator*/operator->

value() has undesired exception checking semantics and calls
__throw_bad_optional_access in libc++. Moreover, the API is unavailable without
_LIBCPP_NO_EXCEPTIONS on older Mach-O platforms (see
_LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS).

22 months ago[flang] std::optional::value => operator*/operator->
Fangrui Song [Sat, 17 Dec 2022 04:11:55 +0000 (04:11 +0000)]
[flang] std::optional::value => operator*/operator->

22 months ago[lld] std::optional::value => operator*/operator->
Fangrui Song [Sat, 17 Dec 2022 03:19:47 +0000 (03:19 +0000)]
[lld] std::optional::value => operator*/operator->

22 months ago[C-API] Add example code to exercise new MCJIT-like-memory-manager API.
Wenzel Jakob [Sat, 17 Dec 2022 02:11:56 +0000 (13:11 +1100)]
[C-API] Add example code to exercise new MCJIT-like-memory-manager API.

This example shows how to use the newly added
LLVMOrcCreateRTDyldObjectLinkingLayerWithMCJITMemoryManagerLikeCallbacks API.

22 months ago[C-API] LLVMOrcCreateRTDyldObjectLinkingLayerWithMCJITMemoryManagerLikeCallbacks
Lang Hames [Sat, 17 Dec 2022 02:01:08 +0000 (13:01 +1100)]
[C-API] LLVMOrcCreateRTDyldObjectLinkingLayerWithMCJITMemoryManagerLikeCallbacks

Adds a LLVMOrcCreateRTDyldObjectLinkingLayerWithMCJITMemoryManagerLikeCallbacks
function that can be used to create an RTDyldObjectLinkingLayer using callbacks
that are similar (but not identical) to those used in
LLVMCreateSimpleMCJITMemoryManager. This is intended to ease the transition to
ORC for MCJIT C-API clients.

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

22 months agostd::optional::value => operator*/operator->
Fangrui Song [Sat, 17 Dec 2022 03:12:04 +0000 (03:12 +0000)]
std::optional::value => operator*/operator->

value() has undesired exception checking semantics and calls
__throw_bad_optional_access in libc++. Moreover, the API is unavailable without
_LIBCPP_NO_EXCEPTIONS on older Mach-O platforms (see
_LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS).

This fixes check-clang-tools.

22 months agoReland 2nd attempt: [lld-macho] Fix bug in reading cpuSubType field.
Vy Nguyen [Fri, 16 Dec 2022 20:17:06 +0000 (15:17 -0500)]
Reland 2nd attempt:  [lld-macho] Fix bug in reading cpuSubType field.

This reverts commit 52a118d08fbb0a45cba8c34346d9ccb14f599c6a.

New changes:
Fix tests to dump both slices in the fat-archive because otool
isn't deterministic about which slice it prints across different archs.
(It printed x86 on x86 machines but arm64 on arm64, this was why
the test failed on arm64)

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

22 months ago[RISCV][VP] support vp.reduce.mul by ExpandVectorPredication
Yingchi Long [Fri, 9 Dec 2022 16:53:57 +0000 (00:53 +0800)]
[RISCV][VP] support vp.reduce.mul by ExpandVectorPredication

Most of VP intrinsics are implemented in RISC-V backends, but
vp.reduce.mul (element length > 1) does not yet. Legalizes vp.reduce.mul
using ExpandVectorPredication Pass.

Reviewed By: reames

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

22 months ago[-Wunsafe-buffer-usage] NFC: Implement fix-strategies and variable-use-claiming.
Artem Dergachev [Sat, 17 Dec 2022 01:52:02 +0000 (17:52 -0800)]
[-Wunsafe-buffer-usage] NFC: Implement fix-strategies and variable-use-claiming.

This patch adds more abstractions that we'll need later for emitting
-Wunsafe-buffer-usage fixits. It doesn't emit any actual fixits,
so no change is observed behavior, but it introduces a way to emit fixits,
and existing tests now verify that the compiler still emits no fixits,
despite knowing how to do so.

The purpose of our code transformation analysis is to fix variable types
in the code from raw pointer types to C++ standard collection/view types.

The analysis has to decide on its own which specific type is
the most appropriate for every variable. This patch introduces
the Strategy class that maps variables to their most appropriate types.

In D137348 we've introduced the Gadget abstraction, which describes
a rigid AST pattern that the analysis "fully understands" and may need
to fix. Which specific fix is actually necessary for a given Gadget,
and whether it's necessary at all, and whether it's possible in the first place,
depends on the Strategy. So, this patch adds a virtual method which every
gadget can implement in order to teach the analysis how to fix that gadget:

  Gadget->getFixits(Strategy)

However, even if the analysis knows how to fix every Gadget, doesn't
necessarily mean it can fix the variable. Some uses of the variable may have
never been covered by Gadgets, which corresponds to the situation that
the analysis doesn't fully understand how the variable is used. This patch
introduces a Tracker class that tracks all variable uses (i.e. DeclRefExprs)
in the function. Additionally, each Gadget now provides a new virtual method

  Gadget->getClaimedVarUseSites()

that the Tracker can call to see which DeclRefExprs are "claimed" by the Gadget.
In order to fix the variable with a certain Strategy, the Tracker needs to
confirm that there are no unclaimed uses, and every Gadget has to provide
a fix for that Strategy.

This "conservative" behavior guarantees that fixes emitted by our analysis
are correct by construction. We can now be sure that the analysis won't
attempt to emit a fix if it doesn't understand the code. Later, as we implement
more getFixits() methods in individual Gadget classes, we'll start
progressively emitting more and more fixits.

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

22 months agoAllow non-constant divisors in affine mod, floordiv, ceildiv.
Benoit Jacob [Thu, 15 Dec 2022 02:00:39 +0000 (02:00 +0000)]
Allow non-constant divisors in affine mod, floordiv, ceildiv.

The requirement that divisor>0 is not enforced here outside of the
constant case, but how to enforce it? If I understand correctly, it is
UB and while it is nice to be able to deterministically intercept UB,
that isn't always feasible. Hopefully, keeping the existing
enforcement in the constant case is enough.

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

22 months agoReland "[SimplifyCFG] `FoldBranchToCommonDest()`: deal with mismatched IV's in PHI...
Roman Lebedev [Sat, 17 Dec 2022 02:13:30 +0000 (05:13 +0300)]
Reland "[SimplifyCFG] `FoldBranchToCommonDest()`: deal with mismatched IV's in PHI's in common successor block"

This reverts commit 37b8f09a4b61bf9bf9d0b9017d790c8b82be2e17,
and returns commit 1bd0b82e508d049efdb07f4f8a342f35818df341.
The miscompile was in InstCombine, and it has been addressed.

This tries to approach the problem noted by @arsenm:
terrible codegen for `__builtin_fpclassify()`:
https://godbolt.org/z/388zqdE37

Just because the PHI in the common successor happens to have different
incoming values for these two blocks, doesn't mean we have to give up.
It's quite easy to deal with this, we just need to produce a select:
https://alive2.llvm.org/ce/z/000srb

Now, the cost model for this transform is rather overly strict,
so this will basically never fire. We tally all (over all preds)
the selects needed to the NumBonusInsts

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

22 months ago[IR][PatternMatch] `m_Not`: do not apply inner matcher unless `Not` matched
Roman Lebedev [Sat, 17 Dec 2022 01:57:58 +0000 (04:57 +0300)]
[IR][PatternMatch] `m_Not`: do not apply inner matcher unless `Not` matched

This is consistent with how other commutative matchers operate,
and i assumed that is how this one worked, alas it did not,
and thus `foldNestedSelects()` was miscompiling stuff.

22 months ago[NFC][InstCombine] Simplify miscompile testcase
Roman Lebedev [Sat, 17 Dec 2022 01:20:28 +0000 (04:20 +0300)]
[NFC][InstCombine] Simplify miscompile testcase

22 months ago[NFC][InstCombine] Add some readability by using `DecomposedSelect` struct
Roman Lebedev [Fri, 16 Dec 2022 21:22:11 +0000 (00:22 +0300)]
[NFC][InstCombine] Add some readability by using `DecomposedSelect` struct

22 months ago[flang] Catch attempts to initialize allocatable components with DATA statement
Peter Klausler [Sat, 17 Dec 2022 00:47:06 +0000 (16:47 -0800)]
[flang] Catch attempts to initialize allocatable components with DATA statement

Nice try, but no, you can't initialize an instance of a derived type using a
structure constructor that has a component corresponding to an allocatable
component.

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

22 months agoclang/unittests/Basic/SarifTest.cpp: std::optional::value => operator*
Fangrui Song [Sat, 17 Dec 2022 02:08:24 +0000 (02:08 +0000)]
clang/unittests/Basic/SarifTest.cpp: std::optional::value => operator*

22 months agoRevert "[Attributor][NFCI] Update tests according to last commit"
Mitch Phillips [Sat, 17 Dec 2022 01:58:39 +0000 (17:58 -0800)]
Revert "[Attributor][NFCI] Update tests according to last commit"

This reverts commit cc9d9df7e539da4752f1569155d4ceb78465114f.

Reason: This change is dependent on a commit that needs to be rolled
back because it broke the ASan buildbot. See
https://reviews.llvm.org/rGfc21f2d7bae2e0be630470cc7ca9323ed5859892 for
more information.

22 months agoRevert "[Attributor] Introduce AA[Intra/Inter]Reachability"
Mitch Phillips [Sat, 17 Dec 2022 01:56:48 +0000 (17:56 -0800)]
Revert "[Attributor] Introduce AA[Intra/Inter]Reachability"

This reverts commit fc21f2d7bae2e0be630470cc7ca9323ed5859892.

This patch broke the ASan buildbot. See
https://reviews.llvm.org/rGfc21f2d7bae2e0be630470cc7ca9323ed5859892 for
more information.

22 months agoRevert "[OpenMP][FIX] Restrict more unsound assmptions about threading"
Mitch Phillips [Sat, 17 Dec 2022 01:56:38 +0000 (17:56 -0800)]
Revert "[OpenMP][FIX] Restrict more unsound assmptions about threading"

This reverts commit 07c375348083170e39c9498a42a9679c7e08f07f.

Reason: This change is dependent on a commit that needs to be rolled
back because it broke the ASan buildbot. See
https://reviews.llvm.org/rGfc21f2d7bae2e0be630470cc7ca9323ed5859892 for
more information.

22 months agoRevert "[Attributor][FIX] Avoid memory leakage through InstExclusionSet"
Mitch Phillips [Sat, 17 Dec 2022 01:56:21 +0000 (17:56 -0800)]
Revert "[Attributor][FIX] Avoid memory leakage through InstExclusionSet"

This reverts commit 4a5d0d8704aa2860c0459a63adfdd415a451c4f1.

Reason: This change is dependent on a commit that needs to be rolled
back because it broke the ASan buildbot. See
https://reviews.llvm.org/rGfc21f2d7bae2e0be630470cc7ca9323ed5859892 for
more information.

22 months agoRevert "[Attributor][FIX] Try to prevent a potential memory leak"
Mitch Phillips [Sat, 17 Dec 2022 01:56:11 +0000 (17:56 -0800)]
Revert "[Attributor][FIX] Try to prevent a potential memory leak"

This reverts commit 2ac37df5d7f385dbf9c9456aae1cc6d0d98587ef.

Reason: This change is dependent on a commit that needs to be rolled
back because it broke the ASan buildbot. See
https://reviews.llvm.org/rGfc21f2d7bae2e0be630470cc7ca9323ed5859892 for
more information.

22 months agoRevert "[Attributor][FIX] Allow negative offsets for ranges"
Mitch Phillips [Sat, 17 Dec 2022 01:56:00 +0000 (17:56 -0800)]
Revert "[Attributor][FIX] Allow negative offsets for ranges"

This reverts commit 88f9b525085b4292080aec6aba835801ca5793b6.

Reason: This change is dependent on a commit that needs to be rolled
back because it broke the ASan buildbot. See
https://reviews.llvm.org/rGfc21f2d7bae2e0be630470cc7ca9323ed5859892 for
more information.

22 months agoRevert "[AAPointerInfo] handle multiple offsets in PHI"
Mitch Phillips [Sat, 17 Dec 2022 01:55:48 +0000 (17:55 -0800)]
Revert "[AAPointerInfo] handle multiple offsets in PHI"

This reverts commit 88db516af69619d4326edea37e52fc7321c33bb5.

Reason: This change is dependent on a commit that needs to be rolled
back because it broke the ASan buildbot. See
https://reviews.llvm.org/rGfc21f2d7bae2e0be630470cc7ca9323ed5859892 for
more information.

22 months agoRevert "Revert "[AAPointerInfo] handle multiple offsets in PHI""
Mitch Phillips [Sat, 17 Dec 2022 01:55:38 +0000 (17:55 -0800)]
Revert "Revert "[AAPointerInfo] handle multiple offsets in PHI""

This reverts commit 12696d302d146ffe616eecab3feceba9d29be2db.

Reason: This change is dependent on a commit that needs to be rolled
back because it broke the ASan buildbot. See
https://reviews.llvm.org/rGfc21f2d7bae2e0be630470cc7ca9323ed5859892 for
more information.

22 months agoRevert "[AAPointerInfo] handle multiple offsets in PHI"
Mitch Phillips [Sat, 17 Dec 2022 01:54:44 +0000 (17:54 -0800)]
Revert "[AAPointerInfo] handle multiple offsets in PHI"

This reverts commit 179ed8871101cd197e0a719a3629cd5077b1a999.

Reason: This change is dependent on a commit that needs to be rolled
back because it broke the ASan buildbot. See
https://reviews.llvm.org/rGfc21f2d7bae2e0be630470cc7ca9323ed5859892 for
more information.

22 months agostd::optional::value => operator*/operator->
Fangrui Song [Sat, 17 Dec 2022 01:42:39 +0000 (01:42 +0000)]
std::optional::value => operator*/operator->

value() has undesired exception checking semantics and calls
__throw_bad_optional_access in libc++. Moreover, the API is unavailable without
_LIBCPP_NO_EXCEPTIONS on older Mach-O platforms (see
_LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS).

This fixes check-llvm.

22 months ago[-Wunsafe-buffer-usage] Add warnings for unsafe buffer accesses by array subscript...
ziqingluo-90 [Sat, 17 Dec 2022 00:21:57 +0000 (16:21 -0800)]
[-Wunsafe-buffer-usage] Add warnings for unsafe buffer accesses by array subscript operations

Add an unsafe Gadget in the Unsafe Buffer Usage anslysis to represent
(and search (via matchers) for) unsafe buffer-accessing array subscript operations.

Reviewed By: NoQ, jkorous, aaron.ballman, xazax.hun

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

22 months ago[gn] port 7d2c1150d31b
Nico Weber [Sat, 17 Dec 2022 01:09:25 +0000 (20:09 -0500)]
[gn] port 7d2c1150d31b

22 months ago[flang] Prevent crash in error case: elemental with alternate return
Peter Klausler [Fri, 16 Dec 2022 23:10:50 +0000 (15:10 -0800)]
[flang] Prevent crash in error case: elemental with alternate return

When an ELEMENTAL subroutine is erroneously declared with alternate return
arguments, don't crash when checking the ranks of the actual arguments.

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

22 months ago[NFC][OpenMP] Fix format for recent changes on OMPGridValues
Kevin Sala [Sat, 17 Dec 2022 00:37:21 +0000 (01:37 +0100)]
[NFC][OpenMP] Fix format for recent changes on OMPGridValues

This patch applies the clang-format to the recent changes on OMPGridValues
introduced by commit 2e9c3fe6fcfd7b4672facec87dceb76ff3c83566.

22 months agostd::optional::value => operator*/operator->
Fangrui Song [Sat, 17 Dec 2022 00:42:05 +0000 (00:42 +0000)]
std::optional::value => operator*/operator->

value() has undesired exception checking semantics and calls
__throw_bad_optional_access in libc++. Moreover, the API is unavailable without
_LIBCPP_NO_EXCEPTIONS on older Mach-O platforms (see
_LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS).

This fixes clang.

22 months ago[OpenMP] Increase max teams in OMPGridValues
Kevin Sala [Wed, 21 Sep 2022 19:25:39 +0000 (19:25 +0000)]
[OpenMP] Increase max teams in OMPGridValues

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

22 months ago[libc][Obvious] Add missing deps for a few targets.
Siva Chandra Reddy [Sat, 17 Dec 2022 00:20:01 +0000 (00:20 +0000)]
[libc][Obvious] Add missing deps for a few targets.

22 months agoRevert "[InlineAdvisor] Allow loading advisors as plugins"
Mircea Trofin [Sat, 17 Dec 2022 00:10:22 +0000 (16:10 -0800)]
Revert "[InlineAdvisor] Allow loading advisors as plugins"

This reverts commit a00aaf2b1317fbc224dc6606ef7c2a10d617f28f.

Example failures:
    https://lab.llvm.org/buildbot#builders/68/builds/44933
    https://lab.llvm.org/buildbot#builders/230/builds/6938

22 months ago[InlineAdvisor] Allow loading advisors as plugins
ibricchi [Fri, 16 Dec 2022 22:11:52 +0000 (14:11 -0800)]
[InlineAdvisor] Allow loading advisors as plugins

Adds the ability to load InlineAdvisors as plugins. This allows developing and distributing inlining heuristics outside of tree.

The PluginInlineAdvisorAnalysis class serves as the entry point for dynamic advisors. Plugins must register instances of this class to provide their own InliningAdvisor.

Reviewed By: mtrofin

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

22 months ago[NFC] Add llvm-config.h def for LLVM_ENABLE_PLUGINS
Mircea Trofin [Fri, 16 Dec 2022 23:44:27 +0000 (15:44 -0800)]
[NFC] Add llvm-config.h def for LLVM_ENABLE_PLUGINS

Snatched from D139644, but because it'd also need a fix in
Passes/CMakeLists.txt, decided to peel it off.

22 months ago-Wunsafe-buffer-usage: fix build when -DLLVM_ENABLE_ASSERTIONS=off
Fangrui Song [Fri, 16 Dec 2022 23:43:32 +0000 (23:43 +0000)]
-Wunsafe-buffer-usage: fix build when -DLLVM_ENABLE_ASSERTIONS=off

22 months ago[CodeGen] std::optional::value => operator*/operator->
Fangrui Song [Fri, 16 Dec 2022 23:41:36 +0000 (23:41 +0000)]
[CodeGen] std::optional::value => operator*/operator->

value() has undesired exception checking semantics and calls
__throw_bad_optional_access in libc++. Moreover, the API is unavailable without
_LIBCPP_NO_EXCEPTIONS on older Mach-O platforms (see
_LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS).

This fixes LLVMMIRParser, LLVMGlobalISel, LLVMAsmPrinter, LLVMSelectionDAG.

22 months agoEnsure clang test doesn't write out to the source directory
David Blaikie [Fri, 16 Dec 2022 23:39:28 +0000 (23:39 +0000)]
Ensure clang test doesn't write out to the source directory

22 months ago[Transforms,CodeGen] std::optional::value => operator*/operator->
Fangrui Song [Fri, 16 Dec 2022 23:21:27 +0000 (23:21 +0000)]
[Transforms,CodeGen] std::optional::value => operator*/operator->

value() has undesired exception checking semantics and calls
__throw_bad_optional_access in libc++. Moreover, the API is unavailable without
_LIBCPP_NO_EXCEPTIONS on older Mach-O platforms (see
_LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS).

22 months agoclang/test/CodeCompletion: Simplify/fix some `touch` commands
David Blaikie [Fri, 16 Dec 2022 23:13:47 +0000 (23:13 +0000)]
clang/test/CodeCompletion: Simplify/fix some `touch` commands

These were inconsistent (one `touch` line listed all the files in a
single `touch` invocation, but the other listed them as separate
commands with `&&`) and incorrect (one `&&` was missing, causing `touch`
to try to touch a file called `touch` in the cwd, which might not be
accessible/relevant to test execution)

So make them consistent and simpler by using the "list all the files on
a line in a single `touch` invocation" reducing the visual
noise/clutter/etc.

22 months ago[lldb][NFC] Remove unused/unimplemented Type methods
Arthur Eubanks [Fri, 16 Dec 2022 23:16:52 +0000 (15:16 -0800)]
[lldb][NFC] Remove unused/unimplemented Type methods

22 months ago[mlir][linalg] Creating named 1D pooling ops
Murali Vijayaraghavan [Fri, 16 Dec 2022 04:49:45 +0000 (04:49 +0000)]
[mlir][linalg] Creating named 1D pooling ops

This is mostly going to be used for linalg transformations - to make pooling ops similar to convolution ops.

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

22 months ago[flang][runtime] Allow CLASS(*) components when creating descriptors
Peter Klausler [Fri, 16 Dec 2022 21:48:13 +0000 (13:48 -0800)]
[flang][runtime] Allow CLASS(*) components when creating descriptors

Extend the descriptor creation function for components to allow
unlimited polymorphic components (CLASS(*)) and to also properly set
the attributes of the established descriptors.

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

22 months ago[-Wunsafe-buffer-usage] NFC: Introduce an abstraction for fixable code patterns.
Artem Dergachev [Fri, 16 Dec 2022 22:46:05 +0000 (14:46 -0800)]
[-Wunsafe-buffer-usage] NFC: Introduce an abstraction for fixable code patterns.

This patch introduces a hierarchy of Gadget classes, which are going to be
the core concept in the somewhat sophisticated machine behind the upcoming
-Wunsafe-buffer-usage fix-it hints.

A gadget is a rigid code pattern that constitutes an operation that
the fixit machine "understands" well enough to work with. A gadget may be
"unsafe" (i.e., constitute a raw buffer access) or "safe" (constitute
a use of a pointer or array variable that isn't unsafe per se,
but may need fixing if the participating variable changes type
to a safe container/view).

We'll be able to make decisions about how to fix the code depending on
the set of gadgets that we've enumerated. Basically, in order to fix a type
of a variable, each use of that variable has to participate in a gadget,
and each such gadget has to consent to fixing itself according to
the variable's new type.

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

22 months ago[OpenMP][libomptarget] Add AMDGPU NextGen plugin with asynchronous behavior
Kevin Sala [Fri, 16 Dec 2022 14:26:46 +0000 (15:26 +0100)]
[OpenMP][libomptarget] Add AMDGPU NextGen plugin with asynchronous behavior

This commit adds the AMDGPU NextGen plugin inheriting from PluginInterface's classes.
It also implements the asynchronous behavior in the plugin operations: kernel launches
and memory transfers. To this end, it implements the concept of streams of asynchronous
operations. The streams are implemented using the HSA signals to define input and output
dependencies between asynchronous operations.

Missing features:
  - Retrieve the maximum number of threads per group that a kernel can run. This requires
    reading the image.
  - Implement __tgt_rtl_sync_event, not used on the libomptarget side.

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

22 months ago[OpenMP][libomptarget] Add missing symbols in dynamic_hsa
Kevin Sala [Fri, 16 Dec 2022 14:23:34 +0000 (15:23 +0100)]
[OpenMP][libomptarget] Add missing symbols in dynamic_hsa

This patch prepares for the new AMDGPU NextGen plugin.

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

22 months ago[Transforms,InstCombine] std::optional::value => operator*/operator->
Fangrui Song [Fri, 16 Dec 2022 22:57:55 +0000 (22:57 +0000)]
[Transforms,InstCombine] std::optional::value => operator*/operator->

value() has undesired exception checking semantics and calls
__throw_bad_optional_access in libc++. Moreover, the API is unavailable without
_LIBCPP_NO_EXCEPTIONS on older Mach-O platforms (see
_LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS).

22 months agostd::optional::value => operator*/operator->
Fangrui Song [Fri, 16 Dec 2022 22:44:08 +0000 (22:44 +0000)]
std::optional::value => operator*/operator->

value() has undesired exception checking semantics and calls
__throw_bad_optional_access in libc++. Moreover, the API is unavailable without
_LIBCPP_NO_EXCEPTIONS on older Mach-O platforms (see
_LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS).

This commit fixes LLVMAnalysis and its dependencies.

22 months agoTemporarily skip test under ASAN
Adrian Prantl [Fri, 16 Dec 2022 21:50:09 +0000 (13:50 -0800)]
Temporarily skip test under ASAN

22 months ago[lldb] Report clang module build remarks
Dave Lee [Wed, 14 Dec 2022 21:53:15 +0000 (13:53 -0800)]
[lldb] Report clang module build remarks

Update the Clang diagnostic consumer (in ClangModulesDeclVendor) to report
progress on Clang module builds, as both progress events and expression logs.

Module build remarks are enabled by with clang's `-Rmodule-build` flag.

With this change, command line users of lldb will see progress events showing
which modules are being built, and - by how long they stay on screen - how much
time it takes to build them. IDEs that show progress events can show these
updates if desired.

This does not show module-import remarks, although that may be added as a
future change.

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

22 months ago[flang] Correct folding of EXTENDS_TYPE_OF()
Peter Klausler [Fri, 16 Dec 2022 19:44:51 +0000 (11:44 -0800)]
[flang] Correct folding of EXTENDS_TYPE_OF()

There was a falsely known case with a polymorphic type.

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

22 months ago[mlir-c] Add method to create unmanaged dense resource elements attr
Jacques Pienaar [Fri, 16 Dec 2022 21:36:15 +0000 (13:36 -0800)]
[mlir-c] Add method to create unmanaged dense resource elements attr

Following DenseElementsAttr pattern.

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