469330 Commits

Author SHA1 Message Date
Nico Weber
a08b9fb967 [gn] port a8016e296e6ec1 (sancov Opts) 2023-07-26 09:48:45 -04:00
Dave Pagan
b41bf9d857 [OpenMP][Docs] Update 'loop' directive status in OpenMP support.
Update status of #pragma omp loop (directive) and loop bind.
2023-07-26 08:34:01 -05:00
Kevin P. Neal
3a5f8c3af8 Revert "[FPEnv][X86] Correct strictfp tests."
This reverts commit d6857060a3b7428d1e9319d85fcef44e4b6b8db7.

I'm getting build bot failures due to i128-fpconv-win64-strict.ll.
2023-07-26 09:18:32 -04:00
Ramkumar Ramachandra
110ec1863a LoopVectorize/iv-select-cmp: add test for decreasing IV, const start
The most straightforward extension to D150851 would involve a loop with
decreasing induction variable, with a constant start value.
iv-select-cmp.ll only contains a negative test for the decreasing
induction variable case when the start value is variable, namely
not_vectorized_select_decreasing_induction_icmp. Hence, add a test for
the most straightforward extension to D150851, in preparation to
vectorize:

  long rdx = 331;
  for (long i = 19999; i >= 0; i--) {
    if (a[i] > 3)
      rdx = i;
  }
  return rdx;

Differential Revision: https://reviews.llvm.org/D156152
2023-07-26 14:15:26 +01:00
Kevin P. Neal
f57fb82e0f [FPEnv][AArch64] Correct strictfp tests.
Correct AArch64 strictfp tests to follow the rules documented in the LangRef:
https://llvm.org/docs/LangRef.html#constrained-floating-point-intrinsics

Mostly these tests just needed the strictfp attribute on function
definitions.  I've also removed the strictfp attribute from uses
of the constrained intrinsics because it comes by default since
D154991, but I only did this in tests I was changing anyway.

I have removed attributes added to declare lines of intrinsics. The
attributes of intrinsics cannot be changed in a test so I eliminated
attempts to do so.

Test changes verified with D146845.
2023-07-26 09:14:25 -04:00
Kevin P. Neal
7e0e8b7ace [FPEnv][PowerPC] Correct strictfp tests.
Correct PowerPC strictfp tests to follow the rules documented in the LangRef:
https://llvm.org/docs/LangRef.html#constrained-floating-point-intrinsics

Mostly these tests just needed the strictfp attribute on function
definitions.  I've also removed the strictfp attribute from uses
of the constrained intrinsics because it comes by default since
D154991, but I only did this in tests I was changing anyway.

I have removed attributes added to declare lines of intrinsics. The
attributes of intrinsics cannot be changed in a test so I eliminated
attempts to do so.

Test changes verified with D146845.
2023-07-26 09:12:29 -04:00
Kevin P. Neal
5ad2760ad9 [FPEnv][RISC-V] Correct a strictfp test.
Correct a RISC-V strictfp tests to follow the rules documented in the LangRef:
https://llvm.org/docs/LangRef.html#constrained-floating-point-intrinsics

All function calls in a strictfp function require the strictfp attribute.

Test changes verified with D146845.
2023-07-26 09:10:19 -04:00
Kevin P. Neal
58ad5699e7 [FPEnv][SystemZ] Correct strictfp tests.
Correct a SystemZ strictfp test to follow the rules documented in the LangRef:
https://llvm.org/docs/LangRef.html#constrained-floating-point-intrinsics

This test, like many others, just needed the function definition corrected.

Test changes verified with D146845.
2023-07-26 09:08:46 -04:00
Kevin P. Neal
d6857060a3 [FPEnv][X86] Correct strictfp tests.
Correct X86 strictfp tests to follow the rules documented in the LangRef:
https://llvm.org/docs/LangRef.html#constrained-floating-point-intrinsics

Mostly these tests just needed the strictfp attribute on function
definitions. After D154991 the constrained intrinsics have the
strictfp attribute by default so they don't need it here, but other
functions do.

Test changes verified with D146845.
2023-07-26 09:07:03 -04:00
Andrzej Warzynski
e7dc73bbad [mlir][ArmSME] Add missing roundtrip tests for arm_sme.tile_store
Depends on: D155306

Reviewed By: c-rhodes

Differential Revision: https://reviews.llvm.org/D155800
2023-07-26 13:00:21 +00:00
Jacek Caban
48feef277a [lldb] Treat ARM64X images as ARM64.
With D149091, ARM64X binaries are no longer reported as ARM64. This broke
lldb tests as Windows 11 system DLLs are mostly ARM64X binaries and lldb
doesn't know how to handle them. Ideally lldb would understand a bit more
about ARM64X and handle them as AMD64 in x64 processes, but this is
enough to preserve previous behavior and fix tests.

Reviewed By: mstorsjo
Differential Revision: https://reviews.llvm.org/D156268
2023-07-26 14:45:48 +02:00
max
25b8433b75 add set_type to ir.Value
Differential Revision: https://reviews.llvm.org/D156289
2023-07-26 07:28:21 -05:00
DianQK
f2d307c4ed
[DebugInfo] Remove the cross-cu-inlining-2.ll test case.
This reverts the test case in commit 549773f9e98f9c5895f4cc461a7fb1dbdb216af8.
After committing 2ee4d0386c783f58abe708298228de648239b435, We don't support subprogram definitions nested within `DICompositeType` when doing LTO builds.
For a detailed discussion, see https://reviews.llvm.org/D152095.
2023-07-26 19:58:12 +08:00
DianQK
30f2170a78
Revert "[DebugInfo] Fix potential CU mismatch for attachRangesOrLowHighPC"
This reverts commit d20e4a1d68aa8e14c4e524e4d4eeb4445acac401.
After committing 2ee4d0386c783f58abe708298228de648239b435, We don't support subprogram definitions nested within `DICompositeType` when doing LTO builds.
For a detailed discussion, see https://reviews.llvm.org/D152095.
2023-07-26 19:58:00 +08:00
Tobias Gysi
0fc8d9e41a [mlir][llvm] Remove the metadata op
This revision removes the metadata op, that to the best of our
knowledge, has no more uses after switching to a purely attribute based
metadata representation:
https://reviews.llvm.org/D155444
https://reviews.llvm.org/D155285
https://reviews.llvm.org/D155159
These changes got unlocked after landing distinct attribute support:
https://reviews.llvm.org/D153360,
which enables modeling distinct metadata using attributes. As a result,
all metadata kinds are now represented using attributes. Previously,
there has been a mix of attribute and op based representations.

Having attribute only metadata makes it possible to update the metadata
in-parallel, while updating the global metadata operation has been
a sequential process. The LLVM Dialect inliner already benefits from
this change and now creates new alias scopes and domains during
inlining rather than dropping the no alias information:
https://reviews.llvm.org/D155712

Reviewed By: Dinistro

Differential Revision: https://reviews.llvm.org/D156217
2023-07-26 11:42:52 +00:00
Sam McCall
f6307b260b [include-cleaner] Switch Include from FileEntry* -> FileEntryRef
Unlike Header, we really do have a preferred spelling for an include: the one
that we used to open the file.

The fact that Header is still FileEntry* makes it difficult to accidentally
use path equality when we want inode equality.

Differential Revision: https://reviews.llvm.org/D155885
2023-07-26 13:41:55 +02:00
Timm Bäder
ae4849f967 [clang][Interp] PointerToIntegral casts
Differential Revision: https://reviews.llvm.org/D150946
2023-07-26 13:39:37 +02:00
Alexandros Lamprineas
c52ab9ea2f Revert "[FuncSpec] Add Phi nodes to the InstCostVisitor."
Reverting due to the crash reported in D154852.

Also reverting the subsequent commit as collateral damage:

"[FuncSpec] Split the specialization bonus into CodeSize and Latency."
2023-07-26 12:33:41 +01:00
pvanhout
a8aabba587 [AMDGPU] Fix PromoteAlloca Subvector Stores for Single Elements
The previous condition was incorrect in some cases, like storing <2 x i32>
into a double. If IndexVal was >0, we ended up never storing anything.

Reviewed By: #amdgpu, arsenm

Differential Revision: https://reviews.llvm.org/D156308
2023-07-26 13:21:21 +02:00
pvanhout
6a767fbc36 [AMDGPU] Precommit tests for D156308
Also includes another testcase that's unrelated, it's just a sanity check.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D156309
2023-07-26 13:21:20 +02:00
Ivan Butygin
c50f335ba5 [mlir][spirv] memref.cast to SPIR-V conversion
Differential Revision: https://reviews.llvm.org/D156251
2023-07-26 13:20:21 +02:00
Shivam Gupta
64d19542e7 [LIT] Added an option to llvm-lit to emit the necessary test coverage data, divided per test case
This patch is the first part of https://llvm.org/OpenProjects.html#llvm_patch_coverage.

We have first define a new variable LLVM_TEST_COVERAGE which when set, pass --per-test-coverage option to
llvm-lit which will help in setting a unique value to LLVM_PROFILE_FILE for each RUN. So for example
coverage data for test case llvm/test/Analysis/AliasSet/memtransfer.ll will be emitted as
build/test/Analysis/AliasSet/memtransfer0.profraw

Reviewed By: hnrklssn

Differential Revision: https://reviews.llvm.org/D154280
2023-07-26 16:47:17 +05:30
Alexandros Lamprineas
20c8f58c11 [FuncSpec] Split the specialization bonus into CodeSize and Latency.
Currently we use a combined metric TargetTransformInfo::TCK_SizeAndLatency
when estimating the specialization bonus. This is suboptimal, and in some
cases erroneous. For example we shouldn't be weighting the codesize decrease
attributed to constant propagation by the block frequency of the dead code.
Instead only the latency savings should be weighted by block frequency. The
total codesize savings from all the specialization arguments should be
deducted from the specialization cost.

Differential Revision: https://reviews.llvm.org/D155103
2023-07-26 12:03:46 +01:00
Sven van Haastregt
5e8b44cc44 [OpenCL] Add cl_ext_image_raw10_raw12 extension
Add the defines for the `cl_ext_image_raw10_raw12` extension.

Differential Revision: https://reviews.llvm.org/D151339
2023-07-26 11:59:12 +01:00
Zhongyunde
05aae0839f Reland [AArch64][NFC] Call the API getVScaleRange directly
Use the maximum 64 for BitWidth of getVScaleRange to avoid returning an empty range.

the previous changes bring in a Buildbot failure because MinSVEVectorSize = MinSVEVectorSize.
    error: explicitly assigning value of variable of type 'unsigned int' to itself [-Werror,-Wself-assign]

Reviewed By: sdesmalen, nikic, dmgreen
Differential Revision: https://reviews.llvm.org/D155708
2023-07-26 18:55:31 +08:00
ranapratap55
970569b6cc [AMDGPU] __builtin_amdgcn_read_exec_* should be implemented with llvm.amdgcn.ballot
Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D156219
2023-07-26 16:21:31 +05:30
Ganesh Gopalasubramanian
536e805e4d [X86] AMD Genoa (znver4) Change LoopMicroOpBufferSize to handle minimal unrolling of loops 2023-07-26 16:01:56 +05:30
Carlos Galvez
b7c6b39651 [clang-tidy] Remove AnalyzeTemporaryDestructors configuration option
Since it was deprecated since clang-tidy 16.

Fixes #62020

Differential Revision: https://reviews.llvm.org/D156303
2023-07-26 10:26:43 +00:00
Timm Bäder
378fcbf20f [clang][Interp] Handle CXXNoexceptExprs
Differential Revision: https://reviews.llvm.org/D155707
2023-07-26 12:23:54 +02:00
Timm Bäder
744a968f91 [clang][Interp] Fix return statements with expresssion in void functions
If the return type of a function is void, ReturnType is not set, but we
used to emit a RVOPtr instruction, which doesn't make sense for a
function returning void.

Differential Revision: https://reviews.llvm.org/D153649
2023-07-26 11:50:07 +02:00
Timm Bäder
e9eb8362f0 [clang][Interp][NFC] Add an assertion 2023-07-26 11:50:07 +02:00
Timm Bäder
d913aa6971 [clang][Interp][NFC] Make a local function static 2023-07-26 11:50:07 +02:00
David Spickett
efa43d785e [lldb][AArch64] Add the tpidr2 TLS register that comes with SME
This changes the TLS regset to not only be dynamic in that it could
exist or not (though it always does) but also of a dynamic size.

If SME is present then the regset is 16 bytes and contains both tpidr
and tpidr2.

Testing is the same as tpidr. Write from assembly, read from lldb and
vice versa since we have no way to predict what its value should be
by just running a program.

Reviewed By: omjavaid

Differential Revision: https://reviews.llvm.org/D154930
2023-07-26 10:34:13 +01:00
Timo Stripf
2ca7416225 [clang][DeclPrinter] Fix AST print of delegating constructors
DeclPrinter::PrintConstructorInitializers did not consider delegating initializers. As result, the output contained an "NULL TYPE" for delegating constructors.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D154186
2023-07-26 09:26:53 +00:00
Jay Foad
6fcad9cf93 [DAGCombiner] Simplify foldAndOrOfSETCC. NFC.
Pull out repeated hasOneUse checks. Simplify some conditions. Reduce
indentation.

Differential Revision: https://reviews.llvm.org/D156220
2023-07-26 10:22:55 +01:00
Jim Lin
657f8b3500 [RISCV] Fix incorrect return type of isPushable() to bool. NFC. 2023-07-26 17:04:47 +08:00
Jolanta Jensen
c67e443895 [AArch64][NFC] Expand coverage of ReplaceWithVeclib testing using SLEEF vector library
This patch expands testing coverage for ReplaceWithVeclib pass
when SLEEF vector library is used. It adds testing for all LLVM
intrinsics which correspond to math functions from libm.

llrint, llround and lrint are not included as currently
IR verifier pass does not allow to use vector types with them.

Differential Revision: https://reviews.llvm.org/D155623
2023-07-26 08:57:56 +00:00
Paul Semel
145f353fd6 [clang][dataflow] fix failing assert in copyRecord
When dealing with copy constructor, the compiler can emit an
UncheckedDerivedToBase implicit cast for the CXXConstructorExpr of the
base class. In such case, when trying to copy the src storage location
to its destination, we will fail on the assert checking that location
types are the same.

When copying from derived to base class, it is acceptable to break that
assumption to only copy common fields from the base class.

Note: the provided test crashes the process without the changes made to
copyRecord.

Differential Revision: https://reviews.llvm.org/D155844
2023-07-26 08:52:06 +00:00
Paul Semel
bc37893433 [clang][dataflow] fix bug for transparent ListInitExpr handling
This fixes the handling of "transparent" ListInitExpr, when they're only
used as a copy constructor for records.

Without the fix, the two tests are crashing the process.
2023-07-26 08:50:28 +00:00
Zhongyunde
ebaac2b2d6 Revert "[AArch64][NFC] Call the API getVScaleRange directly"
This reverts commit 67005c8e6fa9464f8bc436305a422071013ae499.
2023-07-26 16:44:14 +08:00
David Spickett
03d8cd1d72 [lldb][AArch64] Add support for SME's SVE streaming mode registers
The Scalable Matrix Extension (SME) adds a new Scalable Vector mode
called "streaming SVE mode".

In this mode a lot of things change, but my understanding overall
is that this mode assumes you are not going to move data out of
the vector unit very often or read flags.

Based on "E1.3" of "Arm® Architecture Reference Manual Supplement,
The Scalable Matrix Extension (SME), for Armv9-A".

https://developer.arm.com/documentation/ddi0616/latest/

The important details for debug are that this adds another set
of SVE registers. This set is only active when we are in streaming
mode and is read from a new ptrace regset NT_ARM_SSVE.
We are able to read the header of either mode at all times but
only one will be active and contain register data.

For this reason, I have reused the existing SVE state. Streaming
mode is just another mode value attached to that state.

The streaming mode registers do not have different names in the
architecture, so I do not plan to allow users to read or write the
inactive mode's registers. "z0" will always mean "z0" of the active
mode.

Ptrace does allow reading inactive modes, but the data is of little
use. Writing to inactive modes will switch to that mode which would
not be what a debugger user would expect. So lldb will do neither.

Existing SVE tests have been updated to check streaming mode and
mode switches. However, we are limited in what we can check given
that state for the other mode is invalidated on mode switch.

The only way to know what mode you are in for testing purposes would
be to execute a streaming only, or non-streaming only instruction in
the opposite mode. However, the CPU feature smefa64 actually allows
all non-streaming mode instructions in streaming mode.

This is enabled by default in QEMU emulation and rather than mess
about trying to disable it I'm just going to use the pseduo streaming
control register added in a later patch to make these tests more
robust.

A new test has been added to check SIMD read/write from all the modes
as there is a subtlety there that needs noting, though lldb
doesn't have to make extra effort to do so.

If you are in streaming mode and write to v0, when you later exit
streaming mode that value may not be in the non-streaming state.
This can depend on how the core works but is a valid behaviour.

For example, say I am stopped here:
mov x0, v0.d[0]

And I want to update v0 in lldb. "register write v0 ..." should update
the v0 that this instruction is about to see. Not the potential other
copy of v0 in the non-streaming state (which is what I attempted in
earlier versions of this patch).

Not to mention, switching out of streaming mode here would be unexpected
and difficult to signal to the user.

Reviewed By: omjavaid

Differential Revision: https://reviews.llvm.org/D154926
2023-07-26 09:36:50 +01:00
Dhruv Chawla
d899dc5296
[NFC][ValueTracking]: Move some code from isKnownNonZero to isKnownNonZeroFromOperator
There is some pointer simplification code originally from isKnownNonNull
that is now better suited to be in isKnownNonZeroFromOperator.

Differential Revision: https://reviews.llvm.org/D156141
2023-07-26 13:50:38 +05:30
wangpc
5a95848604 [RISCV] Add subclasses of Sched to simplify code
We add some subclasses of Sched to reduce code which cast string
to `SchedWrite`/`SchedRead`.

Besides, we add `ReadVMask` iff pseudo is masked. And this is the
reason why this patch isn't a NFC since we add it for all pseudos
before.

`ReadMergeOp` will be added in D155654.

Reviewed By: michaelmaitland

Differential Revision: https://reviews.llvm.org/D155932
2023-07-26 16:12:21 +08:00
Timm Bäder
ae667f03d3 [clang][Interp][NFC] Take a const InterpFrame* in InterpBuiltin.cpp 2023-07-26 10:06:26 +02:00
Timm Bäder
47446939e0 [clang][Interp][NFC] Move CastKind operator<< to PrimTypes.h
So it actually works when using dump().
2023-07-26 10:06:26 +02:00
Petr Hosek
73362c44eb Revert "[CMake] Include riscv32-unknown-elf runtimes in Fuchsia toolchain"
This reverts commit 28f5322770a13cd2cd796d0936d3db1a454e620b.
2023-07-26 08:05:03 +00:00
Ethan Luis McDonough
546c9b3f6a
[libc] Add math functions to AMD/NVPTX libm
Related to D152486.  The following functions are included in this revision: `acosf`, `acoshf`, `asinf`, `asinhf`, `atanf`, `atanhf`, `ceil`, `ceilf`, `copysign`, `copysignf`, `cos`, `cosf`, `cosh`, `coshf`, `exp10f`, `exp2f`, `expf`, `expm1f`, `fabs`, `fabsf`, `fdim`, `fdimf`, `floor`, `floorf`, `fma`, `fmaf`, `fmax`, `fmaxf`, `fmin`, `fminf`, `fmod`, `fmodf`, `frexp`, `frexpf`, `hypot`, `hypotf`, `ilogb`, `ilogbf`, `ldexp`, `ldexpf`, `llrint`, `llrintf`, `llround`, `llroundf`, `pow`, and `powf`.

Reviewed By: jhuber6

Differential Revision: https://reviews.llvm.org/D152603
2023-07-26 03:02:24 -05:00
Timm Bäder
8c0246c7f5 [clang][Interp] Reject reinterpret_casts
Add a new InvalidCast op for this purpose and emit a diagnostic.

Differential Revision: https://reviews.llvm.org/D153276
2023-07-26 09:56:29 +02:00
Zhongyunde
67005c8e6f [AArch64][NFC] Call the API getVScaleRange directly
Use the maximum 64 for BitWidth of getVScaleRange to
avoid returning an empty range.

Reviewed By: sdesmalen, nikic, dmgreen
Differential Revision: https://reviews.llvm.org/D155708
2023-07-26 15:54:04 +08:00
Timm Bäder
c7251385c8 [clang][Interp] Check pointers for live-ness when returning them
We might be trying to return a pointer or reference to a local variable,
which doesn't work.

Differential Revision: https://reviews.llvm.org/D154795
2023-07-26 09:52:09 +02:00