Commit Graph

431463 Commits

Author SHA1 Message Date
Tom Stellard b1dace63b1 workflows: Use correct access token when pushing to llvm-project-release-prs repo
The checkout action will hard-code the default github actions token in
the git config so that all pushes use it.  We need to set
persist-credentials=false so we can use a token that has permission
to push to the llvm-project-release-prs repo.
2022-07-27 20:14:54 -07:00
Carl Ritson dbda30e294 [AMDGPU][SIFoldOperands] Clear kills when folding COPY
Clear all kill flags on source register when folding a COPY.
This is necessary because the kills may now be out of order with the uses.

Reviewed By: foad

Differential Revision: https://reviews.llvm.org/D130622
2022-07-28 11:57:55 +09:00
Chris Bieneman 76e951e803 [Docs] Fix column ordering on clang attribute docs
This patch just adjusts the ordering of the headings on the attribute
docs to match the order of the column content.
2022-07-27 21:36:43 -05:00
Stella Laurenzo 7356404ace [mlir] Delete most of the ops from the quant dialect.
* https://discourse.llvm.org/t/rfc-removing-the-quant-dialect/3643/8
* Removes most ops. Leaves casts given final comment (can remove more in a followup).
* There are a few uses in Tosa keeping some of the utilities alive. In a followup, I will probably elect to just move simplified versions of them into Tosa itself vs having this quasi-library dependency.

Differential Revision: https://reviews.llvm.org/D120204
2022-07-27 17:50:42 -07:00
David Blaikie 4bb192b846 DebugInfo: Test vtable homing overriding ctor homing only on itanium since msvc ABI doesn't home vtables 2022-07-28 00:45:00 +00:00
Craig Topper a304d70ee9 [RISCV] Reorder (and/or/xor (shl X, C1), C2) if we can form ANDI/ORI/XORI.
InstCombine and DAGCombine prefer to keep shl before binops.

This patch teaches isel to convert to (shl (and/or/xor X, C1 >> C2), C2)
if (C1 >> C2) is a simm12. The idea was taken from X86's isel code.

There's a special case implemented for a sext_inreg between the
shift and the binop.

Differential Revision: https://reviews.llvm.org/D130610
2022-07-27 17:35:26 -07:00
Craig Topper 8d87f71e54 [RISCV] Pre-commit tests for D130610. NFC 2022-07-27 17:35:17 -07:00
Craig Topper 1d1d8d6025 [RISCV] Reorder code in lowerFROUND to make the diff in D130659 cleaner. NFC 2022-07-27 17:13:04 -07:00
David Blaikie 4e719e0f16 DebugInfo: Prefer vtable homing over ctor homing.
Vtables will be emitted in fewer places than ctors (every ctor
references the vtable, so at worst it's the same places - but at best
the type has a non-inline key function and the vtable is emitted in one
place)

Pulling this fix out of 517bbc64db which
was reverted in 4821508d4d
2022-07-28 00:07:35 +00:00
Amaury Séchet 06da353748 [NFC] Automatically generate CodeGen/VE/Scalar/atomic.ll 2022-07-27 23:52:00 +00:00
Lei Zhang 067daa56a9 [mlir][spirv] Unify resources of different vector sizes
This commit extends UnifyAliasedResourcePass to handle the case
where aliased resources have different vector sizes. (It still
requires all scalar types to be of the same bitwidth.) This is
effectively reusing the code for handling different-bitwidth
scalar types.

Reviewed By: ThomasRaoux

Differential Revision: https://reviews.llvm.org/D130671
2022-07-27 19:22:50 -04:00
Lei Zhang 7668e58210 [mlir][spirv] Fix spv.CompositeConstruct assembly and validation
This commit fixes spv.CompositeConstruct to assembly to list
operand types to enable vector construction out of smaller vectors.
Validation is also fixed to properly check the cases for vector
construction.

Reviewed By: ThomasRaoux

Differential Revision: https://reviews.llvm.org/D130669
2022-07-27 19:17:23 -04:00
Matt Arsenault bfdca1535c RegAllocGreedy: Fix nondeterminism in tryLastChanceRecoloring
tryLastChanceRecoloring iterates over the set of LiveInterval pointers
and used that to seed the recoloring stack, which was
nondeterministic. Fixes a future test failing about 20% of the time.

This just takes the order the interfering vreg was encountered. Not
sure if we should try to order this more intelligently.
2022-07-27 19:02:06 -04:00
Shafik Yaghmour 28cd7f86ed Revert "[Clang] Diagnose ill-formed constant expression when setting a non fixed enum to a value outside the range of the enumeration values"
This reverts commit a3710589f2.
2022-07-27 15:31:41 -07:00
Jonas Devlieghere ecda408178
[lldb] Read from the Rosetta shared cache with Xcode 14
Xcode 14 no longer puts the Rosetta expanded shared cache in a directory
named "16.0". Instead, it includes the real version number (e.g. 13.0),
the build string and the architecture, similar to the device support
directory names for iOS, tvOS and watchOS.

Currently, when there are multiple directories, we might end up picking
the wrong one in GetSDKDirectoryForCurrentOSVersion. The problem is that
without the build string we have no way to differentiate between
multiple directories with the same version number. This patch fixes the
problem by using GetOSBuildString which, as the name implies, returns
the build string if known.

This also adds a test for Rosetta debugging on Apple Silicon. Depending
on whether the Rosetta expanded shared cache is present, the test
ensures that there is or isn't a diagnostic about reading out of memory.

rdar://97576121

Differential revision: https://reviews.llvm.org/D130540
2022-07-27 15:26:46 -07:00
Craig Topper 98647330bf [RISCV] Add merge operand to RISCVISD::FCOPYSIGN_VL.
Similar to what was done for VRGATHER*_VL recently.

This will be used in D130659.
2022-07-27 15:25:34 -07:00
Jim Ingham 27893ff1ad Call WatchpointList::RemoveAll in Target::Destroy.
I noticed that the test TestSetWatchpoint.py was failing every so often
on macOS.  The failure was in the last assert, that after destroying the
SBTarget containing it, the SBWatchpoint was still saying it was valid.

IsValid in this case just meant the watchpoint weak pointer could be turned
into a shared pointer.  The watchpoint shared pointers have two strong references
in general, one to the "Target::m_last_created_watchpoint", and one in the
Target::m_watchpoint_list.  Target::Destroy reset the last created watchpoint
but neglected to call RemoveAll on the watchpoint list (it does the analogous
work for the internal & external breakpoint lists...)  This patch does the
equivalent cleanup for the watchpoint list.
2022-07-27 15:15:05 -07:00
Shafik Yaghmour a3710589f2 [Clang] Diagnose ill-formed constant expression when setting a non fixed enum to a value outside the range of the enumeration values
DR2338 clarified that it was undefined behavior to set the value outside the
range of the enumerations values for an enum without a fixed underlying type.

We should diagnose this with a constant expression context.

Differential Revision: https://reviews.llvm.org/D130058
2022-07-27 14:59:35 -07:00
LLVM GN Syncbot a35596675b [gn build] Port 6047deb7c2 2022-07-27 21:44:47 +00:00
bixia1 66088afbc8 [mlir][sparse] Add arith-expand pass to the sparse-compiler pipeline.
Modify an existing test to test the situation.

Reviewed By: Peiming

Differential Revision: https://reviews.llvm.org/D130658
2022-07-27 14:42:21 -07:00
Paul Kirth 6e9bab71b6 Revert "[llvm][NFC] Refactor code to use ProfDataUtils"
This reverts commit 300c9a7881.

We will reland once these issues are ironed out.
2022-07-27 21:38:11 +00:00
Paul Kirth 300c9a7881 [llvm][NFC] Refactor code to use ProfDataUtils
In this patch we replace common code patterns with the use of utility
functions for dealing with profiling metadata. There should be no change
in functionality, as the existing checks should be preserved in all
cases.

Reviewed By: bogner, davidxl

Differential Revision: https://reviews.llvm.org/D128860
2022-07-27 21:13:54 +00:00
Paul Kirth 6047deb7c2 [llvm] Provide utility function for MD_prof
Currently, there is significant code duplication for dealing with
MD_prof metadata throughout the compiler. These utility functions can
improve code reuse and simplify boilerplate code when dealing with
profiling metadata, such as branch weights. The inent is to provide a
uniform set of APIs that allow common tasks, such as identifying
specific types of MD_prof metadata and extracting branch weights.

Future patches can build on this initial implementation and clean up the
different implementations across the compiler.

Reviewed By: bogner

Differential Revision: https://reviews.llvm.org/D128858
2022-07-27 21:13:51 +00:00
Adrian Prantl 719ab04acf [GlobalISel] Handle IntToPtr constants in dbg.value
Currently, the IR to MIR translator can only handle two kinds of constant
inputs to dbg.values intrinsics: constant integers and constant floats. In
particular, it cannot handle pointers created from IntToPtr ConstantExpression
objects.

This patch addresses the limitation above by replacing the IntToPtr with
its input integer prior to converting the dbg.value input.

Patch by Felipe Piovezan!

Differential Revision: https://reviews.llvm.org/D130642
2022-07-27 13:42:07 -07:00
Arthur Eubanks 492245d959 [lldb][NFC] Pass ParsedDWARFTypeAttributes as const reference into ParseArrayType()
Fixes a FIXME

Reviewed By: zequanwu

Differential Revision: https://reviews.llvm.org/D130504
2022-07-27 13:39:46 -07:00
Tom Stellard 51ba98d058 workflows: Fix version check for X.0.0 releases 2022-07-27 13:26:09 -07:00
Slava Gurevich 2cfcbe295a [LLDB][NFC] Fix possible resource leak
SymbolVendorPECOFF object is leaked on early return at line 110

Differential Revision: https://reviews.llvm.org/D130655
2022-07-27 13:19:13 -07:00
Tom Stellard 89d3c9634b workflows: Fix pull request creation for backports
This was broken by 17d4796cc8.
2022-07-27 13:12:07 -07:00
Joseph Huber e27026cce1 [LinkerWrapper] Do not consume `--verbose` from the linker
Summary:
Linkers use `--verbose` to let users investigate search libraries among
other things. The linker wrapper was incorrectly not forwarding this to
the linker job. This patch simply renames this so users can still see
verbose messages from the linker if it was passed.
2022-07-27 16:06:48 -04:00
Prabhdeep Singh Soni 79a5ff45cb [Flang][Driver] Add support for AsmPrinter -mmlir options
This patch adds support for AsmPrinter  `-mmlir` options to the Flang driver.

Reviewed By: awarzynski

Differential Revision: https://reviews.llvm.org/D130598
2022-07-27 16:11:11 -04:00
Mark de Wever 41f7bb9975 [libc++][chrono] Uses operator<=> in the calendar.
Since the calendar is added in C++20 the existing operators are removed.

Implements part of:
- P1614R2 The Mothership has Landed

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D129887
2022-07-27 21:53:08 +02:00
Arthur Eubanks f6a7d7e45f [cross-project-tests] Add split-file as dependency
simplified_template_names_noncanonical_type_units.cpp uses split-file.

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D130656
2022-07-27 12:44:12 -07:00
Philip Reames 15c645f7ee [RISCV] Enable (scalable) vectorization by default
This change enables vectorization (using scalable vectorization only, fixed vectors are not yet enabled) for RISCV when vector instructions are available for the target configuration.

At this point, the resulting configuration should be both stable (e.g. no crashes), and profitable (i.e. few cases where scalar loops beat vector ones), but is not going to be particularly well tuned (i.e. we emit the best possible vector loop). The goal of this change is to align testing across organizations and ensure the default configuration matches what downstreams are using as closely as possible.

This exposes a large amount of code which hasn't otherwise been on by default, and thus may not have been fully exercised.  Given that, having issues fall out is not unexpected.  If you find issues, please make sure to include as much information as you can when reverting this change.

Differential Revision: https://reviews.llvm.org/D129013
2022-07-27 12:36:04 -07:00
Denis Fatkulin 17fb879764 [clang-format] FIX: Misannotation 'auto' as trailing return type in lambdas
Lambdas with trailing return type 'auto' are annotated incorrectly. It causes a misformatting. The simpliest code to reproduce is:

```
auto list = {[]() -> auto { return 0; }};
```

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

Reviewed By: HazardyKnusperkeks, owenpan, curdeius

Differential Revision: https://reviews.llvm.org/D130299
2022-07-27 22:20:09 +03:00
LLVM GN Syncbot 0fdf8db727 [gn build] Port 0f3f357e26 2022-07-27 19:04:03 +00:00
Jacob Lambert 0f3f357e26 [clang-offload-bundler] Library-ize ClangOffloadBundler
Lifting the core functionalities of the clang-offload-bundler into a
user-facing library/API. This will allow online and JIT compilers to
bundle and unbundle files without spawning a new process.

This patch lifts the classes and functions used to implement
the clang-offload-bundler into a separate OffloadBundler.cpp,
and defines three top-level API functions in OfflaodBundler.h.
        BundleFiles()
        UnbundleFiles()
        UnbundleArchives()

This patch also introduces a Config class that locally stores the
previously global cl::opt options and arrays to allow users to call
the APIs in a multi-threaded context, and introduces an
OffloadBundler class to encapsulate the top-level API functions.

We also  lift the BundlerExecutable variable, which is specific
to the clang-offload-bundler tool, from the API, and replace
its use with an ObjcopyPath variable. This variable must be set
in order to internally call llvm-objcopy.

Finally, we move the API files from
clang/tools/clang-offload-bundler into clang/lib/Driver and
clang/include/clang/Driver.

Differential Revision: https://reviews.llvm.org/D129873
2022-07-27 11:54:38 -07:00
Stanislav Mekhanoshin 68901fdbeb [AMDGPU] Consider S_SETPRIO a scheduling boundary
The instruction is used to modify wave priority with the intent
to affect VALU execution and currently we can reschedule VALU
around it since that VALU does not have side effects.

Differential Revision: https://reviews.llvm.org/D130654
2022-07-27 11:50:23 -07:00
Shraiysh Vaishay 57ef633259 [mlir][OpenMP] Add omp.atomic.update canonicalization
This patch adds canonicalization conditions for omp.atomic.update thus
eliminating it when it becomes just a write or a no-op due to other
changes during canonicalization.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D126531
2022-07-28 00:19:18 +05:30
Jonas Devlieghere a8c3d9815e
[DebugInfo] Teach LLVM and LLDB about ptrauth in DWARF
Teach libDebugInfo (llvm-dwarfdump) and lldb about DWARF tags and
attributes for pointer authentication. These values have been emitted by
Apple clang for several releases. Although upstream LLVM doesn't emit
these values yet, we hope to upstream that part sometime soon.

Differential revision: https://reviews.llvm.org/D130215
2022-07-27 11:48:35 -07:00
Philip Reames e8ceadd0ce [LV][RISCV] Add a test case for a quality problem mixing vector index and data types
The problem here is target independent, but particularly painful on RISCV.  If we chose to vectorize such that vscale x 2 x i32 is our widest type and fits in a register, a naive expansion of i64 comparisons results in comparisons and index types at <scalabe x 2 x i64>.  This requires both an LMUL of 2, and a VSETVLI toggle in the loop.  Note that we could have used <vscale x 2 x i32> for the compairons legally given the range of the trip count.
2022-07-27 11:42:28 -07:00
Amara Emerson 65246d3eb4 Use hasNItemsOrLess() in MRI::hasAtMostUserInstrs(). 2022-07-27 11:42:14 -07:00
Florian Hahn 16e0620d6d
[VPlan] Mark VPPredInstPHIRecipe as not having side-effects.
Now that all uses of VPPredInstPHIRecipes are properly modeled, they can
be treated as not having side-effects, enabling removal.
2022-07-27 19:29:26 +01:00
Nikolas Klauser 98d3d5b5da [libc++] Implement P1004R2 (constexpr std::vector)
Reviewed By: #libc, ldionne

Spies: mgorny, var-const, ormris, philnik, miscco, hiraditya, steven_wu, jkorous, ldionne, christof, libcxx-commits

Differential Revision: https://reviews.llvm.org/D68365
2022-07-27 20:26:44 +02:00
Stanislav Mekhanoshin 190f3fbba8 [AMDGPU] Precommit s_setprio scheduling test. NFC. 2022-07-27 11:26:15 -07:00
Eric Li 5e28923e33 [clang][dataflow][NFC] Remove last use of deprecated ctor
Use a delegating constructor to remove the last use of the deprecated
ctor of `TypeErasedDataflowAnalysis`, and then delete it.

Differential Revision: https://reviews.llvm.org/D130653
2022-07-27 14:23:35 -04:00
Fangrui Song 876af563e7 [ELF][test] Fix compressed-debug-level.test with zlib-ng
The test is brittle but it seems unnecessary to remove size check now.

Close #56222
2022-07-27 11:18:20 -07:00
Mingming Liu 34348814e1 [AArch64] Explicitly use v1i64 type for llvm.aarch64.neon.pmull64
Without this, the intrinsic will be expanded to an integer; thereby an
explicit copy (from GPR to SIMD register) will be codegen'd. This matches the
general convention of using "v1" types to represent scalar integer operations in
vector registers.

The similar approach is observed in D56616, and the pattern likely applies on
other intrinsic that accepts integer scalars (e.g.,
int_aarch64_neon_sqdmulls_scalar)

Differential Revision: https://reviews.llvm.org/D130548
2022-07-27 11:11:16 -07:00
Mark de Wever 653b21416c [libc++] Fixes the CI.
The GDB test was disabled for clang-15, updated the filter since main
now is clang-16.
2022-07-27 19:59:56 +02:00
Philip Reames 43b5e12159 [LV] Refresh an autogened test to pickup naming changes 2022-07-27 10:54:15 -07:00
Amara Emerson 19cdd1908b [AArch64][GlobalISel] Add heuristics for localizing G_CONSTANT.
This adds similar heuristics to G_GLOBAL_VALUE, querying the cost of
materializing a specific constant in code size. Doing so prevents us from
sinking constants which require multiple instructions to generate into
use blocks.

Code size savings on CTMark -Os:
Program                                       size.__text
                                              before         after           diff
ClamAV/clamscan                               381940.00      382052.00       0.0%
lencod/lencod                                 428408.00      428428.00       0.0%
SPASS/SPASS                                   411868.00      411876.00       0.0%
kimwitu++/kc                                  449944.00      449944.00       0.0%
Bullet/bullet                                 463588.00      463556.00      -0.0%
sqlite3/sqlite3                               284696.00      284668.00      -0.0%
consumer-typeset/consumer-typeset             414492.00      414424.00      -0.0%
7zip/7zip-benchmark                           595244.00      594972.00      -0.0%
mafft/pairlocalalign                          247512.00      247368.00      -0.1%
tramp3d-v4/tramp3d-v4                         372884.00      372044.00      -0.2%
                           Geomean difference                               -0.0%

Differential Revision: https://reviews.llvm.org/D130554
2022-07-27 10:51:16 -07:00