platform/upstream/llvm.git
23 months ago[X86][AArch64][NFC] Simplify querying used argument registers
Bill Wendling [Thu, 18 Aug 2022 21:52:49 +0000 (14:52 -0700)]
[X86][AArch64][NFC] Simplify querying used argument registers

Registers used for arguments are listed as "live-ins" into the starting
basic block. This means we don't have to go through a potentially
expensive search through all possible argument registers when we only
care about used argument registers.

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

23 months ago[InferAddressSpaces] [AMDGPU] Add inference for flat_atomic intrinsics
jeff [Thu, 28 Jul 2022 18:09:14 +0000 (11:09 -0700)]
[InferAddressSpaces] [AMDGPU] Add inference for flat_atomic intrinsics

Certain address space dependent optimizations, like SeperateConstOffsetFromGEP, assume agreement between the address space of the recursive uses and the address space of the def. If this assumption is invalid, then optimizations may or may not be correct depending on properties of an address space for a given target, the address spaces of recursive uses, and the optimization being done.

This patch infers the previous address space for flat_atomic ptr arguments. As a result, the address spaces of the uses in flat_atomic cases will agree with the address space in recursive defs. If this results in non-flat address space, then isel may infer a different intrinsic. For example, if the result is a flat_atomic using global address space, then it will be lowered to the corresponding global_atomic intrinsic.

Change-Id: Ifcd981709dc2ea94d4acbcb84efe7176593ec8c7

23 months ago[NFC] Precommit test for D132255.
Denis Antrushin [Fri, 19 Aug 2022 17:58:04 +0000 (00:58 +0700)]
[NFC] Precommit test for D132255.

23 months agoRevert "[lldb] [gdb-remote] Include PID in vCont packets if multiprocess" - Part 2
Michael Buch [Fri, 19 Aug 2022 18:31:14 +0000 (19:31 +0100)]
Revert "[lldb] [gdb-remote] Include PID in vCont packets if multiprocess" - Part 2

This reverts commit ccb9d4d4addc2fb2aa94cf776d43d8be35365272.

Reverts the associated tests

23 months ago[X86] Fix znver1 256-bit ALU/Logic/Blend uop counts
Simon Pilgrim [Fri, 19 Aug 2022 18:07:02 +0000 (19:07 +0100)]
[X86] Fix znver1 256-bit ALU/Logic/Blend uop counts

ymm instructions are double pumped on znver1 - noticed while trying to review size-latency costkinds numbers for D132216

Matches AMD 17h SOG / Agner / uops.info

23 months ago[Flang]Fix another way to crash SimplifyIntrinsics
Mats Petersson [Fri, 19 Aug 2022 12:34:48 +0000 (13:34 +0100)]
[Flang]Fix another way to crash SimplifyIntrinsics

Under some conditions, the defining op may be NULL, so
accept that rahter than try to use it and crash!

Adds test to prevent regression

Fixes github issue #57201

Reviewed By: vzakhari

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

23 months ago[NFC] Fix warning in asserts build
Chris Bieneman [Fri, 19 Aug 2022 22:21:49 +0000 (17:21 -0500)]
[NFC] Fix warning in asserts build

When asserts are enabled a warning for implicit conversion from 64-bit to
32-bit integer occurs here.

23 months ago[RISCV] Correct costs for vector ceil/floor/trunc/round
Philip Reames [Fri, 19 Aug 2022 17:37:39 +0000 (10:37 -0700)]
[RISCV] Correct costs for vector ceil/floor/trunc/round

Add vector costs for ceil/floor/trunc/round. As can be seen in the tests, the prior default costs were a significant under estimate of the actual code generated.

These costs are computed by simply generating code with the current backend, and then counting the number of instructions. I discount one vsetvli, and ignore the return.

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

23 months agoRevert "[lldb] [gdb-remote] Include PID in vCont packets if multiprocess"
Michael Buch [Fri, 19 Aug 2022 17:05:04 +0000 (18:05 +0100)]
Revert "[lldb] [gdb-remote] Include PID in vCont packets if multiprocess"

This reverts commit ccb9d4d4addc2fb2aa94cf776d43d8be35365272.

https://reviews.llvm.org/D131758

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

23 months agoMC: make section classification a bit more thorough
Saleem Abdulrasool [Fri, 5 Aug 2022 16:52:03 +0000 (16:52 +0000)]
MC: make section classification a bit more thorough

This does *NOT* change the emitted section flags in any way.  This only
impacts the internal classification of sections.

Extend the section classification in LLVM for ELF targets.  This has one
important change: we now classify sections as text by default rather
than readonly.  This matches the behaviour for GAS better.

Ensure that any section that has a writable attribute set is not treated
as readonly.  We also special case any section named `.debug_` which is
reserved for DWARF as metadata.  In the case none of the attributes are
set (or because no attributes were provided), consult the section name
for classification.  We match the well known names and classify the
section accordingly.  Any remaining section is now classified as text.

This change allows us to classify sections in the MC layer more
precisely which is needed for subsequent changes for handling target
specific behaviour.

Differential Revision: https://reviews.llvm.org/D131270
Reviewed By: @echristo

23 months agoFix MSVC "not all control paths return a value" warning
Simon Pilgrim [Fri, 19 Aug 2022 16:37:26 +0000 (17:37 +0100)]
Fix MSVC "not all control paths return a value" warning

23 months ago[EarlyCSE][ConstantFolding] do not constant fold atan2(+/-0.0, +/-0.0)
Sanjay Patel [Fri, 19 Aug 2022 16:21:11 +0000 (12:21 -0400)]
[EarlyCSE][ConstantFolding] do not constant fold atan2(+/-0.0, +/-0.0)

These may raise an error (set errno) as discussed in the post-commit
comments for D127964, so we can't fold away the call and potentially
alter that behavior.

23 months agoRevert "[lldb] [test] Add synchronization to TestContinue"
Adrian Prantl [Fri, 19 Aug 2022 16:22:19 +0000 (09:22 -0700)]
Revert "[lldb] [test] Add synchronization to TestContinue"

This reverts commit 7aadecae404b8d47aabdd874e9018a76fd4d1ffa.

I'm reverting this commit because it appears to break the green dragon
incremental LLDB bot.

https://reviews.llvm.org/D131758

See LLDB Incremental buildbot: https://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/46215/execution/node/70/log/

23 months agoRevert "[lldb] [test] Disable new CommunicationTests on Windows"
Adrian Prantl [Fri, 19 Aug 2022 16:21:55 +0000 (09:21 -0700)]
Revert "[lldb] [test] Disable new CommunicationTests on Windows"

This reverts commit d38985a36be8b0165787f8893b3d2b0f831d1e83.
because I'm also reverting D131758.

23 months ago[EarlyCSE][ConstantFolding] add tests for atan2 with zero args; NFC
Sanjay Patel [Fri, 19 Aug 2022 16:18:21 +0000 (12:18 -0400)]
[EarlyCSE][ConstantFolding] add tests for atan2 with zero args; NFC

23 months agoFix UB in DIExpression::appendOffset()
Adrian Prantl [Fri, 19 Aug 2022 01:38:52 +0000 (18:38 -0700)]
Fix UB in DIExpression::appendOffset()

The absolute value of 0x8000000000000000 does not fit into an int64_t
and UBSan tells us that by crashing.

rdar://98799670

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

23 months ago[RISCV] Use Triple::isRISCV/isRISCV32/isRISCV64 helps in some places. NFC
Craig Topper [Fri, 19 Aug 2022 15:59:49 +0000 (08:59 -0700)]
[RISCV] Use Triple::isRISCV/isRISCV32/isRISCV64 helps in some places. NFC

Reviewed By: reames

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

23 months ago[analyzer][NFC] Be more descriptive when we replay without inlining
isuckatcs [Fri, 19 Aug 2022 15:50:49 +0000 (17:50 +0200)]
[analyzer][NFC] Be more descriptive when we replay without inlining

This patch adds a ProgramPointTag to the EpsilonPoint created
before we replay a call without inlining.

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

23 months ago[clang][index] Index unresolved member expression as reference
Denis Fatkulin [Fri, 19 Aug 2022 16:00:54 +0000 (19:00 +0300)]
[clang][index] Index unresolved member expression as reference

Unresolved member expressions aren't indexed as references.

Example code:

```
struct Foo {
  template <typename T> void bar(T t);
};
template <typename T> void test(Foo F, T t) {
  F.bar(t); // Not indexed
}
```

Reviewed By: hokein

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

23 months ago[RISCV] Add passthru operand to RISCVISD::SETCC_VL.
Craig Topper [Fri, 19 Aug 2022 15:53:43 +0000 (08:53 -0700)]
[RISCV] Add passthru operand to RISCVISD::SETCC_VL.

Use it to the fix a bug in the fceil/ffloor lowerings. We were
setting the passthru to IMPLICIT_DEF before and using a mask
agnostic policy. This means where the incoming bits in
the mask were 0 they could be anything in the outgoing mask. We
want those bits in the outgoing mask to be 0. This means we need to
pass the input mask as the passthru.

This generates worse code because we are unable to allocate the
v0 register to the output due to an earlyclobber constraint. We
probably need a special TIED pseudoinstruction and probably custom
isel since you can't use V0 twice in the input pattern.

Reviewed By: reames

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

23 months ago[RISCV] Prefer vnsrl.wi v8, v8, 0 over vnsrl.wx v8, v8, x0.
Craig Topper [Fri, 19 Aug 2022 15:15:55 +0000 (08:15 -0700)]
[RISCV] Prefer vnsrl.wi v8, v8, 0 over vnsrl.wx v8, v8, x0.

I have a couple data points that some microarchitectures prefer
the immediate 0 over x0. Does anyone know of microarchitectures
where the opposite is true?

Unfortunately, this is different than the vncvt.x.x.w alias
from the spec. Perhaps the alias was poorly chosen if x0 isn't
as optimal as immediate 0 on all microarchitectures.

Reviewed By: reames

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

23 months ago[SLP]Delay vectorization of postponable values for instructions with no users.
Alexey Bataev [Mon, 15 Aug 2022 17:26:45 +0000 (10:26 -0700)]
[SLP]Delay vectorization of postponable values for instructions with no users.

SLP vectorizer tries to find the reductions starting the operands of the
instructions with no-users/void returns/etc. But such operands can be
postponable instructions, like Cmp, InsertElement or InsertValue. Such
operands still must be postponed, vectorizer should not try to vectorize
them immediately.

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

23 months ago[reland][NFC][libc] rearrange aarch64 memset code to better match new implementation
Guillaume Chatelet [Thu, 18 Aug 2022 09:39:47 +0000 (09:39 +0000)]
[reland][NFC][libc] rearrange aarch64 memset code to better match new implementation

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

23 months ago[mlir][Affine] Add affine.delinearize_index operation
Christopher Bate [Tue, 16 Aug 2022 23:02:18 +0000 (17:02 -0600)]
[mlir][Affine] Add affine.delinearize_index operation

 This change adds a new AffineDelinearizeIndexOp to the affine dialect.
 The operation accepts an index type as well as a basis (array of index
 values) representing how the index should be decomposed into a
 multi-index. The decomposition obeys a canonical semantic that treats
 the final basis element as "fastest varying" and the first basis element
 as "slowest varying". A naive lowering of the operation using a sequence
 of AffineApplyOps is given.

RFC was discussed on discourse here: https://discourse.llvm.org/t/rfc-tensor-extracting-slices-from-tensor-collapse-shape/64034

Reviewed By: bondhugula, nicolasvasilache

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

23 months ago[SLP]Cost for a constant buildvector.
Alexey Bataev [Thu, 2 Jun 2022 14:26:33 +0000 (07:26 -0700)]
[SLP]Cost for a constant buildvector.

In many cases constant buildvector results in a vector load from a
constant/data pool. Need to consider this cost too.

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

23 months agoRevert "[NFC][libc] rearrange aarch64 memset code to better match new implementation"
Guillaume Chatelet [Fri, 19 Aug 2022 15:02:16 +0000 (15:02 +0000)]
Revert "[NFC][libc] rearrange aarch64 memset code to better match new implementation"

This reverts commit 4d931b6e1e7e6003fa6c68aec9223b06e31c982d.

23 months ago[clang][dataflow] Debug string for value kinds.
Wei Yi Tee [Tue, 16 Aug 2022 12:34:42 +0000 (12:34 +0000)]
[clang][dataflow] Debug string for value kinds.

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

23 months ago[pseudo] Start rules are `_ := start-symbol EOF`, improve recovery.
Sam McCall [Fri, 19 Aug 2022 13:53:50 +0000 (15:53 +0200)]
[pseudo] Start rules are `_ := start-symbol EOF`, improve recovery.

Previously we were calling glrRecover() ad-hoc at the end of input.
Two main problems with this:
 - glrRecover() on two separate code paths is inelegant
 - We may have to recover several times in succession (e.g. to exit from
   nested scopes), so we need a loop at end-of-file
Having an actual shift action for an EOF terminal allows us to handle
both concerns in the main shift/recover/reduce loop.

This revealed a recovery design bug where recovery could enter a loop by
repeatedly choosing the same parent to identically recover from.
Addressed this by allowing each node to be used as a recovery base once.

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

23 months ago[NFC][libc] rearrange aarch64 memset code to better match new implementation
Guillaume Chatelet [Thu, 18 Aug 2022 09:39:47 +0000 (09:39 +0000)]
[NFC][libc] rearrange aarch64 memset code to better match new implementation

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

23 months agoMissing tautological compare warnings due to unary operators
Muhammad Usman Shahid [Fri, 19 Aug 2022 14:46:29 +0000 (10:46 -0400)]
Missing tautological compare warnings due to unary operators

The patch mainly focuses on the no warnings for -Wtautological-compare.
It work fine for the positive numbers but doesn't for the negative
numbers. This is because the warning explicitly checks for an
IntegerLiteral AST node, but -1 is represented by a UnaryOperator with
an IntegerLiteral sub-Expr.

Fixes #42918
Differential Revision: https://reviews.llvm.org/D130510

23 months ago[COST][NFC]Introduce OperandValueKind in getMemoryOpCost, NFC.
Alexey Bataev [Fri, 19 Aug 2022 12:13:25 +0000 (05:13 -0700)]
[COST][NFC]Introduce OperandValueKind in getMemoryOpCost, NFC.

Added OperandValueKind OpdInfo parameter to getMemoryOpCost functions to
better estimate cost with immediate values.

Part of D126885.

23 months ago[lldb] [test] Disable new CommunicationTests on Windows
Michał Górny [Fri, 19 Aug 2022 14:22:55 +0000 (16:22 +0200)]
[lldb] [test] Disable new CommunicationTests on Windows

Sponsored by: The FreeBSD Foundation

23 months ago[clang][Interp] Rename Integral::T to Integral::ReprT
Timm Bäder [Fri, 19 Aug 2022 14:13:46 +0000 (16:13 +0200)]
[clang][Interp] Rename Integral::T to Integral::ReprT

Just 'T' is a bit generic and causes confusion.

23 months ago[SVE][LoopVectorize][NFC] Tidy up some tests
David Sherwood [Fri, 19 Aug 2022 11:11:27 +0000 (12:11 +0100)]
[SVE][LoopVectorize][NFC] Tidy up some tests

Whilst writing a patch to add extra tail-folding RUN lines to
existing tests I noticed a few areas where they can be
cleaned up a little:

1. scalable-reductions.ll: fmin_fast does not mark fcmp as fast.
2. sve-inductions-unusual-types.ll: remove direct references to
   SSA variable names.
3. sve-strict-fadd-cost.ll: don't force vector width so we see
   costs for different VFs in one go. This will be important for
   the follow-on patch.
4. sve-vector-reverse.ll,vector-reverse-mask4.ll: add noalias
   keyword to simplify IR.
4. sve-widen-gep.ll,sve-widen-phi.ll: regenerate using script.

These changes will make the subsequent patch adding RUN lines much
easier to review!

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

23 months ago[libcxxabi] Fix alignment of pointers returned by fallback_malloc
Simon Tatham [Fri, 19 Aug 2022 14:07:55 +0000 (15:07 +0100)]
[libcxxabi] Fix alignment of pointers returned by fallback_malloc

This aligns the ``heap[]`` array in ``fallback_malloc.cpp`` to ensure
that it can be safely cast to ``heap_node*``, and also adjusts the
allocation algorithm to ensure that every allocated block has the
alignment requested by ``__attribute__((aligned))``, by putting the
block's ``heap_node`` header 4 bytes before an aligned address.

Patch originally by Eric Fiselier: this is an updated version of
D12669, which was never landed.

Reviewed By: ldionne, #libc_abi

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

23 months ago[clang][Interp] Implement inv and neg unary operations
Timm Bäder [Tue, 9 Aug 2022 06:08:48 +0000 (08:08 +0200)]
[clang][Interp] Implement inv and neg unary operations

Implement negating and inverting values. Also implement
IntegralToBoolean casts so the operations are easier to test.

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

23 months ago[Test] Add test for miscompile described in PR57247
Max Kazantsev [Fri, 19 Aug 2022 13:51:57 +0000 (20:51 +0700)]
[Test] Add test for miscompile described in PR57247

23 months agoRevert "[SCEV] Prove condition invariance via context"
Max Kazantsev [Fri, 19 Aug 2022 13:51:06 +0000 (20:51 +0700)]
Revert "[SCEV] Prove condition invariance via context"

This reverts commit a3d1fb3b59b473e4f262a05f187de6474b7721e7.

Reverting until investigation of https://github.com/llvm/llvm-project/issues/57247
has concluded.

23 months agoRevert "Revert "[compiler-rt] Fix check for cross-compiling""
Ellis Hoag [Fri, 19 Aug 2022 13:46:22 +0000 (06:46 -0700)]
Revert "Revert "[compiler-rt] Fix check for cross-compiling""

This reverts commit 18f6b05e0a5a4197bac787f5522669576c134869.

This is a reland of https://reviews.llvm.org/D132130 which I incorrectly
thought had broken the builds.

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

23 months ago[pseudo] NFC, remove redundant ;
Haojian Wu [Fri, 19 Aug 2022 13:53:16 +0000 (15:53 +0200)]
[pseudo] NFC, remove redundant ;

23 months ago[lldb] [test] Add synchronization to TestContinue
Michał Górny [Fri, 19 Aug 2022 13:49:35 +0000 (15:49 +0200)]
[lldb] [test] Add synchronization to TestContinue

Sponsored by: The FreeBSD Foundation

23 months ago[lldb] [Core] Harmonize Communication::Read() returns w/ thread
Michał Górny [Fri, 19 Aug 2022 10:30:50 +0000 (12:30 +0200)]
[lldb] [Core] Harmonize Communication::Read() returns w/ thread

Harmonize the status and error values of Communication::Read() when
running with and without read thread.  Prior to this change, Read()
would return eConnectionStatusSuccess if read thread was enabled
and the read timed out or reached end-of-file, rather than
the respective states that are returned if read thread was disabled.
Now, it correctly returns eConnectionStatusTimedOut
and eConnectionStatusEndOfFile, and sets the error respectively.

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.llvm.org/D132217

23 months ago[libc++][NFC] Rename the constexpr macros
Nikolas Klauser [Fri, 19 Aug 2022 11:08:01 +0000 (13:08 +0200)]
[libc++][NFC] Rename the constexpr macros

This was discussed on Discord with the consensus that we should rename the macros.

Reviewed By: ldionne, Mordante, var-const, avogelsgesang, jloser, #libc

Spies: libcxx-commits

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

23 months ago[Sema] Tweak diagnostic logic so suppress-in-header logic works in tools too.
Sam McCall [Wed, 13 Jul 2022 14:27:36 +0000 (16:27 +0200)]
[Sema] Tweak diagnostic logic so suppress-in-header logic works in tools too.

Certain idioms are ignored by -Wunused in header files only.
The current "is a header" check assumes that if headers are the main file, we're
building a PCH or a module or something. However in tools we may be parsing the
header in its own right, but still want to treat it as a header.

Fixes https://github.com/clangd/vscode-clangd/issues/360

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

23 months ago[pseudo] Changes omitted from previous commit
Sam McCall [Fri, 19 Aug 2022 13:15:37 +0000 (15:15 +0200)]
[pseudo] Changes omitted from previous commit

23 months ago[pseudo] Perform unconstrained reduction prior to recovery.
Sam McCall [Fri, 19 Aug 2022 13:00:59 +0000 (15:00 +0200)]
[pseudo] Perform unconstrained reduction prior to recovery.

Our GLR uses lookahead: only perform reductions that might be consumed by the
shift immediately following. However when shift fails and so reduce is followed
by recovery instead, this restriction is incorrect and leads to missing heads.

In turn this means certain recovery strategies can't be made to work. e.g.
```
ns := NAMESPACE { namespace-body } [recover=Skip]
ns-body := namespace_opt
```
When `namespace { namespace {` is parsed, we can recover the inner `ns` (using
the `Skip` strategy to ignore the missing `}`). However this `namespace` will
not be reduced to a `namespace-body` as EOF is not in the follow-set, and so we
are unable to recover the outer `ns`.

This patch fixes this by tracking which heads were produced by constrained
reduce, and discarding and rebuilding them before performing recovery.

This is a prerequisite for the `Skip` strategy mentioned above, though there are
some other limitations we need to address too.

Reviewed By: hokein

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

23 months ago[clangd] Support hover on __func__ etc (PredefinedExpr)
Sam McCall [Fri, 19 Aug 2022 12:51:36 +0000 (14:51 +0200)]
[clangd] Support hover on __func__ etc (PredefinedExpr)

Expose these as variables as that's what the standard calls them (and D131175).

To make this work, we also fix a bug in SelectionTree: PredefinedExpr has
an implicit/invisible StringLiteral, and SelectionTree should not traverse
implicit things.

Reviewed By: ckandeler

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

23 months agoAdd guidance for what to put in community calendar invites
Kristof Beyls [Thu, 18 Aug 2022 12:58:05 +0000 (14:58 +0200)]
Add guidance for what to put in community calendar invites

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

23 months ago[PowerPC] Fix bugs in sign-/zero-extension elimination
Stefan Pintilie [Tue, 16 Aug 2022 16:08:33 +0000 (11:08 -0500)]
[PowerPC] Fix bugs in sign-/zero-extension elimination

This patch fixes the following two bugs in `PPCInstrInfo::isSignOrZeroExtended` helper, which is used from sign-/zero-extension elimination in PPCMIPeephole pass.
- Registers defined by load with update (e.g. LBZU) were identified as already sign or zero-extended. But it is true only for the first def (loaded value) and not for the second def (i.e. updated pointer).
- Registers defined by ORIS/XORIS were identified as already sign-extended. But, it is not true for sign extension depending on the immediate (while it is ok for zero extension).

To handle the first case, the parameter for the helpers is changed from `MachineInstr` to a register number to distinguish first and second defs. Also, this patch moves the initialization of PPCMIPeepholePass to allow mir test case.

Reviewed By: nemanjai

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

23 months ago[Clang][AArch64] Use generic extract/insert vector for svget/svset/svcreate tuples
Caroline Concatto [Wed, 10 Aug 2022 07:13:15 +0000 (08:13 +0100)]
[Clang][AArch64] Use generic extract/insert vector for svget/svset/svcreate tuples

This patch replaces svget, svset and svcreate aarch64 intrinsics for tuple
types with the generic llvm-ir intrinsics extract/insert vector

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

23 months ago[gn build] Port c74c17f37aa9
Nico Weber [Fri, 19 Aug 2022 11:45:06 +0000 (07:45 -0400)]
[gn build] Port c74c17f37aa9

23 months agoRevert "[gn build] port f7a33090a910"
Nico Weber [Fri, 19 Aug 2022 11:40:45 +0000 (07:40 -0400)]
Revert "[gn build] port f7a33090a910"

This reverts commit d3a1dbc4907b59690f9013cdb6221573ca4233f1.
f7a33090a910 was reverted in e941b031d316.

23 months ago[lldb] Use WSAEventSelect for MainLoop polling on windows
Pavel Labath [Thu, 4 Aug 2022 09:26:36 +0000 (11:26 +0200)]
[lldb] Use WSAEventSelect for MainLoop polling on windows

This patch switches the MainLoop class to use the WSAEventSelect
mechanism to wait for multiple sockets to become readable. The
motivation for doing that is that this allows us to wait for other kinds
of events as well (as long as they can be converted to WSAEvents). This
will allow us to avoid (abstract away) pipe-based multiplexing
mechanisms in the generic code, since pipes cannot be combined with
sockets on windows.

Since the windows implementation will now look completely different than
the posix (file descriptor-based) implementations, I have split the
MainLoop class into two (MainLoopPosix and MainLoopWindows), with the
common code going into MainLoopBase.

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

23 months agoAdd support for specifying the severity of a SARIF Result
Vaibhav Yenamandra [Fri, 19 Aug 2022 11:13:44 +0000 (07:13 -0400)]
Add support for specifying the severity of a SARIF Result

* Extend SarifResult with level property, and allow rule configuration
* Create SarifReportingConfiguration which allow configuring rules with
a default priority, severity and an enable-toggle
* Support for setting the level property[1] of a result.

If unset, it defaults to "warning", which is the result of an empty
default configuration on rules[2]

[1]: https://docs.oasis-open.org/sarif/sarif/v2.1.0/os/sarif-v2.1.0-os.html#_Toc34317648
[2]: https://docs.oasis-open.org/sarif/sarif/v2.1.0/os/sarif-v2.1.0-os.html#_Toc34317855

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

23 months ago[InstCombine] For vector extract when extract vector and insert value type is the...
Caroline Concatto [Fri, 19 Aug 2022 11:08:14 +0000 (12:08 +0100)]
[InstCombine] For vector extract when extract vector and insert value type is the same

This patch has implements these optimizations:

 extract.vector(insert.vector(Vector, Value, Idx), Idx) --> Value

 extract.vector(insert.vector(Vector, Value, InsertIndex), ExtractIndex)
  --> extract.vector(Vector, ExtractIndex)

Reviewed By: sdesmalen

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

23 months ago[AMDGPU][MC][GFX9][NFC] Split large test file
Dmitry Preobrazhensky [Fri, 19 Aug 2022 11:01:42 +0000 (14:01 +0300)]
[AMDGPU][MC][GFX9][NFC] Split large test file

Split gfx9_dasm_all.txt by instruction encoding.

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

23 months ago[AMDGPU][MC][GFX8][NFC] Split large test file
Dmitry Preobrazhensky [Fri, 19 Aug 2022 10:51:55 +0000 (13:51 +0300)]
[AMDGPU][MC][GFX8][NFC] Split large test file

Split gfx8_dasm_all.txt by instruction encoding.

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

23 months ago[NFC][OpenMP] Add test for simd directive with nested loop
Dominik Adamski [Fri, 19 Aug 2022 10:00:02 +0000 (05:00 -0500)]
[NFC][OpenMP] Add test for simd directive with nested loop

This test is follow up of the review: https://reviews.llvm.org/D131402

Co-Author of the patch: Kiran Chandramohan

Reviewed By: kiranchandramohan

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

23 months ago[Clang][AArch64] Replace aarch64_sve_ldN intrinsic by aarch64_sve_ldN.sret
Caroline Concatto [Thu, 11 Aug 2022 11:09:58 +0000 (12:09 +0100)]
[Clang][AArch64] Replace aarch64_sve_ldN intrinsic by aarch64_sve_ldN.sret

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

23 months ago[clang,flang] Add help text for -fsyntax-only
Alexander Malkov [Fri, 19 Aug 2022 09:53:27 +0000 (09:53 +0000)]
[clang,flang] Add help text for -fsyntax-only

Fix for the problem with displaying options `-fsyntax-only` in clang and flang-new in help
Fix https://github.com/llvm/llvm-project/issues/57033

Before:
``` $ clang  -help | grep syntax
  -objcmt-migrate-property-dot-syntax
         Enable migration of setter/getter messages to property-dot syntax
```
After:
```
 $ clang -help | grep syntax
  -fsyntax-only           Run the preprocessor, parser and semantic analysis stages
  -objcmt-migrate-property-dot-syntax
         Enable migration of setter/getter messages to property-dot syntax
```

Reviewed By: vzakhari, awarzynski, MaskRay, alexiprof

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

23 months ago[CostModel][X86] Split icmp/fcmp cost kinds tests
Simon Pilgrim [Fri, 19 Aug 2022 09:39:30 +0000 (10:39 +0100)]
[CostModel][X86] Split icmp/fcmp cost kinds tests

It's going to be much easier to maintain these tests (and all the check prefix combinations) if we don't mix cost kinds in the same file.

23 months ago[CostModel][X86] Split select cost kinds tests
Simon Pilgrim [Fri, 19 Aug 2022 09:28:04 +0000 (10:28 +0100)]
[CostModel][X86] Split select cost kinds tests

It's going to be much easier to maintain these tests (and all the check prefix combinations) if we don't mix cost kinds in the same file.

23 months ago[CostModel][X86] Add tremont to slm-arith-costs.ll
Simon Pilgrim [Fri, 19 Aug 2022 09:17:44 +0000 (10:17 +0100)]
[CostModel][X86] Add tremont to slm-arith-costs.ll

Tremont uses the Goldmont div/sqrt costs but we weren't testing for them

23 months ago[CostModel][X86] Cleanup arithmetic test triples
Simon Pilgrim [Fri, 19 Aug 2022 09:09:28 +0000 (10:09 +0100)]
[CostModel][X86] Cleanup arithmetic test triples

Just specify the triple inside the RUN command (to make i686 support much easier!), and consistently use x86_64-- generic triple

23 months ago[libcxx] [test] Mark the libcxx/selftest/remote-substitutions.sh.cpp test as requirin...
Martin Storsjö [Mon, 8 Aug 2022 21:48:22 +0000 (00:48 +0300)]
[libcxx] [test] Mark the libcxx/selftest/remote-substitutions.sh.cpp test as requiring bash in the executor

It's unclear to me why this wasn't tagged this way already in
87fe0709d4ad7c3128f998f14c66245ebb423e4f / D114612 where the
feature flag executor-has-no-bash was added, as this test did exist
in its current form already at that time.

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

23 months ago[libcxx] [test] Make some threading tests more robust
Martin Storsjö [Tue, 9 Aug 2022 08:56:46 +0000 (11:56 +0300)]
[libcxx] [test] Make some threading tests more robust

Increase the timeout tolerance if TEST_IS_EXECUTED_IN_A_SLOW_ENVIRONMENT
is set, similarly to how it's done in a couple other tests.

Use `std::this_thread::yield();` instead of busylooping. When multiple
threads are busylooping, it's plausible that not all threads even get
started running before the timeout runs out.

This makes the threading tests succeed if run in Windows runners on
Github Actions.

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

23 months ago[libcxx] [test] Split the TEST_HAS_SANITIZERS define into TEST_IS_EXECUTED_IN_A_SLOW_...
Martin Storsjö [Tue, 9 Aug 2022 10:51:33 +0000 (13:51 +0300)]
[libcxx] [test] Split the TEST_HAS_SANITIZERS define into TEST_IS_EXECUTED_IN_A_SLOW_ENVIRONMENT

This makes its role clearer. It's plausible that one may want to manually
define TEST_IS_EXECUTED_IN_A_SLOW_ENVIRONMENT when running the tests in
some environments - in particular, it seems to be necessary to use the
higher tolerance timeouts if running the tests on Windows runners
on Github Actions.

Also add the descriptive comment in one file where it was missing.

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

23 months ago[libcxx] [test] Remove --env PATH from the static clangcl config
Martin Storsjö [Tue, 9 Aug 2022 08:36:51 +0000 (11:36 +0300)]
[libcxx] [test] Remove --env PATH from the static clangcl config

The PATH is set in order to be able to find the tested DLL at runtime.
When linking statically, it's not necessary to set the PATH.

Setting PATH in the executor has the downside that it clears the
existing path (it's not prepended/appended to it), which means
that the executed tools can't find other tools - which sets the
executor-has-no-bash flag.

By removing the unnecessary setting of PATH, we have a properly
working bash even when wrapped by the executor, which gets rid
of the executor-has-no-bash flag in this test configuration, which
makes 9 more testcases be executed.

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

23 months ago[clang-tidy] Do not trigger cppcoreguidelines-avoid-const-or-ref-data-members on...
Carlos Galvez [Fri, 12 Aug 2022 14:53:31 +0000 (14:53 +0000)]
[clang-tidy] Do not trigger cppcoreguidelines-avoid-const-or-ref-data-members on lambda captures

Lambdas are implemented as regular classes internally,
and the captured variables end up as members there.
Do not diagnose those - the check should cover only
regular classes and structs.

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

23 months ago[LangRef][VP] Fix typo.
jacquesguan [Fri, 19 Aug 2022 07:59:27 +0000 (15:59 +0800)]
[LangRef][VP] Fix typo.

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

23 months ago[clang][Modules] Fix a regression in handling missing framework headers.
Iain Sandoe [Thu, 18 Aug 2022 13:34:50 +0000 (14:34 +0100)]
[clang][Modules] Fix a regression in handling missing framework headers.

The commit of af2d11b1d5c1508b506825df460656e0151cd3b0 missed a case where
the value of a suggested module needed to be reset to nullptr.  Fixed thus
and added a testcase to cover the circumstance.

23 months ago[AArch64][GISel] Lower llvm.prefetch
Archibald Elliott [Wed, 17 Aug 2022 17:11:58 +0000 (18:11 +0100)]
[AArch64][GISel] Lower llvm.prefetch

This change adds support for lowering llvm.prefetch directly using
GlobalISel. Currently, llvm.prefetch falls back to SelectionDAG.

This Change:
- Adds an AArch64-specific G_PREFETCH generic instruction, to be used
  where AArch64ISD::PREFETCH is used in SelectionDAG.
- Adds the GINodeEquiv so patterns are translated over to GlobalISel
  automatically.
- Corrects the AArch64Prefetch patterns to use a target immediate, which
  is needed to get the patterns to translate across correctly.
- Translates the SelectionDAG legalisation of the prefetch intrinsic
  into the corresponding GlobalISel legalisation.

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

23 months ago[IR] Update llvm.prefetch to match docs
Archibald Elliott [Wed, 17 Aug 2022 17:05:12 +0000 (18:05 +0100)]
[IR] Update llvm.prefetch to match docs

The current llvm.prefetch intrinsic docs state "The rw, locality and
cache type arguments must be constant integers."

This change:
- Makes arg 3 (cache type) an ImmArg
- Improves the verifier error messages to reference the incorrect
  argument.
- Fixes two tests which contradict the docs.

This is needed as the lowering to GlobalISel is different for ImmArgs
compared to other constants. The non-ImmArgs create a G_CONSTANT MIR
instruction, the for ImmArgs the constant is put directly on the
intrinsic's MIR instruction as an immediate.

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

23 months ago[lldb] [test] Remove test_step_multiprocess, it's unreliable
Michał Górny [Fri, 19 Aug 2022 08:07:37 +0000 (10:07 +0200)]
[lldb] [test] Remove test_step_multiprocess, it's unreliable

Sponsored by: The FreeBSD Foundation

23 months ago[Test] Regenerate tests using update_tests.py
Max Kazantsev [Fri, 19 Aug 2022 07:48:39 +0000 (14:48 +0700)]
[Test] Regenerate tests using update_tests.py

23 months ago[lldb] [test] Skip step packet test on non-amd64
Michał Górny [Fri, 19 Aug 2022 07:39:56 +0000 (09:39 +0200)]
[lldb] [test] Skip step packet test on non-amd64

Sponsored by: The FreeBSD Foundation

23 months ago[libc] Add more headers to the linux x86_64 and aarch64 configs.
Siva Chandra Reddy [Fri, 19 Aug 2022 07:15:08 +0000 (07:15 +0000)]
[libc] Add more headers to the linux x86_64 and aarch64 configs.

23 months ago[libc][NFC] Change the libc fullbuild target name to "libc".
Siva Chandra Reddy [Fri, 19 Aug 2022 07:01:47 +0000 (07:01 +0000)]
[libc][NFC] Change the libc fullbuild target name to "libc".

23 months ago[NFC] Add tests for MemorySSA shouldn't contain debug instructions
Chuanqi Xu [Fri, 19 Aug 2022 07:02:54 +0000 (15:02 +0800)]
[NFC] Add tests for MemorySSA shouldn't contain debug instructions

Extracted from D130153

23 months ago[lldb] [gdb-remote] Include PID in vCont packets if multiprocess
Michał Górny [Fri, 12 Aug 2022 10:37:18 +0000 (12:37 +0200)]
[lldb] [gdb-remote] Include PID in vCont packets if multiprocess

Try to always send vCont packets and include the PID in them if running
multiprocess.  This is necessary to ensure that with the upcoming full
multiprocess support always resumes the correct process without having
to resort to the legacy Hc packets.

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.llvm.org/D131758

23 months ago[clang-tidy] Improve modernize-use-emplace check
Joey Watts [Fri, 19 Aug 2022 06:57:12 +0000 (07:57 +0100)]
[clang-tidy] Improve modernize-use-emplace check

This patch improves the modernize-use-emplace check by adding support for
detecting inefficient invocations of the `push` and `push_front` methods on
STL-style containers and replacing them with their `emplace`-style equivalent.

Fixes #56996.

Reviewed By: njames93

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

23 months ago[DirectX] Fix crash on ShuffleVectorInst in DXILBitcodeWriter
Xiang Li [Thu, 18 Aug 2022 06:40:13 +0000 (23:40 -0700)]
[DirectX] Fix crash on ShuffleVectorInst in DXILBitcodeWriter

Use onstantDataSequential::getElementType to allow vector type.

Use getShuffleMaskForBitcode to get ShuffleMask.

Use old format for alloca Align.

Reviewed By: beanz

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

23 months ago[NFC] Add [[maybe_unused]] to avoid warning in gcc9
Chuanqi Xu [Fri, 19 Aug 2022 06:41:25 +0000 (14:41 +0800)]
[NFC] Add [[maybe_unused]] to avoid warning in gcc9

GCC9 may issue warning for the 'unused' parameters in if constexpr.
This commit try to fix it by adding the [[maybe_unused]] attribute.

23 months ago[flang] Shift argument attributes when result operand is inserted
Valentin Clement [Fri, 19 Aug 2022 06:40:09 +0000 (08:40 +0200)]
[flang] Shift argument attributes when result operand is inserted

The TargetRewrite pass convert the signature of the function.
In some cases it adds operands to the function to hanlde the result of it.
This patch makes sure the argument attributes present before the conversion
are replaced with the correct arguments after the conversion is performed.

Depends D132113

Reviewed By: vdonaldson

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

23 months ago[Test] Remove addrspace1 ptr to not confuse alive2
Max Kazantsev [Fri, 19 Aug 2022 06:24:35 +0000 (13:24 +0700)]
[Test] Remove addrspace1 ptr to not confuse alive2

addrspace here is not import for the test itself.

23 months ago[clang] Improve diagnostics for uninitialized constexpr variables
Timm Bäder [Thu, 11 Aug 2022 09:22:00 +0000 (11:22 +0200)]
[clang] Improve diagnostics for uninitialized constexpr variables

Instead of complaining about default initialization, tell users that
constexpr variables need to be initialized by a constant expression.

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

23 months ago[BOLT] Insert EH trampolines for multiple fragments
Fabian Parzefall [Fri, 19 Aug 2022 04:51:51 +0000 (21:51 -0700)]
[BOLT] Insert EH trampolines for multiple fragments

This patch adds exception handling trampolines when a function is split
into more than two fragments. Trampolines are tracked per-fragment, such
that they can be removed if splitting is reversed.

Reviewed By: rafauler

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

23 months ago[BOLT] Update buildCallGraph to check for split blocks
Fabian Parzefall [Fri, 19 Aug 2022 04:51:22 +0000 (21:51 -0700)]
[BOLT] Update buildCallGraph to check for split blocks

Use isSplit() instead of isCold() when building the call graph and
update parameter names to reflect this.

Reviewed By: rafauler

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

23 months ago[BOLT] Add randomN split strategy
Fabian Parzefall [Fri, 19 Aug 2022 04:51:01 +0000 (21:51 -0700)]
[BOLT] Add randomN split strategy

This adds a strategy to split functions into a random number of
fragments at randomly chosen split points.

Reviewed By: rafauler

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

23 months ago[BOLT] Add split all blocks strategy
Fabian Parzefall [Fri, 19 Aug 2022 04:50:35 +0000 (21:50 -0700)]
[BOLT] Add split all blocks strategy

This adds a function splitting strategy that splits each outlineable
basic block into its own fragment. This is exposed through a new command
line option `--split-strategy`.

Reviewed By: rafauler

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

23 months ago[BOLT] Generate sections for multiple fragments
Fabian Parzefall [Fri, 19 Aug 2022 04:48:19 +0000 (21:48 -0700)]
[BOLT] Generate sections for multiple fragments

This patch adds support to generate any number of sections that are
assigned to fragments of functions that are split more than two-way.
With this, a function's *nth* split fragment goes into section
`.text.cold.n`.

This also changes `FunctionLayout::erase` to make sure, that there are
no empty fragments at the end of the function. This sometimes happens
when blocks are erased from the function. To avoid creating symbols
pointing to these fragments, they need to be removed.

Reviewed By: rafauler

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

23 months ago[BOLT] Make exception handling fragment aware
Fabian Parzefall [Fri, 19 Aug 2022 04:40:00 +0000 (21:40 -0700)]
[BOLT] Make exception handling fragment aware

This adds basic fragment awareness in the exception handling passes and
generates the necessary symbols for fragments.

Reviewed By: rafauler

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

23 months ago[BOLT] Support passing fragments to code emission
Fabian Parzefall [Fri, 19 Aug 2022 04:26:18 +0000 (21:26 -0700)]
[BOLT] Support passing fragments to code emission

This changes code emission such that it can emit specific function
fragments instead of scanning all basic blocks of a function and just
emitting those that are hot or cold.

To implement this, `FunctionLayout` explicitly distinguishes the "main"
fragment (i.e. the one that contains the entry block and is associated
with the original symbol) from "split" fragments. Additionally,
`BinaryFunction` receives support for multiple cold symbols - one for
each split fragment.

Reviewed By: rafauler

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

23 months agoRevert "[tsan] Keep thread/stack for closed FD"
David Blaikie [Fri, 19 Aug 2022 04:01:42 +0000 (04:01 +0000)]
Revert "[tsan] Keep thread/stack for closed FD"

Test is flaky.

This reverts commit e9c5bde88ea2e35fadb15c5e5a1d2cb583fd0772.

23 months agoSimplify RAV isSameMethod with constexpr if
David Blaikie [Fri, 19 Aug 2022 03:33:01 +0000 (03:33 +0000)]
Simplify RAV isSameMethod with constexpr if

Owing to the large number of instantiations of this function, this small
change has a small but meaningful difference on the total size of
(especially a debug) build of clang at -O0:
```
    FILE SIZE        VM SIZE
 --------------  --------------
  +0.9% +96.9Ki  +0.9% +96.9Ki    .data.rel.ro
  +0.7% +96.7Ki  +0.7% +96.7Ki    .rela.dyn
  +0.0% +18.3Ki  +0.0% +18.3Ki    .rodata
  +0.0%    +324  [ = ]       0    [2 Others]
  -0.2%    -392  -0.2%    -392    .gnu.version
  -0.0%    -441  [ = ]       0    .debug_abbrev
  -0.1%    -980  -0.1%    -980    .gnu.hash
  -0.2% -1.53Ki  -0.2% -1.53Ki    .hash
  -0.2% -4.59Ki  -0.2% -4.59Ki    .dynsym
  -0.1% -10.5Ki  [ = ]       0    .debug_rnglists
  -0.6% -59.0Ki  -0.6% -59.0Ki    .dynstr
  -0.2%  -191Ki  [ = ]       0    .debug_str_offsets
  -3.0%  -233Ki  -3.0%  -233Ki    .eh_frame_hdr
  -0.7%  -244Ki  [ = ]       0    .debug_addr
  -2.9%  -699Ki  [ = ]       0    .symtab
  -0.6%  -884Ki  [ = ]       0    .debug_line
  -3.0%  -932Ki  -3.0%  -932Ki    .eh_frame
  -1.0% -1.48Mi  -1.0% -1.48Mi    .text
  -0.6% -2.75Mi  [ = ]       0    .debug_info
  -7.3% -8.61Mi  [ = ]       0    .strtab
  -7.3% -17.2Mi  [ = ]       0    .debug_str
  -2.4% -33.0Mi  -0.9% -2.47Mi    TOTAL
```

If anyone's got other ideas for how to reduce this further - it's not
especially important, I just came across it while investigating a debug
info size regression, but thought it was interesting enough to poke
around at.

23 months ago[RISCV] Copy SDNodeFlags in lowerToScalableOp.
Craig Topper [Fri, 19 Aug 2022 03:42:59 +0000 (20:42 -0700)]
[RISCV] Copy SDNodeFlags in lowerToScalableOp.

Reviewed By: arcbbb

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

23 months ago[RISCV] Copy SDNodeFlags in doPeepholeMaskedRVV and doPeepholeMergeVVMFold
Craig Topper [Fri, 19 Aug 2022 03:42:45 +0000 (20:42 -0700)]
[RISCV] Copy SDNodeFlags in doPeepholeMaskedRVV and doPeepholeMergeVVMFold

Especially the NoFPExcept flag for FP.

Reviewed By: fakepaper56

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

23 months ago[MLIR][normalize-memrefs] Non-normalizable operations with identity map layouts do...
Tung D. Le [Fri, 19 Aug 2022 02:57:20 +0000 (08:27 +0530)]
[MLIR][normalize-memrefs] Non-normalizable operations with identity map layouts do not block normalization of the entire function

The current approach is convervative in which whenever there is a
non-normalizable operations in a function will the function be labelled
as non-normalizable. It means it requires that all operations must have
MemRefsNormalizable trait.

This patch relaxes the requirement that if the memref map layouts of a
non-normalizable operation are identity, this operation does not block
the normalization of the other operations in the same function.

Reviewed By: bondhugula

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

23 months agoRevert "[cmake] Use `CMAKE_INSTALL_LIBDIR` too"
John Ericson [Fri, 19 Aug 2022 02:44:46 +0000 (22:44 -0400)]
Revert "[cmake] Use `CMAKE_INSTALL_LIBDIR` too"

This reverts commit f7a33090a91015836497c75f173775392ab0304d.

Unfortunately this causes a number of failures that didn't show up in my
local build.

23 months ago[Clang][BPF] Support record argument with direct values
Yonghong Song [Thu, 18 Aug 2022 15:01:45 +0000 (08:01 -0700)]
[Clang][BPF] Support record argument with direct values

Currently, record arguments are always passed by reference by allocating
space for record values in the caller. This is less efficient for
small records which may take one or two registers. For example,
for x86_64 and aarch64, for a record size up to 16 bytes, the record
values can be passed by values directly on the registers.

This patch added BPF support of record argument with direct values
for up to 16 byte record size. If record size is 0, that record
will not take any register, which is the same behavior for x86_64
and aarch64. If the record size is greater than 16 bytes, the
record argument will be passed by reference.

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