Commit Graph

429873 Commits

Author SHA1 Message Date
Alexander Timofeev 2e29b0138c [AMDGPU] Lowering VGPR to SGPR copies to v_readfirstlane_b32 if profitable.
Since the divergence-driven instruction selection has been enabled for AMDGPU,
 all the uniform instructions are expected to be selected to SALU form, except those not having one.
 VGPR to SGPR copies appear in MIR to connect values producers and consumers. This change implements an algorithm
 that evolves a reasonable tradeoff between the profit achieved from keeping the uniform instructions in SALU form
 and overhead introduced by the data transfer between the VGPRs and SGPRs.

Reviewed By: rampitec

Differential Revision: https://reviews.llvm.org/D128252
2022-07-14 23:59:02 +02:00
Tom Stellard 5b0788fef8 Remove left over merge marker from 4b1e3d1937 2022-07-14 14:51:44 -07:00
Tom Stellard 4b1e3d1937 [gold] Ignore bitcode from sections inside object files
-fembed-bitcode will put bitcode into special sections within object
files, but this is not meant to be used by LTO, so the gold plugin
should ignore it.

https://github.com/llvm/llvm-project/issues/47216

Reviewed By: tejohnson, MaskRay

Differential Revision: https://reviews.llvm.org/D116995
2022-07-14 14:46:15 -07:00
Katherine Rasmussen ebf3dbbe15 Revert "[flang] Add co_sum to the list of intrinsics and update test"
This reverts commit d2460d9008.

Reverting this commit because after pushing to main it caused
unexpected test failures.
2022-07-14 14:44:34 -07:00
Siva Chandra 98fdabecf5 [libc] Enable a few stdlib and time functions on aarch64. 2022-07-14 14:37:50 -07:00
isuckatcs b032e3ff61 [analyzer] Evaluate construction of non-POD type arrays
Introducing the support for evaluating the constructor
of every element in an array. The idea is to record the
index of the current array member being constructed and
create a loop during the analysis. We looping over the
same CXXConstructExpr as many times as many elements
the array has.

Differential Revision: https://reviews.llvm.org/D127973
2022-07-14 23:30:21 +02:00
Petr Hosek 2da550140a [compiler-rt][CMake] Use linker semantics for unwinder and C++ library
Try the shared library first, and if it doesn't exist fallback onto
the static one. When the static library is requested, skip the shared
library.

Differential Revision: https://reviews.llvm.org/D129470
2022-07-14 21:12:36 +00:00
Alexandre Ganea 17a4427e82 [LLD][COFF] On Windows, fix the date formatting in the 'incremental' test.
On my system the date formatting is a bit different from what the test used to
support. I'm using:

  Windows 11 version 21H2, build 22000.795 using the English(Canada) region.
  ls from BusyBox 1.36
  VS 2022 17.2.5
  WinSDK 10.0.22000
2022-07-14 17:10:09 -04:00
Aart Bik 67564841cb [mlir][sparse][bufferization] initialize reduction variable
After recent bufferization improvement, this test
started failing due to missed zero initialization.

Reviewed By: jpienaar

Differential Revision: https://reviews.llvm.org/D129800
2022-07-14 13:58:23 -07:00
Jez Ng 7dbfc4fc06 [clang] Document -femit-compact-unwind option in the User’s Manual
Reviewed By: #lld-macho, thakis

Differential Revision: https://reviews.llvm.org/D129772
2022-07-14 16:50:36 -04:00
Katherine Rasmussen d2460d9008 [flang] Add co_sum to the list of intrinsics and update test
Add the collective subroutine, co_sum, to the list of intrinsics.
In accordance with 16.9.50 and 16.9.137, add a check for and an
error if coindexed objects are being passed to certain arguments
in co_sum and in move_alloc. Add a semantics test to check that
this error is successfully caught in calls to move_alloc. Remove
the XFAIL directive, update the ERROR directives and add both
standard-conforming and non-standard conforming calls to the
semantics test for co_sum.

Reviewed By: jeanPerier

Differential Revision: https://reviews.llvm.org/D114134
2022-07-14 13:49:38 -07:00
Fangrui Song 889c6f3996 [ELF][test] Fix a typo in aarch64-ifunc-bti.s to actually test what was intended
Thanks to Alex Brachet for spotting it in D110217.
2022-07-14 13:46:38 -07:00
Krzysztof Drewniak bc61cc9a2d [mlir][AMDGPU] Add lds_barrier op
The lds_barrier op allows workgroups to wait at a barrier for
operations to/from their local data store (LDS) to complete without
incurring the performance penalties of a full memory fence.

Reviewed By: nirvedhmeshram

Differential Revision: https://reviews.llvm.org/D129522
2022-07-14 20:45:26 +00:00
Siva Chandra 75a628925e [libc] Enable few stdio functions on aarch64. 2022-07-14 13:40:48 -07:00
Jeff Niu b7f93c2809 [mlir] (NFC) run clang-format on all files 2022-07-14 13:32:13 -07:00
Siva Chandra edee61b55c [libc] Enable few pthread and threads functions on aarch64. 2022-07-14 13:25:21 -07:00
Siva Chandra Reddy 8dc42802f7 [libc] Add implementations of pthread_equal and pthread_self.
Reviewed By: michaelrj, lntue

Differential Revision: https://reviews.llvm.org/D129729
2022-07-14 20:12:35 +00:00
Fabian Parzefall d55dfeaf32 [BOLT] Replace uses of layout with basic block list
As we are moving towards support for multiple fragments, loops that
iterate over all basic blocks of a function, but do not depend on the
order of basic blocks in the final layout, should iterate over binary
functions directly, rather than the layout.

Eventually, all loops using the layout list should either iterate over
the function, or be aware of multiple layouts. This patch replaces
references to binary function's block layout with the binary function
itself where only little code changes are necessary.

Reviewed By: maksfb

Differential Revision: https://reviews.llvm.org/D129585
2022-07-14 13:07:05 -07:00
Hui Xie 3151b95dad [libc++][ranges] implement `std::ranges::set_union`
[libc++][ranges] implement `std::ranges::set_union`

Differential Revision: https://reviews.llvm.org/D129657
2022-07-14 21:05:30 +01:00
Philip Reames f267584863 [CVP] Add coverage for missing mul/shl nowrap variants 2022-07-14 13:00:55 -07:00
LLVM GN Syncbot 426d7bc130 [gn build] Port a83004f4ff 2022-07-14 19:46:00 +00:00
Vitaly Buka a629ec2f47 [test] Fix D129789 for 32bit platforms 2022-07-14 12:44:15 -07:00
David Tenty a83004f4ff [libcxx][AIX][z/OS] Remove headers included via `_IBMCPP__`
D127650 removed support for non-clang-based XL compilers, but left some
of the headers used only by this compiler and included under the
__IBMCPP__ macro. This change cleans this up by deleting these headers.

Reviewed By: hubert.reinterpretcast, fanbo-meng

Differential Revision: https://reviews.llvm.org/D129491
2022-07-14 15:41:46 -04:00
Louis Dionne 340b48b267 [libc++] Add missing UNSUPPORTED annotations to experimental tests that use RTTI 2022-07-14 15:12:20 -04:00
Petr Hosek 1f3f4833ea [libcxxabi][CMake] Set --unwindlib=none when using LLVM libunwind
We already link libunwind explicitly so avoid trying to link toolchain's
default libunwind which may be missing. This matches what we already do
for libcxx.

Differential Revision: https://reviews.llvm.org/D129469
2022-07-14 18:59:40 +00:00
Ellis Hoag af58684f27 [InstrProf] Add options to profile function groups
Add two options, `-fprofile-function-groups=N` and `-fprofile-selected-function-group=i` used to partition functions into `N` groups and only instrument the functions in group `i`. Similar options were added to xray in https://reviews.llvm.org/D87953 and the goal is the same; to reduce instrumented size overhead by spreading the overhead across multiple builds. Raw profiles from different groups can be added like normal using the `llvm-profdata merge` command.

Reviewed By: ianlevesque

Differential Revision: https://reviews.llvm.org/D129594
2022-07-14 11:41:30 -07:00
Nick Desaulniers 140bfdca60 [clang][CodeGen] add fn_ret_thunk_extern to synthetic fns
Follow up fix to
commit 2240d72f15 ("[X86] initial -mfunction-return=thunk-extern
support")
https://reviews.llvm.org/D129572

@nathanchance reported that -mfunction-return=thunk-extern was failing
to annotate the asan and tsan contructors.
https://lore.kernel.org/llvm/Ys7pLq+tQk5xEa%2FB@dev-arch.thelio-3990X/

I then noticed the same occurring for gcov synthetic functions.

Similar to
commit 2786e67 ("[IR][sanitizer] Add module flag "frame-pointer" and set
it for cc1 -mframe-pointer={non-leaf,all}")
define a new module level MetaData, "fn_ret_thunk_extern", then when set
adds the fn_ret_thunk_extern IR Fn Attr to synthetically created
Functions.

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

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D129709
2022-07-14 11:25:24 -07:00
Sanjay Patel 2c648f7d58 [PhaseOrdering][SystemZ] add test for combining/unrolling; NFC
As discussed in D128123, this test is based on an example
that ends up with codegen regressions if sub is converted
to xor.
2022-07-14 14:23:01 -04:00
Sanjay Patel 03e0497800 [InstCombine] add/edit tests for masked sub from constant; NFC 2022-07-14 14:23:00 -04:00
Vitaly Buka a2e01bdcc2 [test][CodeGen] Don't miss lifetime markers in lifetime tests
Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D129789
2022-07-14 11:14:07 -07:00
Amara Emerson d4f84df0a0 [GlobalISel] Change widenScalar of G_FCONSTANT to mutate into G_CONSTANT.
Widening a G_FCONSTANT by extending and then generating G_FPTRUNC doesn't produce
the same result all the time. Instead, we can just transform it to a G_CONSTANT
of the same bit pattern and truncate using a plain G_TRUNC instead.

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

Differential Revision: https://reviews.llvm.org/D129743
2022-07-14 11:05:10 -07:00
Nikolas Klauser 0a92e0728c [libc++] Use __unwrap_iter_impl for both unwrapping and rewrapping
Reviewed By: ldionne, #libc

Spies: arichardson, sstefan1, libcxx-commits

Differential Revision: https://reviews.llvm.org/D129039
2022-07-14 20:01:19 +02:00
Mitch Phillips 041d4012e4 Revert "Rewording "static_assert" diagnostics"
This reverts commit b7e77ff25f.

Reason: Broke sanitizer builds bots + libcxx. 'static assertion
expression is not an integral constant expression'. More details
available in the Phabricator review: https://reviews.llvm.org/D129048
2022-07-14 10:59:20 -07:00
Philip Reames c0df6bc949 [RISCV][LSR] Add coverage for ICmpZero with scaled vscale values
Follow up to 3bc09c7da5 - remove a fixme I forgot to remove, and add test cases showing remaining work.

Note that scaled vscales show up in vectorized code from a couple of sources:
* Element types smaller than vector block size (i.e. everything under i64)
* Unrolling
* LMUL > 1

The largest scaling we can currently have is 256 (e8 in every possible vector register).  More practically useful scales are in the 2-16 range.
2022-07-14 10:55:31 -07:00
Stella Stamenova c3a28e8a99 Revert "[lldb] Add support for using integral const static data members in the expression evaluator"
This reverts commit 486787210d.

This broke the windows lldb bot: https://lab.llvm.org/buildbot/#/builders/83/builds/21186
2022-07-14 10:47:01 -07:00
Nikolas Klauser 64d63f4823 [libc++] Error if someone tries to use MSVC and tell them to contact the libc++ developers
Nobody knows if there are users of libc++ with MSVC. Let's try to find that out and encourage them to upstream their changes to make that configuration work.

Reviewed By: ldionne, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D129055
2022-07-14 19:35:12 +02:00
LLVM GN Syncbot 728217cd60 [gn build] Port 1a8468ba61 2022-07-14 17:28:37 +00:00
Vitaly Buka bb4d974135 [NFC] Clang-format D129645 2022-07-14 10:27:04 -07:00
Michał Górny 06b3f27fed [lldb] [llgs] Remove not-really-used m_inferior_prev_state
Remove m_inferior_prev_state that's not suitable for multiprocess
debugging and that does not seem to be really used at all.

The only use of the variable right now is to "prevent" sending the stop
reason after attach/launch.  However, this code is never actually run
since none of the process plugins actually use eStateLaunching or
eStateAttaching.  Through adding an assert, I've confirmed that it's
never hit in any of the LLDB tests or while attaching/launching debugged
process via lldb-server and via lldb CLI.

Differential Revision: https://reviews.llvm.org/D128878
Sponsored by: The FreeBSD Foundation
2022-07-14 19:25:54 +02:00
Hans Wennborg 77350198d3 Pass -DLIBXML2_INCLUDE_DIRS in the Windows release package script
As pointed out on https://reviews.llvm.org/D129571 this seems to
be the preferred variable to set.
2022-07-14 19:21:51 +02:00
Craig Topper 1a8468ba61 [RISCV] Add a RISCV specific CodeGenPrepare pass.
Initial optimization is to convert (i64 (zext (i32 X))) to
(i64 (sext (i32 X))) if the dominating condition for the basic block
guaranteed the sign bit of X is zero.

This frequently occurs in loop preheaders where a signed induction
variable that can never be negative has been widened. There will be
a dominating check that the 32-bit trip count isn't negative or zero.
The check here is not restricted to that specific case though.

A i32->i64 sext is cheaper than zext on RV64 without the Zba
extension. Later optimizations can often remove the sext from the
preheader basic block because the dominating block also needs a sext to
evaluate the greater than 0 check.

Reviewed By: asb

Differential Revision: https://reviews.llvm.org/D129732
2022-07-14 10:20:59 -07:00
Tue Ly 0f782b84cb [libc] Add nearest integer instructions to fputil.
Add round to nearest integer instructions to fputil.  This will be
used in sinf implementation https://reviews.llvm.org/D123154

Reviewed By: michaelrj

Differential Revision: https://reviews.llvm.org/D129776
2022-07-14 13:20:35 -04:00
Fangrui Song ecfaf4801c [lldb] Remove ELF .zdebug support
clang 14 removed -gz=zlib-gnu support and ld.lld/llvm-objcopy removed zlib-gnu
support recently. Remove lldb support by migrating away from
llvm::object::Decompressor::isCompressedELFSection.
The API has another user llvm-dwp, so it is not removed in this patch.

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D129724
2022-07-14 10:12:48 -07:00
Guozhi Wei 2f11b3a6d7 [MachineCombiner] Don't compute the latency of transient instructions
If an MI will not generate a target instruction, we should not compute its
latency. Then we can compute more precise instruction sequence cost, and get
better result.

Differential Revision: https://reviews.llvm.org/D129615
2022-07-14 17:08:14 +00:00
Thomas Raoux f48ce52c4c [mlir][vector] Pattern to clean up vector.extract during distribution
This prevents blocking propagation when converting between scalar and
vector<1>

Differential Revision: https://reviews.llvm.org/D129782
2022-07-14 17:07:32 +00:00
Craig Topper 0e718443c7 [SimplifyIndVar] Use enum class for ExtendKind. NFC
I happened to notice a two places where the enum was being pass
directly to the bool IsSigned argument of createExtendInst. This
was functionally ok since SignExtended in the enum has value
of 1, but the code shouldn't rely on that.

Using an enum class prevents the enum from being convertible to bool,
but does make writing the enum values more verbose. Since we now
have to write ExtendKind:: in front of them, I've shortened the
names of ZeroExtended and SignExtended.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D129733
2022-07-14 10:03:58 -07:00
Nick Desaulniers d2792e7d37 [clang][test] fix typo in fn attr
While testing backports of
https://reviews.llvm.org/D129572#inline-1245936
commit 2240d72f15 ("[X86] initial -mfunction-return=thunk-extern support")
I noticed that one of my unit tests mistyped a function attribute. The
unit test was intended to test fn attr merging behavior, but with the
typo it was not.  Small fixup.

Reviewed By: aaron.ballman, erichkeane

Differential Revision: https://reviews.llvm.org/D129691
2022-07-14 09:49:11 -07:00
Erich Keane e71fd54719 [NFC] Move check for isEqualityOp to CheckFloatComparisons
So callers don't have to.  Also, fix a clang-format/use of auto fix in
CheckFloatComparisons.
2022-07-14 09:30:29 -07:00
Florian Hahn e7ec1746a6
[SCEV] Avoid creating unnecessary SCEVs for SelectInsts.
After 675080a453, we always create SCEVs for all operands of a
SelectInst. This can cause notable compile-time regressions compared to
the recursive algorithm, which only evaluates the operands if the select
is in a form we can create a usable expression.

This approach adds additional logic to getOperandsToCreate to only
queue operands for selects if we will later be able to construct a
usable SCEV.

Unfortunately this introduces a bit of coupling between actual SCEV
construction for selects and getOperandsToCreate, but I am not sure if
there are better alternatives to address the regression mentioned for
675080a453.

This doesn't have any notable compile-time impact on CTMark.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D129731
2022-07-14 09:23:47 -07:00
Fraser Cormack d1a5669f5e [RISCV] Disable subregister liveness by default
We previously enabled subregister liveness by default when compiling
with RVV. This has been shown to cause miscompilations where RVV
register operand constraints are not met. A test was added for this in
D129639 which explains the issue in more detail.

Until this issue is fixed in some way, we should not be enabling
subregister liveness unless the user asks for it.

Reviewed By: craig.topper, rogfer01, kito-cheng

Differential Revision: https://reviews.llvm.org/D129646
2022-07-14 17:04:10 +01:00