platform/upstream/llvm.git
19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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.

19 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

19 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

19 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.

19 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 D155153D154815

Reviewed By: Amir

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

19 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

19 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.

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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.

19 months ago[mlir][sparse][gpu] force 16-byte alignment on data structs for cuSparseLt
Aart Bik [Wed, 12 Jul 2023 23:50:42 +0000 (16:50 -0700)]
[mlir][sparse][gpu] force 16-byte alignment on data structs for cuSparseLt

Also makes some minor consistency edits in the cuSparseLt wrapper lib.

Reviewed By: Peiming, K-Wu

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

19 months ago[BOLT][DWARF][NFC] Set initial offset of DIE
Alexander Yermolovich [Thu, 13 Jul 2023 17:44:29 +0000 (10:44 -0700)]
[BOLT][DWARF][NFC] Set initial offset of DIE

Setting initial offset of DIE to input DIE. This is to make "printf" debugging
easier.

Reviewed By: maksfb

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

19 months ago[Driver] Remove unneeded useRelaxRelocations overrides
Fangrui Song [Thu, 13 Jul 2023 17:43:01 +0000 (10:43 -0700)]
[Driver] Remove unneeded useRelaxRelocations overrides

ENABLE_X86_RELAX_RELOCATIONS has defaulted to on
(c41a18cf61790fc898dcda1055c3efbf442c14c0) for nearly 3 years.
As a clean-up, remove overrides from some early adopters.

Change OHOS to use true as agreed by the patch author D145227.

19 months ago[RISCV] Common post-mask operand construction in performCombineVMergeAndVOps [nfc]
Philip Reames [Thu, 13 Jul 2023 17:37:02 +0000 (10:37 -0700)]
[RISCV] Common post-mask operand construction 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.

This particular change involves a slightly ugly bit of code to match the glue to the mask.  I'm staging it this way as I ran into a bit of weirdness when commoning mask operands, and wanted to isolate the complexity.

19 months ago[Demangle] use std::string_view::data rather than &*std::string_view::begin
Nick Desaulniers [Thu, 13 Jul 2023 17:10:02 +0000 (10:10 -0700)]
[Demangle] use std::string_view::data rather than &*std::string_view::begin

To fix expensive check builds that were failing when using MSVC's
std::string_view::iterator::operator*, I added a few expressions like
&*std::string_view::begin.  @nico pointed out that this is literally the
same thing and more clearly expressed as std::string_view::data.

Link: https://github.com/llvm/llvm-project/issues/63740
Reviewed By: #libc_abi, ldionne, philnik, MaskRay

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

19 months ago[Flang][OpenMP][Lower] Program level implicit SAVE variable handling for declare...
Andrew Gozillon [Thu, 13 Jul 2023 16:41:06 +0000 (11:41 -0500)]
[Flang][OpenMP][Lower] Program level implicit SAVE variable handling for declare target

This is an attempt at mimicing the method in which
threadprivate handles the following type of variables:

program main
  integer :: i
  !$omp declare target to(i)
end

Which essentially generates a GlobalOp for the variable (which
would normally only be an alloca) when it's instantiated. The
main difference is there is no operation generated within the
function, instead the declare target attribute is appended
later within handleDeclareTarget.

Reviewers: kiranchandramohan

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

19 months ago[RISCV] Tail common repeated code in performCombineVMergeAndVOps [nfc]
Philip Reames [Thu, 13 Jul 2023 17:06:06 +0000 (10:06 -0700)]
[RISCV] Tail common repeated code in performCombineVMergeAndVOps [nfc]

Very minor change, just making sure each step is obvious and easy to follow.

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.

19 months ago[flang] Fix OMPEarlyOutlining erasing declare target functions
Jan Sjodin [Thu, 13 Jul 2023 16:56:01 +0000 (12:56 -0400)]
[flang] Fix OMPEarlyOutlining erasing declare target functions

The early outlining pass was erasing target functions that need to be
kept. It should only erase functions that contain target ops.

19 months ago[RISCV] Factor out a dupiicate bit of repeated code in performCombineVMergeAndVOps...
Philip Reames [Thu, 13 Jul 2023 16:57:54 +0000 (09:57 -0700)]
[RISCV] Factor out a dupiicate bit of repeated code in performCombineVMergeAndVOps [nfc]

We have the SEW operand access repeating in all paths, common it up to make the code easier to read.

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.

19 months ago[flang][hlfir] Fixed character allocatable in structure constructor.
Slava Zakharin [Thu, 13 Jul 2023 16:44:39 +0000 (09:44 -0700)]
[flang][hlfir] Fixed character allocatable in structure constructor.

The problem appeared as a segfault for case like this:
```
type t
character(11), allocatable :: c
end type
character(12), alloctable :: x
type(t) y
y = t(x)
```

The frontend representes `y = t(x)` as `y=t(c=%SET_LENGTH(x,11_8))`.
When 'x' is unallocated the hlfir.set_length lowering results in
segfault. It could probably be handled in hlfir.set_length lowering
by using NULL base for the hlfir.declare depending on the allocation
status of 'x', but I am not sure if !hlfir.expr, in general, is supposed
to represent an expression created from unallocated allocatable.
I believe in Fortran that would mean referencing an unallocated
allocatable, which is not allowed.

I decided to special case `SET_LENGTH` in structure constructor,
so that we use its 'x' operand as the RHS for the assign operation
implying the isAllocatable check for cases when 'x' is allocatable.
This requires setting keep_lhs_length_if_realloc flag for the assign
operation. Note that when the component being intialized has
deferred length the frontend does not produce `SET_LENGTH`.

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

19 months ago[Driver] Recognize powerpc-unknown-eabi as a bare-metal toolchain
Christian Walther [Thu, 13 Jul 2023 16:19:25 +0000 (09:19 -0700)]
[Driver] Recognize powerpc-unknown-eabi as a bare-metal toolchain

This seems to match https://gcc.gnu.org/install/specific.html#powerpc-x-eabi

It seems that anything with OS `none` (although that doesn’t seem to be distinguished from `unknown`) or with environment `eabi` should be treated as bare-metal.
Since this seems to have been handled on a case-by-case basis in the past ([arm](https://reviews.llvm.org/D33259), [riscv](https://reviews.llvm.org/D91442), [aarch64](https://reviews.llvm.org/D111134)), what I am proposing here is to add another case to the list to also handle `powerpc[64][le]-unknown-unknown-eabi` using the `BareMetal` toolchain, following the example of the existing cases. (We don’t care about powerpc64 and powerpc[64]le, but it seemed appropriate to lump them in.)

At Indel, we have been building bare-metal embedded applications that run on custom PowerPC and ARM systems with Clang and LLD for a couple of years now, using target triples `powerpc-indel-eabi`, `powerpc-indel-eabi750`, `arm-indel-eabi`, `aarch64-indel-eabi` (which I just learned from D153430 is wrong and should be `aarch64-indel-elf` instead, but that’s a different matter). This has worked fine for ARM, but for PowerPC we have been unable to call the linker (LLD) through the Clang driver, because it would insist on calling GCC as the linker, even when told `-fuse-ld=lld`. That does not work for us, there is no GCC around. Instead we had to call `ld.lld` directly, introducing some special cases in our build system to translate between linker-via-driver and linker-called-directly command line arguments. I have now dug into why that is, and found that the difference between ARM and PowerPC is that `arm-indel-eabi` hits a special case that causes the Clang driver to instantiate a `BareMetal` toolchain that is able to call LLD and works the way we need, whereas `powerpc-indel-eabi` lands in the default case of a `Generic_ELF` (subclass of `Generic_GCC`) toolchain which expects GCC.

Reviewed By: MaskRay, michaelplatings, #powerpc, nemanjai

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

19 months ago[X86] Fold ANDNP(X,NOT(Y)) -> NOT(OR(X,Y))
Simon Pilgrim [Thu, 13 Jul 2023 15:56:05 +0000 (16:56 +0100)]
[X86] Fold ANDNP(X,NOT(Y)) -> NOT(OR(X,Y))

Removing the x86-specific node helps further folding and improves commutativity

19 months ago[flang][openacc] Add semantic check for reduction operator and types
Valentin Clement [Thu, 13 Jul 2023 15:53:51 +0000 (08:53 -0700)]
[flang][openacc] Add semantic check for reduction operator and types

Check the combination of reduction operator and types. This is
currently not checking common block and composite types.

Depends on D155105

Reviewed By: razvanlupusoru

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

19 months ago[flang][NFC] Remove duplicate of getDesignatorNameIfDataRef function
Valentin Clement [Thu, 13 Jul 2023 15:51:51 +0000 (08:51 -0700)]
[flang][NFC] Remove duplicate of getDesignatorNameIfDataRef function

Remove duplicate of the getDesignatorNameIfDataRef() function.

Reviewed By: kiranchandramohan

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

19 months ago[RISCV] Simplify glue handling logic in performCombineVMergeAndVOps [nfc]
Philip Reames [Thu, 13 Jul 2023 15:39:35 +0000 (08:39 -0700)]
[RISCV] Simplify glue handling logic 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.

In this case, we're simplifying based on the assumption that all of our vmerge operands have mask operands.  This is a fundemental property of a vmerge.

19 months ago[Flang] -funderscoring bug fix
Mark Danial [Thu, 13 Jul 2023 15:24:54 +0000 (11:24 -0400)]
[Flang] -funderscoring bug fix

There was a bug with the -funderscoring / -fno-underscoring options from (https://reviews.llvm.org/D140795) that prevented the driver option from controlling the underscoring behaviour and instead the behaviour could only be controlled by the pass option instead of the driver option. The driver test case did not catch the bug and also needed to be updated.

Reviewed By: awarzynski

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

19 months ago[TableGen][CodeEmitterGen] Fix SubOpAliases MIOperandNo mixup
Ilya Leoshkevich [Thu, 13 Jul 2023 15:28:14 +0000 (17:28 +0200)]
[TableGen][CodeEmitterGen] Fix SubOpAliases MIOperandNo mixup

SubOpAliases maps a sub-operand name to the respective operand's index
and the sub-operand number within this operand. The operand index is
used for the Operands array.

Currently MIOperandNo is used as the operand index, which is not
correct. For example, if there are 2 operands with 3 sub-operands each:

  (ins (bdladdr12onlylen4 $B1, $D1, $L1):$BDL1,
       (bdladdr12onlylen4 $B2, $D2, $L2):$BDL2)

then B2's operand index will be 3, but the correct value is 1.

Reviewed By: jyknight

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

19 months ago[AMDGPU] Use V_FMA_MIX* more often
Mateja Marjanovic [Thu, 13 Jul 2023 09:37:35 +0000 (11:37 +0200)]
[AMDGPU] Use V_FMA_MIX* more often

Combine mul (f32) + fptrunc (f32->f16) to "v_fma_mixlo_f16 mulSrc1, mulSrc2, 0".

Differential Revision: https://reviews.llvm.org/D153544
Reviewers: arsenm, foad

19 months agoAdd test case back but with !REQUIRES: amdgpu-registered-target.
Jan Sjodin [Thu, 13 Jul 2023 14:51:36 +0000 (10:51 -0400)]
Add test case back but with !REQUIRES: amdgpu-registered-target.

19 months ago[mlir][Arith] Make previous load-bearing assert into a real error
Krzysztof Drewniak [Wed, 12 Jul 2023 15:02:59 +0000 (15:02 +0000)]
[mlir][Arith] Make previous load-bearing assert into a real error

When I landed the EmulateUnsupportedFloats, I'd negligently included
an assert that needed to run for the pass to be correct. Previous
emergency fix commits removed the assert. This commit re-adds the
"can't happen" testing as an emitOpError() and aborting the rewrite,
thus allowing it to function in no-assertions builds.

Reviewed By: kuhar

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

19 months ago[libc++] Remove BuildKite bridging files that are not needed anymore
Louis Dionne [Wed, 12 Jul 2023 21:13:58 +0000 (17:13 -0400)]
[libc++] Remove BuildKite bridging files that are not needed anymore

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

19 months ago[mlir][Linalg] Fold/erase self-copy linalg.copy on buffers
Nicolas Vasilache [Thu, 13 Jul 2023 12:06:59 +0000 (14:06 +0200)]
[mlir][Linalg] Fold/erase self-copy linalg.copy on buffers

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

19 months agosanitizer_common: initialize sanitizer runtimes lazily from signal interceptors
Dmitry Vyukov [Thu, 13 Jul 2023 12:13:09 +0000 (14:13 +0200)]
sanitizer_common: initialize sanitizer runtimes lazily from signal interceptors

Currently if a program calls sigaction very early (before non-lazy sanitizer
initialization, in particular if .preinit_array initialization is not enabled),
then sigaction will wrongly fail since the interceptor is not initialized yet.

In all other interceptors we do lazy runtime initialization for this reason,
but we don't do it in the signal interceptors.
Do lazy runtime initialization in signal interceptors as well.

Reviewed By: melver

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

19 months agoPrecommit for more usage of V_FMA/MAD_MIX*
Mateja Marjanovic [Thu, 13 Jul 2023 09:13:25 +0000 (11:13 +0200)]
Precommit for more usage of V_FMA/MAD_MIX*

Make fdiv.f16.ll autogenerated.

19 months agoRemove amdgpu target to fix aarch64 buildbot failure.
Jan Sjodin [Thu, 13 Jul 2023 14:13:42 +0000 (10:13 -0400)]
Remove amdgpu target to fix aarch64 buildbot failure.

19 months agoReland "[AMDGPU] Wave32 CodeGen for amdgcn.ballot.i64"
pvanhout [Wed, 12 Jul 2023 08:23:28 +0000 (10:23 +0200)]
Reland "[AMDGPU] Wave32 CodeGen for amdgcn.ballot.i64"

This time without the extra `->dump()`

A recent addition to the device libs, `__ockl_dm_trim`, caused a series of
failures at O0 due to a i64 ballot intrinsic being inlined into a wave32 function.

The quick fix for this is to support codegen for this rare case.
A proper long-term fix for this type of issue is still being discussed.

Fixes SWDEV-408929, SWDEV-408957, SWDEV-409885, SWDEV-410193

Reviewed By: #amdgpu, arsenm

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

19 months ago[mlir][spirv] Lower memref.reinterpret_cast
Ivan Butygin [Tue, 11 Jul 2023 19:54:27 +0000 (21:54 +0200)]
[mlir][spirv] Lower memref.reinterpret_cast

For kernel SPIR-V, we are lowering memref to bare pointers, so reinterpret can be lowered to pointer, adjusted by offset value.

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

19 months agoRevert "[AMDGPU] Wave32 CodeGen for amdgcn.ballot.i64"
pvanhout [Thu, 13 Jul 2023 13:52:27 +0000 (15:52 +0200)]
Revert "[AMDGPU] Wave32 CodeGen for amdgcn.ballot.i64"

This reverts commit cfa2d0a3aa0beb5422107dc9943cb0eae6d93896.

19 months ago[Driver] Warn about -mios-version-min instead of erroring out when
Akira Hatanaka [Thu, 13 Jul 2023 13:44:53 +0000 (06:44 -0700)]
[Driver] Warn about -mios-version-min instead of erroring out when
targeting MachO embedded architectures

Sometimes users pass this option when targeting embedded architectures
like armv7m on non-darwin platforms.

Emit a warning instead of erroring out, which restores the behavior
prior to 34d7acd444b88342fc93fca202608c1e16fa5946.

19 months ago[BTF] Fix BTFParserTest.cpp for unaligned access after D149058
Eduard Zingerman [Thu, 13 Jul 2023 10:55:05 +0000 (13:55 +0300)]
[BTF] Fix BTFParserTest.cpp for unaligned access after D149058

Test bot reported an issue with unit tests for D149058 in [1]:

  [==========] Running 1 test from 1 test suite.
  [----------] Global test environment set-up.
  [----------] 1 test from BTFParserTest
  [ RUN      ] BTFParserTest.simpleCorrectInput
  /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/unittests/DebugInfo/BTF/BTFParserTest.cpp:141:33:
  runtime error: upcast of misaligned address 0x7facce60411f for type 'llvm::SmallString<0>', which requires 8 byte alignment
  0x7facce60411f: note: pointer points here
   64 00 00 00 37  41 60 ce ac 7f 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00
               ^
  SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior
  /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/unittests/DebugInfo/BTF/BTFParserTest.cpp:141:33

The issue is caused by attribute "packed" used for too many things:

  #pragma pack(push, 1)
  struct MockData1 {
    struct B {
      ...
    } BTF;
    struct E {
      ...
    } Ext;

    int BTFSectionLen = sizeof(BTF);
    int ExtSectionLen = sizeof(Ext);

    SmallString<0> Storage;
    std::unique_ptr<ObjectFile> Obj;

  }
  #pragma pack(pop)

Access to unaligned pointers in `Storage`/`Obj` causes unaligned
access errors.

To fix this #pragma directives are pushed invards to apply only to `B`
and `E` definitions.

[1] https://lab.llvm.org/buildbot/#/builders/5/builds/35040

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

19 months agoCheck for denormal flushing when selecting V_FMA/MAD_MIX*
Mateja Marjanovic [Fri, 23 Jun 2023 09:28:30 +0000 (11:28 +0200)]
Check for denormal flushing when selecting V_FMA/MAD_MIX*

19 months agoRevert "[CodeGen] Store SP adjustment in MachineBasicBlock. NFCI."
Oliver Stannard [Thu, 13 Jul 2023 13:25:10 +0000 (14:25 +0100)]
Revert "[CodeGen] Store SP adjustment in MachineBasicBlock. NFCI."

This reverts commit 58d1eaa3b6ce4f7285c51f83faff7a3ac374c746.

19 months ago[AMDGPU] Wave32 CodeGen for amdgcn.ballot.i64
pvanhout [Wed, 12 Jul 2023 08:23:28 +0000 (10:23 +0200)]
[AMDGPU] Wave32 CodeGen for amdgcn.ballot.i64

A recent addition to the device libs, `__ockl_dm_trim`, caused a series of
failures at O0 due to a i64 ballot intrinsic being inlined into a wave32 function.

The quick fix for this is to support codegen for this rare case.
A proper long-term fix for this type of issue is still being discussed.

Fixes SWDEV-408929, SWDEV-408957, SWDEV-409885, SWDEV-410193

Reviewed By: #amdgpu, arsenm

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

19 months ago[GlobalISel] Fix the error transformation of BRCOND to BCC
hezuoqiang [Thu, 13 Jul 2023 13:16:56 +0000 (21:16 +0800)]
[GlobalISel] Fix the error transformation of BRCOND to BCC

Fix https://github.com/llvm/llvm-project/issues/62309

Reviewed By: dmgreen
Differential Revision: https://reviews.llvm.org/D150527

19 months ago[Flang][OpenMP][MLIR] Add early outlining pass for omp.target operations to flang
Jan Sjodin [Mon, 10 Jul 2023 14:55:47 +0000 (10:55 -0400)]
[Flang][OpenMP][MLIR] Add early outlining pass for omp.target operations to flang

This patch implements an early outlining transform of omp.target operations in
flang. The pass is needed because optimizations may cross target op region
boundaries, but with the outlining the resulting functions only contain a
single omp.target op plus a func.return, so there should not be any opportunity
to optimize across region boundaries.

The patch also adds an interface to be able to store and retrieve the parent
function name of the original target operation. This is needed to be able to
create correct kernel function names when lowering to LLVM-IR.

Reviewed By: kiranchandramohan, domada

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

19 months agoRevert rGf269877dc30777354be8a512e871aba1b1f9fd7a "[X86] canonicalizeShuffleMaskWithH...
Simon Pilgrim [Thu, 13 Jul 2023 13:11:42 +0000 (14:11 +0100)]
Revert rGf269877dc30777354be8a512e871aba1b1f9fd7a "[X86] canonicalizeShuffleMaskWithHorizOp - fold permute(pack(x,y)) -> pack(shuffle(x,y),undef) iff we only demand the lower elements"

This appears to be causing some infinite loops (and is particularly bad when D152928 is applied).

19 months ago[mlir][nvvm] Add populate function (nfc)
Guray Ozen [Thu, 13 Jul 2023 10:30:47 +0000 (12:30 +0200)]
[mlir][nvvm] Add populate function (nfc)

This work adds populate function for the nvvm to llvm conversion pattern.

Reviewed By: kuhar

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

19 months ago[X86] Don't elide argument copies for scalarized vectors (PR63475)
Nikita Popov [Thu, 29 Jun 2023 13:37:09 +0000 (15:37 +0200)]
[X86] Don't elide argument copies for scalarized vectors (PR63475)

When eliding argument copies, the memory layout between a plain
store of the type and the layout of the argument lowering on the
stack must match. For multi-part argument lowerings, this is not
necessarily the case.

The code already tried to prevent this optimization for "scalarized
and extended" vectors, but the check for "extends" was incomplete.
While a scalarized vector of i32s stores i32 values on the stack,
these are stored in 8 byte stack slots (on x86_64), so effectively
have padding.

Rather than trying to add more special cases to handle this (which
is not straightforward), I'm going in the other direction and
exclude scalarized vectors from this optimization entirely. This
seems like a rare case that is not worth the hassle -- the complete
lack of test coverage is not reassuring either.

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

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

19 months ago[X86] Remove out of range extract in test (NFC)
Nikita Popov [Thu, 13 Jul 2023 12:45:56 +0000 (14:45 +0200)]
[X86] Remove out of range extract in test (NFC)

As pointed out in https://reviews.llvm.org/D154078#inline-1500915.

19 months ago[gn] port d1367ca46ee4
Nico Weber [Thu, 13 Jul 2023 12:40:07 +0000 (08:40 -0400)]
[gn] port d1367ca46ee4

19 months ago[gn build] Port 2b2e7f6e5727
Nico Weber [Thu, 13 Jul 2023 12:35:06 +0000 (08:35 -0400)]
[gn build] Port 2b2e7f6e5727

19 months ago[gn] port c8e055d485ea (BTF)
Nico Weber [Thu, 13 Jul 2023 12:30:29 +0000 (08:30 -0400)]
[gn] port c8e055d485ea (BTF)

19 months ago[lldb][NFC] Factor out code linking OSO addr of uninitialized GVs
Felipe de Azevedo Piovezan [Wed, 12 Jul 2023 16:51:32 +0000 (12:51 -0400)]
[lldb][NFC] Factor out code linking OSO addr of uninitialized GVs

This code was introduced in 2fc93eabf7e132abd51d0ea0ad599beb3fa44334.
In order to improve readability of ParseVariableDIE, we move this code into a
helper function. The issue this code attempted to address was fixed between
Clangs 9 and 11; as such, if we ever want to delete this code, it is a lot
easier to do so after the refactor.

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

19 months ago[CodeGenCXX] Add test for forward declare as array elem (NFC)
Nikita Popov [Thu, 13 Jul 2023 12:24:45 +0000 (14:24 +0200)]
[CodeGenCXX] Add test for forward declare as array elem (NFC)

To guard against the miscompile that D153142 would have introduced.

19 months ago[clang][Interp][NFC] Move a declaration into an if statement
Timm Bäder [Fri, 7 Jul 2023 08:14:28 +0000 (10:14 +0200)]
[clang][Interp][NFC] Move a declaration into an if statement

19 months ago[clang][Interp][NFC] Use std::byte for byte code.
Timm Bäder [Wed, 12 Jul 2023 07:48:24 +0000 (09:48 +0200)]
[clang][Interp][NFC] Use std::byte for byte code.

19 months ago[clang][Interp][NFC] Trim Source.h includes
Timm Bäder [Thu, 13 Jul 2023 10:31:19 +0000 (12:31 +0200)]
[clang][Interp][NFC] Trim Source.h includes

19 months ago[X86] Prevent infinite loop in SelectionDAG when lowering negations
Maurice Heumann [Thu, 13 Jul 2023 11:20:32 +0000 (12:20 +0100)]
[X86] Prevent infinite loop in SelectionDAG when lowering negations

In certain cases, lowering negations can cause an infinite loop in SelectionDAG on X86.

The following snippet shows that behaviour:
https://godbolt.org/z/5hP45T4hY

What happens is that ADD(XOR(..., -1), 1) is detected as the two's complement and transformed into SUB(0, ...)
However, immediates can not be encoded as the LHS of a SUB on X86.
Therefore it is transformed back into an ADD/XOR pair, which is then again transformed into a SUB and so on.

In that specific case, I still think it is valid to display this as a SUB(0,...) , because it should eventually be lowered as a NEG.
Which seems better than an ADD/XOR pair.

Adding an exception to the X86 specific handling for SUBs with 0 LHS operand fixes this infinite loop.

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

19 months ago[clangd][NFC] Remove dead code
Mariya Podchishchaeva [Thu, 13 Jul 2023 10:47:37 +0000 (06:47 -0400)]
[clangd][NFC] Remove dead code

refactor/tweaks/ExtractVariable.cpp:
Condition (!C++ && !ExprType) is never true because if ExprType was null
we would early-exit earlier.

tool/ClangdMain.cpp:
StaticIdx variable is not initialized before check, so checking it
doesn't make sense.

Found by static analyzer tool.

Reviewed By: sammccall

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

19 months ago[AArch64] Extra tablegen patterns for smaller extracted addl/addw/subl/subw
David Green [Thu, 13 Jul 2023 10:44:17 +0000 (11:44 +0100)]
[AArch64] Extra tablegen patterns for smaller extracted addl/addw/subl/subw

During lowering, especially of smaller vector types, we can end up with
`add (extract_subvector(zext(x), extract_subvector(zext(y))`, which can
be turned into `extract_subvector(add(zext(y), zext(x)))`, which can use
the addl AArch64 instruction. This adds some tablegen patterns for it,
along with addw where only one operand is an extract/extend and subl/subw.

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

19 months ago[RISCV] Don't fold vmerge into ops if fp exception can be raised
Luke Lau [Tue, 11 Jul 2023 16:10:19 +0000 (17:10 +0100)]
[RISCV] Don't fold vmerge into ops if fp exception can be raised

We are already checking for fp exceptions if VL changes, but I believe we
should also be checking for them if the mask changes as well, since that also
affects the set of active elements. From the spec:
> A vector floating-point exception at any active floating-point element sets
> the standard FP exception flags in the fflags register. Inactive elements do
> not set FP exception flags.

Note that we don't change the mask if IsMasked is true, i.e. True is masked
already, since in that case we keep the existing mask.

Reviewed By: reames

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

19 months ago[RISCV] Add test for vmerge combine that should be prevented
Luke Lau [Tue, 11 Jul 2023 16:05:56 +0000 (17:05 +0100)]
[RISCV] Add test for vmerge combine that should be prevented

The fadd in these test cases is constrained and may set fflags differently
depending on the active elements (the nofpexcept flag isn't set on the node).
Therefore to preserve semantics we shouldn't change its mask.

Reviewed By: reames

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

19 months ago[amdgpu][lds] Raise an explicit unimplemented error on absolute address LDS variables
Jon Chesterfield [Thu, 13 Jul 2023 10:32:02 +0000 (11:32 +0100)]
[amdgpu][lds] Raise an explicit unimplemented error on absolute address LDS variables

These aren't implemented. They could be at moderate implementation
complexity. Raising an error is better than silently miscompiling.

Patching now because the patch at D155125 is a step towards using this metadata
more extensively as part of the lowering path and that will interact badly with
input variables with this annotation.

Lowering user defined variables at specific addresses would drop this error,
put them at the requested position in the frame during this pass, and then
use the same codegen that will be used for the kernel specific struct shortly.

Reviewed By: jmmartinez

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

19 months ago[libc][NFC] Split memcpy implementations per platform
Guillaume Chatelet [Wed, 12 Jul 2023 16:40:46 +0000 (16:40 +0000)]
[libc][NFC] Split memcpy implementations per platform

This is a follow up on D154800 and D154770 to make the code structure more principled and avoid too many nested #ifdef/#endif.

Reviewed By: courbet

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

19 months ago[X86] Remove combineVectorTruncation and delay general vector trunc to lowering
Simon Pilgrim [Thu, 13 Jul 2023 10:19:31 +0000 (11:19 +0100)]
[X86] Remove combineVectorTruncation and delay general vector trunc to lowering

Stop folding vector truncations to PACKSS/PACKUS patterns prematurely - another step towards Issue #63710. We still prematurely fold to PACKSS/PACKUS if there are sufficient signbits, that will be addressed in a later patch when we remove combineVectorSignBitsTruncation.

This required ReplaceNodeResults to extend handling of sub-128-bit results to SSSE3 (or later) cases, which has allowed us to improve vXi32->vXi16 truncations to use PSHUFB.

I also tweaked LowerTruncateVecPack to recognise widened truncation source operands so the upper elements remain UNDEF (otherwise truncateVectorWithPACK* will constant fold them to allzeros/allones values).

19 months ago[LSR] Don't consider users of constant outside loop
Nikita Popov [Wed, 12 Jul 2023 10:35:01 +0000 (12:35 +0200)]
[LSR] Don't consider users of constant outside loop

In CollectLoopInvariantFixupsAndFormulae(), LSR looks at users
outside the loop. E.g. if we have an addrec based on %base, and
%base is also used outside the loop, then we have to keep it in a
register anyway, which may make it more profitable to use
%base + %idx style addressing.

This reasoning doesn't hold up when the base is a constant, because
the constant can be rematerialized. The lsr-memcpy.ll test regressed
when enabling opaque pointers, because inttoptr (i64 6442450944 to ptr)
now also has a use outside the loop (previously it didn't due to a
pointer type difference), and that extra "use" results in worse use
of addressing modes in the loop. However, the use outside the loop
actually gets rematerialized, so the alleged register saving does
not occur.

The same reasoning also applies to other types of constants, such
as global variable references.

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

19 months ago[libc][NFC] Split bcmp implementations per platform
Guillaume Chatelet [Wed, 12 Jul 2023 16:16:28 +0000 (16:16 +0000)]
[libc][NFC] Split bcmp implementations per platform

This is a follow up on D154800 and D154770 to make the code structure more principled and avoid too many nested #ifdef/#endif.

Reviewed By: courbet

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

19 months ago[LSR] Add test variant with global variables (NFC)
Nikita Popov [Thu, 13 Jul 2023 10:12:09 +0000 (12:12 +0200)]
[LSR] Add test variant with global variables (NFC)

A variant of the test using globals instead of inttoptr expressions
for D155073.

19 months ago[Clang][RISCV] Align RVV intrinsic builtin names with the C intrinsics
eopXD [Wed, 12 Jul 2023 17:38:30 +0000 (10:38 -0700)]
[Clang][RISCV] Align RVV intrinsic builtin names with the C intrinsics

Reviewed By: craig.topper

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

19 months ago[X86] canonicalizeShuffleMaskWithHorizOp - fold 256-bit permute(hop(x,y)) -> hop...
Simon Pilgrim [Wed, 12 Jul 2023 15:39:59 +0000 (16:39 +0100)]
[X86] canonicalizeShuffleMaskWithHorizOp - fold 256-bit permute(hop(x,y)) -> hop(extract(x),extract(x)) iff we only demand the lower elements

Attempt to recognise when we can narrow a 256-bit hop to a lower 128-bit hop by extracting the requested subvectors (and then widening back)

19 months ago[X86] canonicalizeShuffleMaskWithHorizOp - fold permute(pack(x,y)) -> pack(shuffle...
Simon Pilgrim [Wed, 12 Jul 2023 13:01:20 +0000 (14:01 +0100)]
[X86] canonicalizeShuffleMaskWithHorizOp - fold permute(pack(x,y)) -> pack(shuffle(x,y),undef) iff we only demand the lower elements

Help expose undef elements for further shuffle combines

Noticed while trying to improve truncation packss/packus patterns for sub-128-bit results.

19 months ago[DWARFv5][DWARFLinker] Add stripped template names into .debug_names.
Alexey Lapshin [Wed, 12 Jul 2023 10:54:13 +0000 (12:54 +0200)]
[DWARFv5][DWARFLinker] Add stripped template names into .debug_names.

The D153869 patch stopped storing stripped template names into
.debug_names accelerator table. This patch restores original
behavior as lldb relies on presenting stripped names. Changes for
llvm-dwarfdump would be done as a separate patch.

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

19 months agoRevert "[MemCpyOpt] implement single BB stack-move optimization which unify the stati...
khei4 [Thu, 13 Jul 2023 09:04:49 +0000 (18:04 +0900)]
Revert "[MemCpyOpt] implement single BB stack-move optimization which unify the static unescaped allocas"

This reverts commit 96ae0851c26237378fa1280b0a9ad713e1b72bdb.

19 months ago[IR] Remove LLVMPointerTo intrinsic type (NFC)
Nikita Popov [Thu, 13 Jul 2023 08:05:42 +0000 (10:05 +0200)]
[IR] Remove LLVMPointerTo intrinsic type (NFC)

With opaque pointers, this is equivalent to llvm_ptr_ty. However,
this particular type was actually completely unused.

19 months ago[lld][COFF] Add -print-search-paths for debugging.
Tobias Hieta [Wed, 12 Jul 2023 07:22:06 +0000 (09:22 +0200)]
[lld][COFF] Add -print-search-paths for debugging.

While working on adding more implicit search paths to the
lld COFF driver, it was helpful to have a way to print all
the search paths, both for debugging and for testing without
having to create very complicated test cases.

This is a simple arg that just prints the search paths and exits.

Related to the efforts in #63827

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

19 months ago[Format][Tooling] Fix HeaderIncludes::insert not respect the main-file header.
Haojian Wu [Tue, 11 Jul 2023 13:34:20 +0000 (15:34 +0200)]
[Format][Tooling] Fix HeaderIncludes::insert not respect the main-file header.

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

19 months ago[RISCV] Adjust formatting under RISCVInstrInfoVPseudos.td (NFC)
eopXD [Thu, 13 Jul 2023 08:29:50 +0000 (01:29 -0700)]
[RISCV] Adjust formatting under RISCVInstrInfoVPseudos.td (NFC)

CC: craig.topper
19 months ago[analyzer] Fix crash in MoveChecker when it tries to report duplicate issue
Arseniy Zaostrovnykh [Wed, 12 Jul 2023 14:35:50 +0000 (16:35 +0200)]
[analyzer] Fix crash in MoveChecker when it tries to report duplicate issue

The 'MoveChecker' was missing the check if the error node was
successfully generated (non-null value was returned). This happens
if duplicate of the report is emitted.

This patch contains NFC, where 'reportBug' is renamed to 'tryReportBug',
to better indicate conditional behavior of function.

Author: Arseniy Zaostrovnykh <arseniy.zaostrovnykh@sonarsource.com>

Reviewed By: xazax.hun

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

19 months ago[RISCV] Remove unused private field 'HasFRMRoundModeOp' in RVVIntrinsic (NFC)
Jie Fu [Thu, 13 Jul 2023 08:17:03 +0000 (16:17 +0800)]
[RISCV] Remove unused private field 'HasFRMRoundModeOp' in RVVIntrinsic (NFC)

/data/llvm-project/clang/include/clang/Support/RISCVVIntrinsicUtils.h:390:8: error: private field 'HasFRMRoundModeOp' is not used [-Werror,-Wunused-private-field]
  bool HasFRMRoundModeOp;
       ^
1 error generated.

19 months agoRevert "[Support] Move StringExtras.h include from Error.h to Error.cpp"
Elliot Goodrich [Thu, 13 Jul 2023 08:07:14 +0000 (09:07 +0100)]
Revert "[Support] Move StringExtras.h include from Error.h to Error.cpp"

This reverts commit 5be8c89ed6d959d57ae21c168dc4215ce0d05553.

19 months ago[IR] Partially remove pointer element types from intrinsic signatures (NFC)
Nikita Popov [Wed, 12 Jul 2023 14:05:28 +0000 (16:05 +0200)]
[IR] Partially remove pointer element types from intrinsic signatures (NFC)

As typed pointers are no longer supported, we should no longer
specify element types in intrinsic signatures.

The only meaningful pointer types are now:

    llvm_ptr_ty -> ptr
    llvm_anyptr_ty -> ptr addrspace(any)
    LLVMQualPointerType<N> -> ptr addrspace(N)

This is only "partially" because we also have a bunch of special
IIT descriptors like LLVMPointerTo, LLVMPointerToElt and
LLVMAnyPointerToElt, which I'll leave for a later revision.

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

19 months ago[8/8][RISCV] Add rounding mode control variant for vfredosum, vfredusum, vfwredosum...
eopXD [Thu, 6 Jul 2023 17:48:58 +0000 (10:48 -0700)]
[8/8][RISCV] Add rounding mode control variant for vfredosum, vfredusum, vfwredosum, vfwredusum

Depends on D154635

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

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

Reviewed By: craig.topper

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

19 months ago[7/8][RISCV] Add rounding mode control variant for conversion intrinsics between...
eopXD [Thu, 6 Jul 2023 15:11:46 +0000 (08:11 -0700)]
[7/8][RISCV] Add rounding mode control variant for conversion intrinsics between floating-point and integer

Depends on D154634

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

This is the 7th patch of the patch-set. This patch includes change to
vfcvt_x_f, vfcvt_xu_f, vfwcvt_x_f, vfwcvt_xu_f, vfncvt_x_f, vfncvt_xu_f
vfcvt_f_x, vfcvt_f_xu, vfncvt_f_x vfncvt_f_xu, vfncvt_f_f

Reviewed By: craig.topper

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