Commit Graph

431527 Commits

Author SHA1 Message Date
Hui Xie 8a61749f76 [libc++][ranges] implement `std::ranges::inplace_merge`
Differential Revision: https://reviews.llvm.org/D130627
2022-07-28 08:37:48 +01:00
Fangrui Song 1dc26b80b8 [Driver][PowerPC] Support -mtune=
Reviewed By: #powerpc, nemanjai

Differential Revision: https://reviews.llvm.org/D130526
2022-07-28 00:34:04 -07:00
Max Kazantsev 8e9e27ae90 [Test] Fix block name in test 2022-07-28 13:42:14 +07:00
Max Kazantsev 2d1c6e0b44 [LAA] Remove block order sensitivity in LAA algorithm. PR56672
As test in PR56672 shows, LAA produces different results which lead to either
positive or negative vectorization decisions depending on the order of blocks
in loop. The exact reason of this is not clear to me, however this makes investigation
of related bugs extremely complex.

Current order of blocks in the loop is arbitrary. It may change, for example, if loop
info analysis is dropped and recomputed. Seems that it interferes with LAA's logic.
This patch chooses fixed traversal order of blocks in loops, making it RPOT.

Note: this is *not* a fix for bug with incorrect analysis result. It just makes
the answer more robust to make the investigation easier.

Differential Revision: https://reviews.llvm.org/D130482
Reviewed By: aeubanks, fhahn
2022-07-28 13:36:56 +07:00
Tom Stellard d9e02a30b1 workflows: Use macos-11 runners
macos-10.15 is deprecated and will be removed.
2022-07-27 23:25:58 -07:00
Christian Sigg f983bdbdae [MLIR] Fix bazel build after 7356404ace. 2022-07-28 08:14:18 +02:00
Argyrios Kyrtzidis a9ae2f2764 [ASTWriter] Replace `const std::string &OutputFile` with `StringRef OutputFile` in some of `ASTWriter` functions, NFC
This is to make it consistent with LLVM's string parameter passing convention.
2022-07-27 23:02:33 -07:00
Phoebe Wang 726d9f8e8c [X86][MC] Avoid emitting incorrect warning for complex FMUL
We will insert a new operand which is identical to the Dest for complex
FMUL with a mask. https://godbolt.org/z/eTEdnYv3q

Complex FMA and FMUL with maskz don't have this problem.

Reviewed By: LuoYuanke, skan

Differential Revision: https://reviews.llvm.org/D130638
2022-07-28 13:58:34 +08:00
Austin Kerbow ba0d079c7a [AMDGPU] Aggressively schedule to reduce RP in occupancy limited regions
By not clustering loads and adjusting heuristics to more aggressively reduce
register pressure we may be able to increase occupancy for the function if it
was dropped in a first pass scheduling.

Similarly, try to reduce spilling if register usage exceeds lower bound
occupancy.

Reviewed By: rampitec

Differential Revision: https://reviews.llvm.org/D130329
2022-07-27 22:34:37 -07:00
Amara Emerson 93e3aeb9a8 [AArch64][GlobalISel] Fix custom legalization of rotates using sext for shift vs zext.
Rotates are defined according to DAG documentation as having unsigned shifts,
so we need to zero-extend instead of sign-extend here.

Fixes issue 56664
2022-07-27 22:10:42 -07:00
Amara Emerson c16fa781f4 GlobalISel: update legalize-rotr-rotl.mir checks before change. 2022-07-27 22:10:04 -07:00
Sridhar Gopinath f9a2f6b6ae [clang-format] Fix the return code of git-clang-format
In diff and diffstat modes, the return code is != 0 even when there are no
changes between commits. This issue can be fixed by passing --exit-code to
git-diff command that returns 0 when there are no changes and using that as
the return code for git-clang-format.

Fixes #56736.

Differential Revision: https://reviews.llvm.org/D129311
2022-07-27 21:01:24 -07:00
Utkarsh Saxena df537bef63 Use pseudoparser-based folding ranges in ClangdServer.
Differential Revision: https://reviews.llvm.org/D130011
2022-07-28 05:43:17 +02:00
Chuanqi Xu fe1887da36 [NFC] [C++20] [Modules] Add tests for merging redefinitions in modules
Add tests for detecting redefinitions in C++20 modules. Some of these
may be covered by other tests. But more tests should be always good.
2022-07-28 11:32:47 +08:00
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