platform/upstream/llvm.git
16 months ago[Orc] Use new pass manager in example
Nikita Popov [Tue, 28 Feb 2023 15:51:06 +0000 (16:51 +0100)]
[Orc] Use new pass manager in example

Invoke InstCombine via the new pass manager, instead of the
legacy pass manager.

16 months ago[SLP]Fix PR61050: Assertion `I->use_empty() && "trying to erase instruction with...
Alexey Bataev [Tue, 28 Feb 2023 14:56:25 +0000 (06:56 -0800)]
[SLP]Fix PR61050: Assertion `I->use_empty() && "trying to erase instruction with users."

When gathering the counter for the reused scalars, need to use reduced
value, not the original reduced value. Same values counter is gathered
for reduced values, not original ones.

16 months ago[Flang] Fix ALLOCATE with MOLD for scalars
Peter Steinfeld [Fri, 24 Feb 2023 22:40:20 +0000 (14:40 -0800)]
[Flang] Fix ALLOCATE with MOLD for scalars

When we allocate a variable using a MOLD argument, the function that
applies the type of the MOLD argument first checks to see if the
variable is already allocated by looking at its descriptor.  But in the
case of allocating a scalar, the descriptor was not yet been created and
the associated memory is uninitialized.  This change fixes that.

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

16 months ago[clang][dataflow] unnamed bitfields should be discarded in InitListExpr
Paul Semel [Mon, 27 Feb 2023 18:15:39 +0000 (18:15 +0000)]
[clang][dataflow] unnamed bitfields should be discarded in InitListExpr

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

16 months ago[C++20] [Modules] Trying to compare the trailing require clause from the primary...
Chuanqi Xu [Tue, 28 Feb 2023 15:14:51 +0000 (23:14 +0800)]
[C++20] [Modules] Trying to compare the trailing require clause from the primary template function

Close https://github.com/llvm/llvm-project/issues/60890.

For the following example:

```
export module a;

export template<typename T>
struct a {
friend void aa(a) requires(true) {
}
};
```

```
export module b;

import a;

struct b {
a<int> m;
};
```

```
export module c;

import a;

struct c {
void f() const {
aa(a<int>());
}
};
```

```
import a;
import b;
import c;

void d() {
aa(a<int>());
}
```

The current clang will reject this incorrectly. The reason is that the
require clause  will be replaced with the evaluated version
(https://github.com/llvm/llvm-project/blob/efae3174f09560353fb0f3d528bcbffe060d5438/clang/lib/Sema/SemaConcept.cpp#L664-L665).
In module 'b', the friend function is instantiated but not used so the
require clause of the friend function is `(true)`. However, in module
'c', the friend function is used so the require clause is `true`. So
deserializer classify these two function to two different functions
instead of one. Then here is the bug report.

The proposed solution is to try to compare the trailing require clause
of the primary template when performing ODR checking.

Reviewed By: erichkeane

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

16 months ago[clang][Interp][NFC] Clean up InterpState.cpp
Timm Bäder [Mon, 6 Feb 2023 14:23:39 +0000 (15:23 +0100)]
[clang][Interp][NFC] Clean up InterpState.cpp

Remove unused includes, an unused using alias and braces in single-line
if statements.

16 months ago[flang] lower hlfir.transpose into fir runtime call
Tom Eccles [Tue, 28 Feb 2023 15:21:00 +0000 (15:21 +0000)]
[flang] lower hlfir.transpose into fir runtime call

Depends on D144881

Reviewed By: jeanPerier

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

16 months ago[flang] lower transpose intrinsic to hlfir.transpose operation
Tom Eccles [Mon, 27 Feb 2023 14:31:39 +0000 (14:31 +0000)]
[flang] lower transpose intrinsic to hlfir.transpose operation

Depends on D144880

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

16 months ago[flang] add hlfir.transpose operation
Tom Eccles [Mon, 27 Feb 2023 13:49:29 +0000 (13:49 +0000)]
[flang] add hlfir.transpose operation

Add a HLFIR operation for the TRANSPOSE transformational intrinsic,
according to the design set out in flang/doc/HighLevelFIR.md

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

16 months ago[clang][Interp][NFC] Use qualified name in Function::getName()
Timm Bäder [Thu, 16 Feb 2023 07:22:26 +0000 (08:22 +0100)]
[clang][Interp][NFC] Use qualified name in Function::getName()

16 months ago[InstCombine] use demanded vector elements to eliminate partially redundant instructions
Sanjay Patel [Tue, 28 Feb 2023 14:15:24 +0000 (09:15 -0500)]
[InstCombine] use demanded vector elements to eliminate partially redundant instructions

In issue #60632, we have vector math ops that differ because an
operand is shuffled, but the math has limited demanded elements,
so it can be replaced by another instruction:
https://alive2.llvm.org/ce/z/TKqq7H

I don't think we have anything like this yet - it's like a
CSE/GVN fold, but driven by demanded elements of a vector op.
This is limited to splat-0 as a first step to keep it simple.

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

16 months ago[flang] Allow `to` argument of move_alloc to be class(*)
David Truby [Tue, 28 Feb 2023 14:32:37 +0000 (14:32 +0000)]
[flang] Allow `to` argument of move_alloc to be class(*)

This patch expands the runtime check in move_alloc to allow the
destination to be unlimited polymorphic.

Reviewed By: clementval

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

16 months ago[CGProfile] Don't fetch BFI without profile (NFCI)
Nikita Popov [Tue, 28 Feb 2023 13:49:38 +0000 (14:49 +0100)]
[CGProfile] Don't fetch BFI without profile (NFCI)

Don't fetch BFI if the function has no entry count. Peculiarly,
the implementation was already doing this for the (no longer
existing) legacy PM implementation, but the same principle applies
to the new pass manager. The only reason why the new PM doesn't
have LazyBFI is that with the new pass manager all passes are
lazy.

This improves compile-time for non-PGO builds.

16 months ago[flang][hlfir] Support type descriptor for initialized character component
Jean Perier [Tue, 28 Feb 2023 14:15:29 +0000 (15:15 +0100)]
[flang][hlfir] Support type descriptor for initialized character component

These compiler generated component descriptor include designators packaged
as CLASS(*) for simplicity. HLFIR hit an assert in an std::get trying to
recover an Expr<SomeChar> while translating the expression type.
Use the dynamic type of the CLASS(*) expr in that case to recover the
compiler length.

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

16 months ago[libc++][spaceship] Implement `operator<=>` for `list`
Adrian Vogelsgesang [Sat, 20 Aug 2022 20:27:32 +0000 (13:27 -0700)]
[libc++][spaceship] Implement `operator<=>` for `list`

Implements part of P1614R2 "The Mothership has Landed"

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

16 months ago[AArch64][SME2] Add multi-vector uunpk and sunpk intrinsics
David Sherwood [Tue, 31 Jan 2023 09:39:06 +0000 (09:39 +0000)]
[AArch64][SME2] Add multi-vector uunpk and sunpk intrinsics

This patch adds the LLVM IR intrinsics for the following:

* uunpk (2 and 4 vectors)
* sunpk (2 and 4 vectors)

I have named the tests sve2p1-intrinsics-* because although
the instructions are added as part of the SME2 feature they
only operate on SVE vectors.

NOTE: These intrinsics are still in development and are subject to future changes.

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

16 months ago[CGProfile] Remove unnecessary analysis callbacks (NFC)
Nikita Popov [Tue, 28 Feb 2023 13:49:38 +0000 (14:49 +0100)]
[CGProfile] Remove unnecessary analysis callbacks (NFC)

These were used to abstract between NewPM and LegacyPM. Now that
the LegacyPM implementation is gone, we can fetch the analyses
directly from the FAM.

16 months ago[LoopSink] Don't fetch analyses without profile data (NFCI)
Nikita Popov [Tue, 28 Feb 2023 13:21:46 +0000 (14:21 +0100)]
[LoopSink] Don't fetch analyses without profile data (NFCI)

The loop sink pass only does something if the function has
profile data. Move the check for that before analyses are fetched,
to avoid computing things like BFI or MSSA unnecessarily.

16 months ago[flang] Use unsigned to avoid comparison warning
Valentin Clement [Tue, 28 Feb 2023 13:26:43 +0000 (14:26 +0100)]
[flang] Use unsigned to avoid comparison warning

16 months ago[mlir][Linalg] Refactor HoistPadding and add support for hoisting in the absence...
Nicolas Vasilache [Mon, 27 Feb 2023 09:28:56 +0000 (01:28 -0800)]
[mlir][Linalg] Refactor HoistPadding and add support for hoisting in the absence of packing loops.

This revision cleans up the implementation of hoist padding and extends it to also work in the
absence of packing loops.
This allows better composition when hoisting the padded result of a DPS operation.

A systematic usage of RewriterBase is applied to the implementation.

Depends on: D144856

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

16 months ago[LoopVectorize] Only fetch BFI if profile summary available
Nikita Popov [Tue, 28 Feb 2023 10:49:26 +0000 (11:49 +0100)]
[LoopVectorize] Only fetch BFI if profile summary available

BlockFrequencyInfo should generally only be fetched in PGO builds
where a PSI profile summary is available. However, LoopVectorize
was fetching it unconditionally.

This results in a small compile-time improvement for non-PGO builds.

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

16 months ago[flang][hlfir] Support type bound procedure in type descriptors
Jean Perier [Tue, 28 Feb 2023 13:11:39 +0000 (14:11 +0100)]
[flang][hlfir] Support type bound procedure in type descriptors

In hlfir, procedure designators are propagated as fir.box_proc.
Derived type descriptors are compiler generated constant structure
constructors. They contain CFPTR components for the type bound
procedure addresses.
Before being cast to an integer type so that they can be stored
in the CFPTR components, the fir.box_proc addresses must be
obtained with a fir.box_addr.

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

16 months ago[flang][hlfir] Lower parent component references
Jean Perier [Tue, 28 Feb 2023 13:09:27 +0000 (14:09 +0100)]
[flang][hlfir] Lower parent component references

Skip the parent components when they are not at the end of
designators.
Generate an hlfir.parent_comp for parent component at the end
of designators.

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

16 months ago[flang][hlfir] Add hlfir.parent_comp for leaf parent component references
Jean Perier [Tue, 28 Feb 2023 13:08:08 +0000 (14:08 +0100)]
[flang][hlfir] Add hlfir.parent_comp for leaf parent component references

In Fortran, it is possible to refer to the "parent part" of a derived
type as if it were a component:

```Fortran
type t1
 integer :: i
end type
type t2
 integer :: j
end type
type(t2) :: a
  print *, a%t1%i ! "inner" parent component reference
  print *, a%t1   ! "leaf" parent component reference
end
```

Inner parent component references can be dropped on the floor in
lowering: "a%t1%i" is equivalent to "a%i".
Leaf parent component references, however, must be taken care of. For
scalars, "a%t1" is a simple addressc ast to "t1", for arrays, however,
this creates an array section that must be represented with a descriptor
(fir.box).

hlfir.designate could have been extended to deal with this, but I think
it would make hlfir.designate too complex and hard to manipulate.

This patch adds an hlfir.parent_comp op that represents and implements
leaf parent component references.

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

16 months ago[flang] Fix potential segfault in PointerAssociateRemapping
Valentin Clement [Tue, 28 Feb 2023 13:01:10 +0000 (14:01 +0100)]
[flang] Fix potential segfault in PointerAssociateRemapping

The bounds descriptor passed to the function is an array of [2, newRank]
size. Update the code so the rank is retrieved from the second dimension
and not the rank of the descriptor directly as it will be 2 in any case.

Reviewed By: jeanPerier

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

16 months ago[AMDGPU][AsmParser] Distinguish literal and modifier SMEM offsets.
Ivan Kosarev [Tue, 28 Feb 2023 12:48:10 +0000 (12:48 +0000)]
[AMDGPU][AsmParser] Distinguish literal and modifier SMEM offsets.

Reviewed By: foad

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

16 months ago[LV] Reland testcase in 0ec4cae
sgokhale [Tue, 28 Feb 2023 12:44:18 +0000 (18:14 +0530)]
[LV] Reland testcase in 0ec4cae

16 months ago[OpenMP][AMDGPU] More detail in AMDGPU kernel launch info
JP Lehr [Tue, 28 Feb 2023 12:15:22 +0000 (07:15 -0500)]
[OpenMP][AMDGPU] More detail in AMDGPU kernel launch info

Makes the info that is printed for kernel launches configurable for
different plugins. Adds all machinery to print the detailed launch
info that the current AMD plugin provides and includes e.g. register
spill counts.

The files msgpack.cpp, msgpack.def, and msgpack.h are copied from the old plugin
and are untouched. The contents of UtilitiesHSA.cpp and .h are copied together from
various files from the old plugin. The code was originally written by
Jon Chesterfield. I updated the function and type names visible to the outside, i.e.
in headers, to respect the LLVM conventions.

Reviewed By: jhuber6

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

16 months ago[LV] Modify test case for commit 4f9a544
sgokhale [Tue, 28 Feb 2023 12:37:36 +0000 (18:07 +0530)]
[LV] Modify test case for commit 4f9a544

Was observing test failure. Relanding the test

16 months agoRevert "[mlir][linalg] Vectorize tensor.extract using contiguous loads"
Benjamin Kramer [Tue, 28 Feb 2023 12:22:10 +0000 (13:22 +0100)]
Revert "[mlir][linalg] Vectorize tensor.extract using contiguous loads"

This reverts commit 89b144ece330b363713bec369d2d89dc85f715f5. See
https://reviews.llvm.org/D141998 for a test case where this goes wrong.

16 months ago[flang] Change COUNT intrinsic to support different kind logicals
Sacha Ballantyne [Tue, 28 Feb 2023 11:56:23 +0000 (11:56 +0000)]
[flang] Change COUNT intrinsic to support different kind logicals

Previously COUNT would cast the mask input to logical<4> before passing it
to the runtime function, this has been changed to allow different types of logical.

Reviewed By: tblah

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

16 months ago[AMDGPU][NFC] Eliminate the u32imm operand definition.
Ivan Kosarev [Tue, 28 Feb 2023 11:50:50 +0000 (11:50 +0000)]
[AMDGPU][NFC] Eliminate the u32imm operand definition.

It is only used to infer the types of offset parameters in isel patterns,
which we can specify directly.

Reviewed By: piotr

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

16 months ago[SCEV][NFC] Introduce utility function to get power of 2
dbakunevich [Mon, 20 Feb 2023 12:18:03 +0000 (19:18 +0700)]
[SCEV][NFC] Introduce utility function to get power of 2

The new function has been added to SCEV that allows to raise the number 2
to the desired power.

Authored-by: Dmitry Bakunevich
Differential Revision: https://reviews.llvm.org/D144381

16 months ago[LV] Reland "Update logic for calculating register usage due to invariants"
sgokhale [Tue, 28 Feb 2023 12:02:39 +0000 (17:32 +0530)]
[LV] Reland "Update logic for calculating register usage due to invariants"

Previously, while calculating register usage due to invariants, it was assumed that invariant would always be part of widening
instructions. This resulted in calculating vector register types for vectors which cant be legalized(check the newly added test for more details).

An invariant might not always need a vector register. For e.g., invariant might just be used for iteration check.

This patch checks if the invariant is part of any widening instruction and considers register usage accordingly. Fixes issue 60493

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

16 months ago[mlir][Linalg] Refactor transform.structured.pad to separate out hoisting
Nicolas Vasilache [Fri, 24 Feb 2023 11:59:08 +0000 (03:59 -0800)]
[mlir][Linalg] Refactor transform.structured.pad to separate out hoisting

Depends on: D144717

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

16 months ago[mlir][Linalg] NFC - Apply cleanups to transforms
Nicolas Vasilache [Fri, 24 Feb 2023 11:05:41 +0000 (03:05 -0800)]
[mlir][Linalg] NFC - Apply cleanups to transforms

Depends on: D144656

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

16 months ago[Clang] Do not emit exception diagnostics from coroutines and coroutine lambdas
Deniz Evrenci [Tue, 28 Feb 2023 10:36:46 +0000 (11:36 +0100)]
[Clang] Do not emit exception diagnostics from coroutines and coroutine lambdas

All exceptions thrown in coroutine bodies are caught and
unhandled_exception member of the coroutine promise type is called.
In accordance with the existing rules of diagnostics related to
exceptions thrown in functions marked noexcept, even if the promise
type's constructor, get_return_object, or unhandled_exception
throws, diagnostics should not be emitted.

Fixes #48797.

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

16 months ago[GlobalOpt] Split CleanupPointerRootUsers test with constant exprs.
Florian Hahn [Tue, 28 Feb 2023 10:40:36 +0000 (11:40 +0100)]
[GlobalOpt] Split CleanupPointerRootUsers test with constant exprs.

Split tests for D144468. Adding a test with an icmp constant expression
stopped CleanupPointerRootUsers from being called. Move it to a
separate test.

16 months ago[CHR] Do not fetch BFI without profile summary (NFCI)
Nikita Popov [Tue, 28 Feb 2023 09:17:03 +0000 (10:17 +0100)]
[CHR] Do not fetch BFI without profile summary (NFCI)

Do not compute BFI if PGO is not used. This addresses the
compile-time regression from https://reviews.llvm.org/D144769.

16 months agoRevert "[LV] Update logic for calculating register usage due to invariants"
sgokhale [Tue, 28 Feb 2023 10:16:59 +0000 (15:46 +0530)]
Revert "[LV] Update logic for calculating register usage due to invariants"

Observing test failure for llvm/test/Transforms/LoopVectorize/AArch64/reg-usage.ll

This reverts commit d1628266946fdddb44bdad2b3ccf3cd5fc769f42.

16 months ago[Local][InstCombine] Handle MD_noundef in combineMetadataCSE
luxufan [Tue, 28 Feb 2023 09:59:02 +0000 (17:59 +0800)]
[Local][InstCombine] Handle MD_noundef in combineMetadataCSE

Reviewed By: nikic

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

16 months ago[LICM][NFC] Don't preserve DT and loop analyzes separately
Max Kazantsev [Tue, 28 Feb 2023 09:16:01 +0000 (16:16 +0700)]
[LICM][NFC] Don't preserve DT and loop analyzes separately

This is already implied by getLoopPassPreservedAnalyses.

Differential Revision: https://reviews.llvm.org/D144860
Reviewed By: nikic, skatkov

16 months ago[GuardWidening] Rename 'isAvailableAt' -> 'canBeHoistedTo' (NFC)
Dmitry Makogon [Tue, 28 Feb 2023 09:21:58 +0000 (16:21 +0700)]
[GuardWidening] Rename 'isAvailableAt' -> 'canBeHoistedTo' (NFC)

This better describes what this method does.

16 months ago[GuardWidening] Make sure widened condition operands are available at insertion point
Dmitry Makogon [Tue, 28 Feb 2023 08:14:37 +0000 (15:14 +0700)]
[GuardWidening] Make sure widened condition operands are available at insertion point

This fixes a possible issue when we could hoist an instruction up to a widenable
condition intrinsic call without making sure its operands are available at
hoisiting point.

Recently insertion point finding algorithm changed a bit, so this availability
check became necessary.

Verifier would crash after we handled the following special case:
  L >u C0 && L >u C1  ->  L >u max(C0, C1),
Previously we would insert the new condition right before the widenable condition
branch where all L operands were available.
Now we may choose the widenable condition intrinsic call as insertion point and it may
happen so that the L operands are computed after the call, so we have to make sure that
L operands are available at the point we want to insert it.

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

16 months ago[mlir] Fix the missing mlir test BUILD.bazel for 3948f0a0b5e5fecddf315b8de321c6a44ee7ff5c
Haojian Wu [Tue, 28 Feb 2023 09:15:28 +0000 (10:15 +0100)]
[mlir] Fix the missing mlir test BUILD.bazel for 3948f0a0b5e5fecddf315b8de321c6a44ee7ff5c

16 months ago[mlir] Port bazel for 3948f0a0b5e5fecddf315b8de321c6a44ee7ff5c
Haojian Wu [Tue, 28 Feb 2023 08:32:30 +0000 (09:32 +0100)]
[mlir] Port bazel for 3948f0a0b5e5fecddf315b8de321c6a44ee7ff5c

16 months ago[mlir][Affine][NFC] Improve FlatAffineValueConstraint dump
Matthias Springer [Mon, 27 Feb 2023 09:37:02 +0000 (10:37 +0100)]
[mlir][Affine][NFC] Improve FlatAffineValueConstraint dump

Improve indentation for better readability.

Before:
```
Domain: 0, Range: 2, Symbols: 2, Locals: 1
5 constraints
(None Value Value Value Local const)
1 1 0 -1 0 0 = 0
0 1 -1 0 0 0 >= 0
0 0 1 -1 2 2 >= 0
0 0 -1 1 -2 -1 >= 0
0 -1 1 0 2 0 >= 0
```

After:
```
Domain: 0, Range: 2, Symbols: 2, Locals: 1
5 constraints
(None Value Value Value Local const)
 1 1 0 -1 0 0 = 0
 0 1 -1 0 0 0 >= 0
 0 0 1 -1 2 2 >= 0
 0 0 -1 1 -2 -1 >= 0
 0 -1 1 0 2 0 >= 0
```

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

16 months ago[Test] Add test exposing hoisting bug in GuardWidening (NFC)
Dmitry Makogon [Tue, 28 Feb 2023 06:30:15 +0000 (13:30 +0700)]
[Test] Add test exposing hoisting bug in GuardWidening (NFC)

It hoits instruction without making sure its operands are
available at hoisiting point.

16 months ago[mlir][llvm] Rename LLVMOpsInterfaces.td to LLVMInterfaces.td (NFC).
Tobias Gysi [Tue, 28 Feb 2023 07:44:57 +0000 (08:44 +0100)]
[mlir][llvm] Rename LLVMOpsInterfaces.td to LLVMInterfaces.td (NFC).

The revision renames LLVMOpsInterfaces.td since the the tablegen file
contains op and type interfaces.

Reviewed By: ftynse, Dinistro

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

16 months ago[InstCombine] Fold signbit test of a pow2 or zero
Jun Zhang [Sat, 25 Feb 2023 06:23:01 +0000 (14:23 +0800)]
[InstCombine] Fold signbit test of a pow2 or zero

(X & X) <  0 --> X == MinSignedC
(X & X) > -1 --> X != MinSignedC

Alive2: https://alive2.llvm.org/ce/z/_J5q3S
Closes: https://github.com/llvm/llvm-project/issues/60957

Signed-off-by: Jun Zhang <jun@junz.org>
Differential Revision: https://reviews.llvm.org/D144777

16 months ago[TableGen] Replace a StringMap keyed by Record name with a DenseMap.
Craig Topper [Tue, 28 Feb 2023 06:33:41 +0000 (22:33 -0800)]
[TableGen] Replace a StringMap keyed by Record name with a DenseMap.

We can use the Record* to uniquely identify the Record without using
its name.

16 months ago[RISCV] Enable preferZeroCompareBranch to optimize branch on zero in codegenprepare
LiaoChunyu [Tue, 28 Feb 2023 06:07:25 +0000 (14:07 +0800)]
[RISCV] Enable preferZeroCompareBranch to optimize branch on zero in codegenprepare

Similar to ARM and SystemZ.

Related Patchs: D101778(preferZeroCompareBranch)
https://reviews.llvm.org/rG9a9421a461166482465e786a46f8cced63cd2e9f   ( == 0 to u< 1)

Reviewed By: craig.topper

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

16 months ago[NFC] Add a test about template pack for C++20 Modules
Chuanqi Xu [Tue, 28 Feb 2023 06:37:08 +0000 (14:37 +0800)]
[NFC] Add a test about template pack for C++20 Modules

I found the issue in a donwstream project. But the case looks fine in
the upstream. Add the test to make sure that it wouldn't happen in the
upstream.

16 months ago[llvm][Uniformity] provide overloads for Instruction* and Value*
Sameer Sahasrabuddhe [Tue, 28 Feb 2023 05:59:19 +0000 (11:29 +0530)]
[llvm][Uniformity] provide overloads for Instruction* and Value*

Uniformity analysis is mainly concerned with the uniformity of values. But it is
sometimes useful to ask if an instruction is uniform, for example, if the
instruction is a terminator. On LLVM IR, every Instruction is a Value, so the
queries like isUniform() need to be overloaded so that the most derived class
always wins.

Reviewed By: ruiling

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

16 months ago[LV] Update logic for calculating register usage due to invariants
sgokhale [Mon, 27 Feb 2023 07:50:52 +0000 (13:20 +0530)]
[LV] Update logic for calculating register usage due to invariants

Previously, while calculating register usage due to invariants, it was assumed that invariant would always be part of widening
instructions. This resulted in calculating vector register types for vectors which cant be legalized(check the newly added test for more details).

An invariant might not always need a vector register. For e.g., invariant might just be used for iteration check.

This patch checks if the invariant is part of any widening instruction and considers register usage accordingly. Fixes issue 60493

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

16 months ago[MLIR] Fix bug in addAffineParallelOpDomain upper bound constraint
Uday Bondhugula [Sun, 26 Feb 2023 14:56:08 +0000 (20:26 +0530)]
[MLIR] Fix bug in addAffineParallelOpDomain upper bound constraint

Fix upper bound constraint addition in addAffineParallelOpDomain; it was
off by one in the case of constants.

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

16 months ago[scudo] Set name for reserved regions in SizeClassAllocator64
Chia-hung Duan [Tue, 28 Feb 2023 03:20:38 +0000 (03:20 +0000)]
[scudo] Set name for reserved regions in SizeClassAllocator64

This improves the readability of address space

Reviewed By: enh

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

16 months ago[AVR] Fix incorrect flags of livein registers when spilling them
Ben Shi [Fri, 24 Feb 2023 03:11:00 +0000 (11:11 +0800)]
[AVR] Fix incorrect flags of livein registers when spilling them

In AVRFrameLowering::spillCalleeSavedRegisters(), when a 16-bit
livein register is spilled, two PUSH instructions are generated
for the higher and lower 8-bit registers. But these two 8-bit
registers are marked as killed in the two PUSH instructions, so
any future use of them will cause a crash.

This patch fixes the above issue by adding the two sub 8-bit
registers to the livein list.

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

Reviewed By: jacquesguan

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

16 months ago[IPO] Remove various legacy passes
Arthur Eubanks [Tue, 28 Feb 2023 03:00:37 +0000 (19:00 -0800)]
[IPO] Remove various legacy passes

These are part of the optimization pipeline, of which the legacy pass manager version is deprecated and being removed.

16 months ago[X86] Fix for offsets of CFA directives
Theodoros Kasampalis [Tue, 28 Feb 2023 02:27:59 +0000 (10:27 +0800)]
[X86] Fix for offsets of CFA directives

`emitPrologue` may insert stack pointer adjustment in tail call optimized functions where the callee argument stack size is bigger than the caller's. In such a case, the adjustment must be taken into account when generating CFA directives.

Reviewed By: pengfei

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

16 months ago[CodeGen] Use LLVM_ATTRIBUTE_UNUSED instead of LLVM_DUMP_METHOD on a raw_ostream...
Craig Topper [Tue, 28 Feb 2023 02:12:18 +0000 (18:12 -0800)]
[CodeGen] Use LLVM_ATTRIBUTE_UNUSED instead of LLVM_DUMP_METHOD on a raw_ostream operator<<.

LLVM_DUMP_METHOD includes ATTRIBUTE_NOINLINE. operator<< isn't
what we normally consider a dump method so it should be ok to inline.

This fixes a warning from gcc that some other declaration for some
other class was inline but this one is noinline. Seems like a bogus
warning from gcc really.

16 months ago[gn build] Port 58ec6e09abe8
LLVM GN Syncbot [Tue, 28 Feb 2023 01:47:13 +0000 (01:47 +0000)]
[gn build] Port 58ec6e09abe8

16 months ago[AArch64] Use isSVESizelessBuiltinType instead of isSizelessBuiltinType in SVE specif...
Craig Topper [Tue, 28 Feb 2023 01:39:50 +0000 (17:39 -0800)]
[AArch64] Use isSVESizelessBuiltinType instead of isSizelessBuiltinType in SVE specific code.

isSizelessBuiltinType includes RISC-V vector and WebAssembly reference
types. This code is not applicable to those types.

16 months ago[OpenMP][FIX] Properly align firstprivate variables
Johannes Doerfert [Mon, 27 Feb 2023 21:31:05 +0000 (13:31 -0800)]
[OpenMP][FIX] Properly align firstprivate variables

The old code didn't actually align the values, and it added padding even
when none was necessary. This approach will pad entries if necessary
and, similar to the struct case, use the host pointer as guidance.

NOTE: This does still not align them as the host has, but it's unclear
      if the user really should use the alignment bits anyway. For now
      this is a reasonable compromise, only if we have host alignment
      information (explicitly not implicitly via the host pointer), we
      could do it completely right without wasting lots of resources for
      >99% of the cases.

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

16 months ago[ADT] Fix definition of `adl_begin`/`adl_end` and `Iter`/`ValueOfRange`
Jakub Kuderski [Tue, 28 Feb 2023 01:25:20 +0000 (20:25 -0500)]
[ADT] Fix definition of `adl_begin`/`adl_end` and `Iter`/`ValueOfRange`

- Make `IterOfRange` and `ValueOfRange` work with types that require
  custom `begin`/`end` functions.
- Allow for `adl_begin`/`adl_end` to be used in constant-evaluated
  contexts.
- Use SFINAE-friendly trailing return type deductions `adl_begin`/`adl_end` so that they are useable in template argument deduction.
- Add missing documentation comments.

This is required for future work in https://reviews.llvm.org/D144503.

Reviewed By: dblaikie, zero9178

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

16 months ago[NFC] [clang] Forward forwarding reference
Chris Cotter [Tue, 28 Feb 2023 01:26:45 +0000 (01:26 +0000)]
[NFC] [clang] Forward forwarding reference

Update function bodies to forward forwarding references.
I spotted this while authoring a clang-tidy tool for CppCoreGuideline F.19

Reviewed By: dblaikie

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

16 months agoDebugInfo: Disable ctor homing for types with only deleted (non copy/move) ctors
David Blaikie [Tue, 28 Feb 2023 00:54:24 +0000 (00:54 +0000)]
DebugInfo: Disable ctor homing for types with only deleted (non copy/move) ctors

Such a type is never going to have a ctor home, and may be used for type
punning or other ways of creating objects.

May be a more generally acceptable solution in some cases compared to
attributing with [[clang::standalone_debug]].

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

16 months agoAdd tests for replacing `{v}unpck{l|h}pd` -> `{v}shufps`; NFC
Noah Goldstein [Tue, 28 Feb 2023 00:22:22 +0000 (18:22 -0600)]
Add tests for replacing `{v}unpck{l|h}pd` -> `{v}shufps`; NFC

Reviewed By: RKSimon

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

16 months agoAdd new pass `X86FixupInstTuning` for fixing up machine-instruction selection.
Noah Goldstein [Thu, 16 Feb 2023 17:57:12 +0000 (11:57 -0600)]
Add new pass `X86FixupInstTuning` for fixing up machine-instruction selection.

There are a variety of cases where we want more control over the exact
instruction emitted. This commit creates a new pass to fixup
instructions after the DAG has been lowered. The pass is only meant to
replace instructions that are guranteed to be interchangable, not to
do analysis for special cases.

Handling these instruction changes in in X86ISelLowering of
X86ISelDAGToDAG isn't ideal, as its liable to either break existing
patterns that expected a certain instruction or generate infinite
loops.

As well, operating as the MachineInstruction level allows us to access
scheduling/code size information for making the decisions.

Currently only implements `{v}permilps` -> `{v}shufps/{v}shufd` but
more transforms can be added.

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

16 months agoAdd tests for replacing `{v}permilps` -> `{v}shufps/{v}pshufd`; NFC
Noah Goldstein [Sat, 25 Feb 2023 03:05:10 +0000 (21:05 -0600)]
Add tests for replacing `{v}permilps` -> `{v}shufps/{v}pshufd`; NFC

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

16 months agoAdding tuning flags for int <-> fp domain switching penalties; NFC
Noah Goldstein [Thu, 16 Feb 2023 17:56:48 +0000 (11:56 -0600)]
Adding tuning flags for int <-> fp domain switching penalties; NFC

Atom
    - No domain switching penalties
Nehalem+
    - No penalty on moves
Haswell+
    - No penalty on moves / shuffles
Skylake+
    - No penality on moves / shuffles / blends

Reviewed By: RKSimon

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

16 months ago[ELF][PPC64] Actually implement --no-power10-stubs
Fangrui Song [Tue, 28 Feb 2023 00:19:13 +0000 (16:19 -0800)]
[ELF][PPC64] Actually implement --no-power10-stubs

When a caller that does not use TOC calls a function, a call stub is needed if
the function may use TOC. --no-power10-stubs avoids PC-relative instructions in
the code sequence.

The --no-power10-stubs=no implementation added in D94627 is wrong.
First, the first instruction incorrectly uses `mflr 0` (instead of `mflr 12`).
Second, for the PLT case, it uses addis+addi with getVA instead of addis+ld with
getGotPltVA.

16 months ago[BOLT][NFC] Simplify BinaryFunction::setTrapOnEntry
Amir Ayupov [Mon, 27 Feb 2023 23:40:45 +0000 (15:40 -0800)]
[BOLT][NFC] Simplify BinaryFunction::setTrapOnEntry

Reviewed By: #bolt, maksfb

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

16 months ago[polly] Remove unnecessary -enable-new-pm flags
Arthur Eubanks [Mon, 27 Feb 2023 23:38:39 +0000 (15:38 -0800)]
[polly] Remove unnecessary -enable-new-pm flags

16 months ago[BOLT][NFC] Log reversing splitting decision
Amir Ayupov [Mon, 27 Feb 2023 23:26:14 +0000 (15:26 -0800)]
[BOLT][NFC] Log reversing splitting decision

Expose log for testing purposes.

Reviewed By: #bolt, maksfb

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

16 months ago[BOLT] Prevent unsetting unknown control flow for split jump table
Amir Ayupov [Mon, 27 Feb 2023 23:21:23 +0000 (15:21 -0800)]
[BOLT] Prevent unsetting unknown control flow for split jump table

In case of a function with unknown control flow but with a single jump
table and a single jump table site, we attempt to match the jump table
and a site and update block successors using jump table targets.
Restrict this behavior for split jump tables which have targets in a
fragment function.

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

Reviewed By: #bolt, rafauler

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

16 months ago[BOLT][NFC] Const-ify analyzeJumpTable
Amir Ayupov [Wed, 22 Feb 2023 06:09:17 +0000 (22:09 -0800)]
[BOLT][NFC] Const-ify analyzeJumpTable

Avoid modifying `BF`, instead set extra output parameter and modify BF in caller
scope.

Reviewed By: #bolt, rafauler

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

16 months ago[BOLT] Change call count output for ICF
Maksim Panchenko [Fri, 24 Feb 2023 23:45:21 +0000 (15:45 -0800)]
[BOLT] Change call count output for ICF

ICF optimization runs multiple passes and the order in which functions
are folded could be dependent on the order they are being processed.
This order is indeterministic as functions are intermediately stored in
std::unordered_map<>. Note that this order is mostly stable, but is not
guaranteed to be and can change e.g. after switching to a different C++
library implementation.

Because the processing (and folding) order is indeterministic, the
previous way of calculating merged function call count could produce
different results.

Change the way we calculate the ICF call count to make it independent of
the function folding/processing order.

Mostly NFC as the output binary should remain the same, the change
affects only the console output.

Reviewed By: yota9

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

16 months ago[mlir][core] Fix ValueRange printing in AsmPrinter
wpmed92 [Mon, 27 Feb 2023 20:51:28 +0000 (12:51 -0800)]
[mlir][core] Fix ValueRange printing in AsmPrinter

The ValueRange printing behaviour of `OpAsmPrinter` and `AsmPrinter` is different, as reported [[ https://github.com/llvm/llvm-project/issues/59334 | here ]]

```
static void testPrint(AsmPrinter &p, Operation *op, ValueRange operands) {
  p << '(' << operands << ')';
}
```
Although the base `AsmPrinter` is passed as the first parameter (and not `OpAsmPrinter`), the code compiles fine. However, instead of the SSA values, the types for the operands will be printed. This is a violation of the Liskov Substitution Principle.
The desired behaviour would be that the above code does not compile. The reason it compiles, is that for the above code, the `TypeRange` version will be selected for the `<<` operator, since `ValueRange` is implicitly converted to `TypeRange`:
```
template <typename AsmPrinterT>
inline std::enable_if_t<std::is_base_of<AsmPrinter, AsmPrinterT>::value,
                        AsmPrinterT &>
operator<<(AsmPrinterT &p, const TypeRange &types) {
  llvm::interleaveComma(types, p);
  return p;
}
```

16 months ago[AArch64][GlobalISel] Legalize G_SHUFFLE_VECTOR with smaller dest size
Vladislav Dzhidzhoev [Tue, 7 Feb 2023 20:32:50 +0000 (21:32 +0100)]
[AArch64][GlobalISel] Legalize G_SHUFFLE_VECTOR with smaller dest size

Legalize G_SHUFFLE_VECTOR having destination vector length smaller than
source vector length by reshaping destination vector.

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

16 months ago[ELF][PPC64] Merge PPC64R12SetupStub and PPC64PCRelPLTStub. NFC
Fangrui Song [Mon, 27 Feb 2023 22:33:18 +0000 (14:33 -0800)]
[ELF][PPC64] Merge PPC64R12SetupStub and PPC64PCRelPLTStub. NFC

PPC64PCRelPLTStub (from D83669) duplicates lot of code from
PPC64R12SetupStub. Just merge them.

Note: PPC64R12SetupStub does not correctly handle long branch to a
non-preemptible non-TOC code.

16 months ago[lld][WebAssembly] Fix handling of mixed strong and weak references
Sam Clegg [Fri, 24 Feb 2023 18:09:07 +0000 (10:09 -0800)]
[lld][WebAssembly] Fix handling of mixed strong and weak references

When adding a undefined symbols to the symbol table, if the existing
reference is weak replace the symbol flags with (potentially) non-weak
binding.

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

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

16 months ago[test] Remove unnecessary -enable-new-pm=0
Arthur Eubanks [Mon, 27 Feb 2023 22:17:24 +0000 (14:17 -0800)]
[test] Remove unnecessary -enable-new-pm=0

16 months ago[LLVMContextImpl] Separate out opaque pointers
Arthur Eubanks [Mon, 27 Feb 2023 19:50:30 +0000 (11:50 -0800)]
[LLVMContextImpl] Separate out opaque pointers

To make the map lookups simpler for opaque pointers and to simplify future typed pointer code removal. No significant compile time wins though.

While we're here, remove the address space 0 optimization for typed pointers.

Reviewed By: nikic

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

16 months ago[BOLT] Fix intermittent crash with instrumentation
Maksim Panchenko [Sun, 26 Feb 2023 02:23:53 +0000 (18:23 -0800)]
[BOLT] Fix intermittent crash with instrumentation

When createInstrumentedIndirectCall() was invoked for tail calls, we
attached annotation instruction twice to the new call instruction.
First in createDirectCall(), and then again while copying over the
metadata operands.

As a result, the annotations were not properly stripped for such calls
before the call to freeAnnotations() in LowerAnnotations pass. That lead
to use-after-free while restoring the offsets with setOffset() call.

Reviewed By: yota9

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

16 months ago[NFC][PGO] Prefix duplicate profile MemOp entry diagnostic with 'warning:'
Matthew Voss [Mon, 27 Feb 2023 22:04:27 +0000 (14:04 -0800)]
[NFC][PGO] Prefix duplicate profile MemOp entry diagnostic with 'warning:'

Adding this prefix will indicate clearly that the compiler doesn't exit
when it hits this diagnostic. Searches for other non-fatal diagnostics
will also be able to find this diagnostic easily.

16 months ago[libc++] Fix "size_t" constants that should be "bool" or "int", and add tests
Arthur O'Dwyer [Thu, 19 Jan 2023 22:10:09 +0000 (17:10 -0500)]
[libc++] Fix "size_t" constants that should be "bool" or "int", and add tests

`is_placeholder`, despite having an "is_" name, actually returns an int:
1 for `_1`, 2 for `_2`, 3 for `_3`, and so on. But it should still be int,
not size_t.

16 months ago[X86] Split off x86-64-v* tuning flags. NFC
Simon Pilgrim [Mon, 27 Feb 2023 21:49:18 +0000 (21:49 +0000)]
[X86] Split off x86-64-v* tuning flags. NFC

Noticed when reviewing D143786, we are currently inheriting the x86-64-v* tuning flags from specific CPUs when really we need these to be a mixture of common traits and tuning to avoid specific severe regressions.

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

16 months ago[libc] use vars in string to num fuzz targets
Michael Jones [Thu, 16 Feb 2023 19:23:44 +0000 (11:23 -0800)]
[libc] use vars in string to num fuzz targets

The string to integer and string to float standalone fuzz targets just
ran the functions and didn't do anything with the output. This was
intentional, since they are intended to be used with sanitizers to
detect buffer overflow bugs. Not using the variables was causing compile
warnings, so this patch adds trivial checks to use the variables.

Reviewed By: sivachandra, lntue

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

16 months agoRevert "[scudo] Only prepare PageMap entry for partial region"
Chia-hung Duan [Mon, 27 Feb 2023 21:12:10 +0000 (21:12 +0000)]
Revert "[scudo] Only prepare PageMap entry for partial region"

This reverts commit 0a0b6fa4fbdf3bdeb300ddd58859f66b714b8bdf.

16 months ago[Bitcode] Remove typed pointer abbreviation
Arthur Eubanks [Mon, 27 Feb 2023 19:29:23 +0000 (11:29 -0800)]
[Bitcode] Remove typed pointer abbreviation

Since typed pointers are deprecated.

Reviewed By: nikic

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

16 months ago[AArch64] Fix a warning
Kazu Hirata [Mon, 27 Feb 2023 20:56:19 +0000 (12:56 -0800)]
[AArch64] Fix a warning

This patch fixes:

  llvm/lib/Target/AArch64/AArch64MIPeepholeOpt.cpp:582:17: error:
  unused variable 'INSvilaneMI' [-Werror,-Wunused-variable]

16 months ago[SPIR-V] Support TargetExtType for SPIR-V builtin types
Michal Paszkowski [Mon, 27 Feb 2023 20:26:09 +0000 (21:26 +0100)]
[SPIR-V] Support TargetExtType for SPIR-V builtin types

This patch adds support for TargetExtType/target(...) representing
SPIR-V builtin types. After D135202, target(...) is the preferred way
for representing SPIR-V builtin types in LLVM IR and the only working
in the opaque pointer mode.

In order to maintain compatibility with LLVM IR generated by older
versions of Clang and LLVM/SPIR-V Translator, pointers-to-opaque-structs
denoting SPIR-V/OpenCL builtin types will be translated to equivalent
SPIR-V target extension types. This translation is only available in the
typed pointer mode (-opaque-pointers=0).

The relevant LIT tests with SPIR-V builtins were converted to use the
new target(...) notation.

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

16 months ago[SLP] Fixes crash in BoUpSLP::isGatherShuffledEntry()
Vasileios Porpodas [Mon, 27 Feb 2023 18:44:14 +0000 (10:44 -0800)]
[SLP] Fixes crash in BoUpSLP::isGatherShuffledEntry()

Crash caused by: 708eb1b96d9a36f9c0182b7d53c492059778fa35

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

16 months ago[AArch64] Avoid using intermediate integer registers for copying between source and...
Nilanjana Basu [Thu, 26 Jan 2023 01:35:31 +0000 (17:35 -0800)]
[AArch64] Avoid using intermediate integer registers for copying between source and destination floating point registers

In post-isel code, there are cases where there were redundant copies from a source FPR to an intermediate GPR in order to copy to a destination FPR. In this patch, we identify these patterns in post-isel peephole optimization and replace them with a direct FPR-to-FPR copy.
One example for this will be the insertion of the scalar result of 'uaddlv' neon intrinsic function into a destination vector. During instruction selection phase, 'uaddlv' result is copied to a GPR, & a vector insert instruction is matched separately to copy the previous result to a destination SIMD&FP register.

Reviewed By: dmgreen

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

16 months ago[Clang] [AVR] Fix USHRT_MAX for 16-bit int.
Daniel Thornburgh [Sun, 6 Feb 2022 13:20:54 +0000 (08:20 -0500)]
[Clang] [AVR] Fix USHRT_MAX for 16-bit int.

For AVR, the definition of USHRT_MAX overflows.

Reviewed By: aaron.ballman, #clang-language-wg

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

16 months ago[clang-format-diff] Correctly parse start-of-file diffs
Tamir Duberstein [Mon, 27 Feb 2023 20:02:51 +0000 (20:02 +0000)]
[clang-format-diff] Correctly parse start-of-file diffs

Handle the case where the diff is a pure removal of lines. Before this
change start_line would end up as 0 which is rejected by clang-format.

Submitting on behalf of @tamird.

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

16 months ago[Pass][CHR] Move ControlHeightReduction to module optimization pipeline
Rong Xu [Mon, 27 Feb 2023 17:51:28 +0000 (09:51 -0800)]
[Pass][CHR] Move ControlHeightReduction to module optimization pipeline

This is a modified version of commit b374423304a8 by
Arthur (https://reviews.llvm.org/D143424).

Here we invoke to the pass independent of PGOOPT. We now check if the
profile is available through the program summary. This ensures CHR is
called in distributed ThinLTO BE compilation (where PGOOPT might not
be created).

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

16 months ago[SCEV] Hoist common cleanup code to function. (NFC)
Florian Hahn [Mon, 27 Feb 2023 19:38:39 +0000 (20:38 +0100)]
[SCEV] Hoist common cleanup code to function. (NFC)

This allows for easier updating of common code in follow-on patches.

Reviewed By: nikic

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

16 months ago[AArch64][GlobalISel] Reorder stack up-adjustment and register copies
Amara Emerson [Mon, 27 Feb 2023 19:02:37 +0000 (11:02 -0800)]
[AArch64][GlobalISel] Reorder stack up-adjustment and register copies

This change reorders the stack up-adjustment and return value copying phases of
machine-ir generation on Aarch64. Doing so prevents a bug observed for fastcc
calls with >8 arguments, where the up-adjustment required from making that call
is placed in the wrong place relative to spill and reloading code.

See: https://github.com/llvm/llvm-project/issues/60972 for full issue
reproduction and context.

Patch contributed by Bruce Collie

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