Chuanqi Xu [Fri, 8 Apr 2022 03:46:08 +0000 (11:46 +0800)]
[NFC] Remove unused variable in CodeGenModules
This eliminates an unused-variable warning
Evgeniy Brevnov [Fri, 4 Feb 2022 03:54:27 +0000 (10:54 +0700)]
Add support for atomic memory copy lowering
Currently, the utility supports lowering of non atomic memory transfer routines only. This patch adds support for atomic version of memcopy. This may be useful for targets not supporting atomic memcopy.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D118443
jacquesguan [Fri, 8 Apr 2022 03:09:21 +0000 (03:09 +0000)]
[mlir][LLVMIR] Add more vector predication intrinsic ops.
This revision adds float unary, ternary and float/integer reduction intrinsic ops.
Differential Revision: https://reviews.llvm.org/D123189
Austin Kerbow [Sat, 2 Apr 2022 03:02:31 +0000 (20:02 -0700)]
[InferAddressSpaces] Fix assert on invalid bitcast placement
Similar to the problem in
0bb25b4603, bitcasts that are inserted must
dominate all uses. When rewriting "values" with "new values" that have
the updated address space, we may replace the "new value" with a bitcast
if one of the original users is an addresspace cast. This bitcast must
be inserted before ALL users, not only before the addresspace cast.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D122964
jacquesguan [Fri, 8 Apr 2022 02:51:30 +0000 (02:51 +0000)]
[RISCV][NFC] Use defvar to simplify pattern definations.
Reviewed By: frasercrmck
Differential Revision: https://reviews.llvm.org/D123292
Chenbing Zheng [Fri, 8 Apr 2022 02:19:24 +0000 (10:19 +0800)]
[InstCombine] fold more constant divisor to select-of-constants divisor
By adding a parameter to function FoldOpIntoSelect, we can fold more Ops to Select.
For this example, we tend to fold the division instruction,
so we no longer care whether SelectInst is one use.
This patch slove TODO left in InstCombine/div.ll.
Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/D122967
Jeremy Furtek [Fri, 8 Apr 2022 00:49:14 +0000 (00:49 +0000)]
[mlir] Width parameterization of BitEnum attributes
This diff contains:
- Parameterization of bit enum attributes in OpBase.td by bit width (e.g. 32
and 64). Previously, all enums were 32-bits. This brings enum functionality in
line with other integer attributes, and allows for bit enums greater than 32
bits.
- SPIRV and Vector dialects were updated to use bit enum attributes with an
explicit bit width
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D123095
Stella Laurenzo [Fri, 8 Apr 2022 01:10:31 +0000 (18:10 -0700)]
NFC: Eliminate warning for unused type alias FnTraitsT in release builds.
Differential Revision: https://reviews.llvm.org/D123351
Lang Hames [Thu, 7 Apr 2022 22:48:22 +0000 (15:48 -0700)]
[ORC] Fix handling of casts in llvm.global_ctors.
Removes a bogus dyn_cast_or_null that was breaking cast-expression handling when
parsing llvm.global_ctors.
The intent of this code was to identify Functions nested within cast
expressions, but the offending dyn_cast_or_null was actually blocking that:
Since a function is not a cast expression, we would set FuncC to null and break
the loop without finding the Function. The cast was not necessary either:
Functions are already Constants, and we didn't need to do anything
ConstantExpr-specific with FuncC, so we could just drop the cast.
Thanks to Jonas Hahnfeld for tracking this down.
http://llvm.org/PR54797
David Blaikie [Thu, 7 Apr 2022 23:59:19 +0000 (23:59 +0000)]
DebugInfo: Consider the type of NTTP when simplifying template names
Since the NTTP may need to be cast to the type when rebuilding the name,
check that the type can be rebuilt when determining whether a template
name can be simplified.
Kevin Athey [Thu, 7 Apr 2022 16:40:49 +0000 (09:40 -0700)]
[MSAN] extend prctl interceptor to support PR_SCHED_CORE
Reviewed By: eugenis
Differential Revision: https://reviews.llvm.org/D122851
Walter Erquinigo [Wed, 6 Apr 2022 22:17:23 +0000 (15:17 -0700)]
[trace][intel pt] Create a common accessor for live and postmortem data
Some parts of the code have to distinguish between live and postmortem threads
to figure out how to get some data, e.g. thread trace buffers. This makes the
code less generic and more error prone. An example of that is that we have
two different decoders: LiveThreadDecoder and PostMortemThreadDecoder. They
exist because getting the trace bufer is different for each case.
The problem doesn't stop there. Soon we'll have even more kinds of data, like
the context switch trace, whose fetching will be different for live and post-
mortem processes.
As a way to fix this, I'm creating a common API for accessing thread data,
which is able to figure out how to handle the postmortem and live cases on
behalf of the caller. As a result of that, I was able to eliminate the two
decoders and unify them into a simpler one. Not only that, our TraceSave
functionality only worked for live threads, but now it can also work for
postmortem processes, which might be useful now, but it might in the future.
This common API is OnThreadBinaryDataRead. More information in the inline
documentation.
Differential Revision: https://reviews.llvm.org/D123281
Walter Erquinigo [Fri, 1 Apr 2022 18:44:51 +0000 (11:44 -0700)]
[trace][intel pt] Create a class for the libipt decoder wrapper
As we soon will need to decode multiple raw traces for the same thread,
having a class that encapsulates the decoding of a single raw trace is
a stepping stone that will make the coming features easier to implement.
So, I'm creating a LibiptDecoder class with that purpose. I refactored
the code and it's now much more readable. Besides that, more comments
were added. With this new structure, it's also easier to implement unit
tests.
Differential Revision: https://reviews.llvm.org/D123106
Arthur Eubanks [Thu, 7 Apr 2022 22:37:16 +0000 (15:37 -0700)]
[test][DSE] Precommit more assume tests
Jorge Gorbe Moya [Thu, 7 Apr 2022 22:25:28 +0000 (15:25 -0700)]
Fix format specifier. NFCI.
Using a portable format specifier avoids a "format specifies type
'unsigned long long' but the argument has type 'uint64_t' (aka 'unsigned
long') [-Werror,-Wformat]" error depending on the exact definition of
`uint64_t`.
Zequan Wu [Tue, 5 Apr 2022 19:12:48 +0000 (12:12 -0700)]
[llvm-symbolizer] Fix line offset for inline site.
This fixes the issue when the current line offset is actually for next range.
Maintain a current code range with current line offset and cache next file/line
offset. Update file/line offset after finishing current range.
Differential Revision: https://reviews.llvm.org/D123151
Jez Ng [Thu, 7 Apr 2022 22:13:27 +0000 (18:13 -0400)]
[lld-macho][nfc] Give non-text ConcatOutputSections order-independent finalization
This diff is motivated by my work to add proper DWARF unwind support. As
detailed in PR50956 functions that need DWARF unwind need to have
compact unwind entries synthesized for them. These CU entries encode an
offset within `__eh_frame` that points to the corresponding DWARF FDE.
In order to encode this offset during
`UnwindInfoSectionImpl::finalize()`, we need to first assign values to
`InputSection::outSecOff` for each `__eh_frame` subsection. But
`__eh_frame` is ordered after `__unwind_info` (according to ld64 at
least), which puts us in a bit of a bind: `outSecOff` gets assigned
during finalization, but `__eh_frame` is being finalized after
`__unwind_info`.
But it occurred to me that there's no real need for most
ConcatOutputSections to be finalized sequentially. It's only necessary
for text-containing ConcatOutputSections that may contain branch relocs
which may need thunks. ConcatOutputSections containing other types of
data can be finalized in any order.
This diff moves the finalization logic for non-text sections into a
separate `finalizeContents()` method. This method is called before
section address assignment & unwind info finalization takes place. In
theory we could call these `finalizeContents()` methods in parallel, but
in practice it seems to be faster to do it all on the main thread.
Reviewed By: #lld-macho, oontvoo
Differential Revision: https://reviews.llvm.org/D123279
Stanislav Mekhanoshin [Thu, 7 Apr 2022 20:38:02 +0000 (13:38 -0700)]
[AMDGPU] Fix handling of gfx10 LDS misaligned access bug
It was only handled for FLAT initially because we did not have
unaligned DS instructions lowering. Now it is implemented but
the bug is not handled.
Differential Revision: https://reviews.llvm.org/D123338
Pengxuan Zheng [Tue, 5 Apr 2022 01:17:03 +0000 (18:17 -0700)]
[compiler-rt][builtins] Move DMB definition to syn-ops.h
Compiler-rt cross-compile for ARMv5 fails because D99282 made it an error if DMB
is used for any pre-ARMv6 targets. More specifically, the "#error only supported
on ARMv6+" added in D99282 will cause compilation to fail when any source file
which includes assembly.h are compiled for pre-ARMv6 targets. Since the only
place where DMB is used is syn-ops.h (which is only included by
arm/sync_fetch_and_* and these files are excluded from being built for older
targets), this patch moves the definition there to avoid the issues described
above.
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D123105
Quinn Pham [Thu, 7 Apr 2022 21:45:19 +0000 (16:45 -0500)]
Revert "[PowerPC] Fix EmitPPCBuiltinExpr to emit arguments once"
This reverts commit
2aae5b1fac3898afa10b550eee5e97f394aed0e6. Because it
breaks tests on windows.
Fangrui Song [Thu, 7 Apr 2022 21:34:31 +0000 (14:34 -0700)]
[ELF] Fix non-relocatable-non-emit-relocs --gc-sections to discard .L symbols
This reverts commit
764cd491b126318add093c7c8ba3884967d64b21, which I
incorrectly assumed NFC partly because there were no test coverage for the
non-relocatable non-emit-relocs case before
9d6d936243fe343abe89323a27c7241b395af541.
The interaction of {,-r,--emit-relocs} {,--discard-locals} {,--gc-sections} is
complex but without -r/--emit-relocs, --gc-sections does need to discard .L
symbols like --no-gc-sections. The behavior matches GNU ld.
Stanislav Mekhanoshin [Thu, 7 Apr 2022 18:45:37 +0000 (11:45 -0700)]
[AMDGPU] Split unaligned LDS access instead of scalarizing
There is no need to fully scalarize an unaligned operation in
some case, just split it to alignment.
Differential Revision: https://reviews.llvm.org/D123330
Fangrui Song [Thu, 7 Apr 2022 21:24:15 +0000 (14:24 -0700)]
[ELF][test] Improve discard-locals.s
Florian Hahn [Thu, 7 Apr 2022 21:21:21 +0000 (23:21 +0200)]
[LV] Add test case for PR54427.
Reduced test for #54427.
Quinn Pham [Mon, 14 Mar 2022 20:13:47 +0000 (15:13 -0500)]
[PowerPC] Fix EmitPPCBuiltinExpr to emit arguments once
This patch changes `EmitPPCBuiltinExpr` in `CGBuiltin.cpp` to remove
the loop at the beginning of the function that emits the arguments and
to delay emitting the arguments until inside the switch statement. These
changes will put `EmitPPCBuiltinExpr` in line with the strategy of the
target independent function `EmitBuiltinExpr`. Also, this patch
ensures that arguments are only emitted once.
Tests that included builtins affected by these changes have been
modified to match expected behaviour.
Reviewed By: #powerpc, nemanjai, amyk
Differential Revision: https://reviews.llvm.org/D121637
Jonas Devlieghere [Thu, 7 Apr 2022 20:43:47 +0000 (13:43 -0700)]
[lldb] Use getMainExecutable in SBDebugger::PrintStackTraceOnError
Implement Pavel's suggestion to use llvm::sys::fs::getMainExecutable to
find the executable name for llvm::sys::PrintStackTraceOnErrorSignal.
Mark de Wever [Thu, 7 Apr 2022 20:40:08 +0000 (22:40 +0200)]
Revert "[libc++][format] Use a helper constant."
This reverts commit
82427685ea3732665286d5b1c8a1424b1f96164e.
This seems to break the AIX-32 bit build.
Luboš Luňák [Sun, 3 Apr 2022 23:13:53 +0000 (01:13 +0200)]
[lldb][gui] remove the "expand" diamond for variables where expanding fails
If the variables view shows a variable that is a struct that has
MightHaveChildren(), the expand diamond is shown, but if trying to expand
it and it's not possible (e.g. incomplete type), remove the expand diamond
to visualize that it can't be in fact expanded. Otherwise it feels kinda
weird that a tree item cannot be expanded even though it "should".
I guess the MightHaveChildren() checking means that GetChildren() may
be expensive, so also do not call it for rows that are not expanded.
Differential Revision: https://reviews.llvm.org/D123008
Luboš Luňák [Mon, 4 Apr 2022 08:36:54 +0000 (10:36 +0200)]
[lldb][gui] handle Ctrl+C to stop a running process
Differential Revision: https://reviews.llvm.org/D123015
Craig Topper [Thu, 7 Apr 2022 19:52:53 +0000 (12:52 -0700)]
[ARM] Add missing return to ARMTTIImpl::isLoweredToCall.
I assume we meant to return the result of the call to
BaseT::isLoweredToCall(F).
This might not be a functional change in practice because it would
still hit the default case in the switch and call
BaseT::isLoweredToCall(F) at the end.
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D123333
Nico Weber [Thu, 7 Apr 2022 12:48:52 +0000 (08:48 -0400)]
[lld/mac] Add some comments and asserts
I was wondering if SymtabSection::emitStabs() should check
defined->includeInSymtab. Add asserts and comments explaining why that's not
necessary.
No behavior change.
Differential Revision: https://reviews.llvm.org/D123302
Emil Kieri [Thu, 7 Apr 2022 16:00:15 +0000 (18:00 +0200)]
[Driver][NFC] Simplify handling of flags in Options.td
We aim at improving the readability and maintainability of Options.td,
and in particular its handling of 'Flags', by
- limiting the extent of 'let Flags = [...] in {'s, and
- adding closing comments to matching '}'s.
- being more consistent about empty lines around 'let Flags' and '}'.
More concretely,
- we do not let a 'let Flags' span across several headline comments.
When all 'def's in two consecutive headlines share the same flags,
we stil close and start a new 'let Flags' at the intermediate
headline.
- when a 'let Flags' span just one or two 'def's, set 'Flags' within
the 'def's instead.
- we remove nested 'let Flags'.
Note that nested 'let Flags' can be quite confusing, especially when
the outer was started long before the inner. Moving a 'def' out of the
inner 'let Flags' and setting 'Flags' within the 'def' will not have the
intended effect, as those flags will be overridden by the outer
'let Flags'.
Reviewed By: awarzynski, jansvoboda11, hans
Differential Revision: https://reviews.llvm.org/D123070
River Riddle [Thu, 7 Apr 2022 01:52:39 +0000 (18:52 -0700)]
Reland [GreedPatternRewriter] Preprocess constants while building worklist when not processing top down
Reland Note: Adds a fix to properly mark a commutative operation as folded if we change the order
of its operands. This was uncovered by the fact that we no longer re-process constants.
This avoids accidentally reversing the order of constants during successive
application, e.g. when running the canonicalizer. This helps reduce the number
of iterations, and also avoids unnecessary changes to input IR.
Fixes #51892
Differential Revision: https://reviews.llvm.org/D122692
Jez Ng [Thu, 7 Apr 2022 18:28:44 +0000 (14:28 -0400)]
[lld-macho][nfc] Remove indirection when looking up common section members
{D118797} means that we can now check the name/segname of a given
section directly, instead of having to look those properties up on one
of its subsections. This allows us to simplify our code.
Reviewed By: #lld-macho, oontvoo
Differential Revision: https://reviews.llvm.org/D123275
David Green [Thu, 7 Apr 2022 18:27:41 +0000 (19:27 +0100)]
[AArch64] Insert subvector costs
An insert subvector under aarch64 can often be done as a single lane mov
operation. For example a v4i8 inserted into a v16i8 is a s-reg mov, so
long as the index is a multiple of 4. This teaches the cost model that,
using code copied over from the X86 backend.
Some of the costs (v16i16_4_0) are still high because they get matched
as a SK_Select, not an SK_InsertSubvector. D120879 has some codegen
tests for inserting subvectors, which I were added as
llvm/test/CodeGen/AArch64/insert-subvector.ll.
Differential Revision: https://reviews.llvm.org/D120880
Joseph Huber [Wed, 6 Apr 2022 19:56:19 +0000 (15:56 -0400)]
[OpenMP] Add dynamic memory function to omp.h and add documentation
This patch adds the `llvm_omp_target_dynamic_shared_alloc` function to
the `omp.h` header file so users can access it by default. Also changed
the name to keep it consistent with the other target allocators. Added
some documentation so users know how to use it. Didn't add the interface
for Fortran since there's no way to test it right now.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D123246
Joseph Huber [Wed, 6 Apr 2022 19:21:50 +0000 (15:21 -0400)]
[OpenMP] Change target memory tests to use allocators
The target allocators have been supported for NVPTX offloading for
awhile. The tests should use the allocators instead of calling the
functions manually. Also the comments indicating these being a preview
should be removed.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D123242
Mogball [Thu, 7 Apr 2022 18:22:14 +0000 (18:22 +0000)]
[mlir][ods] Fix builder gen for VariadicRegion with inferred types
Builders generated for ops with variadic regions and inferred return types were not being correctly generated (missing parameter).
Jonas Devlieghere [Thu, 7 Apr 2022 18:12:09 +0000 (11:12 -0700)]
[lldb] Add Python bindings to print stack traces on crashes.
As noticed in D87637, when LLDB crashes, we only print stack traces if
LLDB is directly executed, not when used via Python bindings. Enabling
this by default may be undesirable (libraries shouldn't be messing with
signal handlers), so make this an explicit opt-in.
I "commandeered" this patch from Jordan Rupprecht who put this up for
review originally.
Differential revision: https://reviews.llvm.org/D91835
Alex Brachet [Thu, 7 Apr 2022 18:19:54 +0000 (18:19 +0000)]
[clang] Use -triple, not -target for %clang_cc1
Alex Brachet [Thu, 7 Apr 2022 18:17:29 +0000 (18:17 +0000)]
[clang] Fix macos build broken after D120989
Nathan James [Thu, 7 Apr 2022 18:13:50 +0000 (19:13 +0100)]
[clang-tidy] Fix invalid fix-it for cppcoreguidelines-prefer-member-initializer
Fixes https://github.com/llvm/llvm-project/issues/53515.
Reviewed By: LegalizeAdulthood
Differential Revision: https://reviews.llvm.org/D118927
Daniel Grumberg [Thu, 7 Apr 2022 10:17:23 +0000 (11:17 +0100)]
[clang][extract-api][NFC] Use dedicated API to check for macro equality
Differential Revision: https://reviews.llvm.org/D123295
natashaknk [Thu, 7 Apr 2022 17:22:23 +0000 (10:22 -0700)]
[tosa][mlir] Add dynamic width/height support for depthwise convolution in tosa-to-linalg
In addition, fixed a small bug with padding incorrectly inferring output shape for dynaic inputs in convolution
Reviewed By: jpienaar
Differential Revision: https://reviews.llvm.org/D121872
Augie Fackler [Wed, 6 Apr 2022 15:59:30 +0000 (11:59 -0400)]
InstCombineCalls: fix annotateAnyAllocCallSite to report changes
Spotted during review of D123052.
Differential Revision: https://reviews.llvm.org/D123232
Simon Pilgrim [Thu, 7 Apr 2022 17:39:06 +0000 (18:39 +0100)]
[X86] Add PR35202 test case for commuted cmp merging
Test coverage for Issue #34550
Pavel Samolysov [Thu, 7 Apr 2022 15:43:10 +0000 (08:43 -0700)]
[clang][NFC] Extract EmitAssemblyHelper::shouldEmitRegularLTOSummary
The code to check if the regular LTO summary should be emitted and to
add the corresponding module flags was duplicated in the
'EmitAssemblyHelper::EmitAssemblyWithLegacyPassManager' and
'EmitAssemblyHelper::RunOptimizationPipeline' methods.
In order to eliminate these code duplications, the
'EmitAssemblyHelper::shouldEmitRegularLTOSummary' method has been
extracted. The method returns a bool value, the value is 'true' if the
module summary should be emitted. The patch keeps the setting of the
module flags inline.
Reviewed By: tejohnson
Differential Revision: https://reviews.llvm.org/D123026
Mark de Wever [Thu, 7 Apr 2022 17:22:14 +0000 (19:22 +0200)]
[libc++][format] Use a helper constant.
The code accidentally uses a hard-coded value. Use a constant to make
sure the same value is used at both places.
Zixu Wang [Wed, 6 Apr 2022 21:53:52 +0000 (14:53 -0700)]
[clang][ExtractAPI] Fix declaration fragments for ObjC methods
Objective-C methods selector parts should be considered as identifiers.
Depends on D123259
Differential Revision: https://reviews.llvm.org/D123261
Arthur Eubanks [Tue, 5 Apr 2022 21:51:53 +0000 (14:51 -0700)]
[CaptureTracking] Ignore ephemeral values when determining pointer escapeness
Ephemeral values cannot cause a pointer to escape.
No change in compile time:
https://llvm-compile-time-tracker.com/compare.php?from=
4371710085ba1c376a094948b806ddd3b88319de&to=
c5ddbcc4866f38026737762ee8d7b9b00395d4f4&stat=instructions
This partially fixes some regressions caused by more calls to `__builtin_assume` (D122397).
Reviewed By: asbirlea
Differential Revision: https://reviews.llvm.org/D123162
Simon Pilgrim [Thu, 7 Apr 2022 17:08:42 +0000 (18:08 +0100)]
[X86] Add PR19752 test case
Test coverage for Issue #20126
Karl Meakin [Wed, 6 Apr 2022 17:35:37 +0000 (18:35 +0100)]
[AArch64] Update tests with the `update_llc_test_checks.py` script (NFC)
Reviewed By: Kmeakin
Differential Revision: https://reviews.llvm.org/D123317
Lei Zhang [Thu, 7 Apr 2022 16:59:09 +0000 (12:59 -0400)]
[mlir][vector] Fold extract(broadcast) of same rank
This case is handled in neither the folding or canonicalization
patterns. The folding pattern cannot generate new broadcast ops,
so it should be handled by the canonicalization pattern.
Reviewed By: ThomasRaoux
Differential Revision: https://reviews.llvm.org/D123307
Daniel Grumberg [Tue, 5 Apr 2022 18:49:08 +0000 (19:49 +0100)]
[clang][extract-api] Process only APIs declared in inputs
We should only process APIs declared in the command line inputs to avoid
drowning the ExtractAPI output with symbols the user doesn't care about.
This is achieved by keeping track of the provided input files and
checking that the associated Decl or Macro is declared in one of those files.
Differential Revision: https://reviews.llvm.org/D123148
Augie Fackler [Thu, 24 Feb 2022 22:40:17 +0000 (17:40 -0500)]
MemoryBuiltins: only claim an allocator family on builtin functions
This lines up with other parts of the codebase that only use special
knowledge about allocator functions if they're builtins.
Differential Revision: https://reviews.llvm.org/D123053
Augie Fackler [Thu, 10 Feb 2022 22:38:12 +0000 (17:38 -0500)]
BuildLibCalls: also set allocsize() attributes
This is part of being able to get rid of two more columns in
MemoryBuiltins.cpp's large table. We'll have two more changes before
we can finish the job.
Differential Revision: https://reviews.llvm.org/D119582
Augie Fackler [Mon, 14 Mar 2022 20:25:56 +0000 (16:25 -0400)]
InstCombineCalls: when adding an align attribute, never reduce it
Sometimes we can infer an align from an allocalign but the function
already promised it'd be more-aligned than the allocalign and there's an
existing align that we shouldn't reduce. Make sure we handle that
correctly.
Differential Revision: https://reviews.llvm.org/D121642
Augie Fackler [Mon, 14 Mar 2022 20:55:44 +0000 (16:55 -0400)]
MemoryBuiltins: also check function definition for allocalign
This got changed to use hasAttrSomewhere() during review, and I didn't
notice until today when I was writing some tests for another part of
this system that using hasAttrSomewhere only checked the callsite for
allocalign, rather than both the callsite and the definition. This fixes
that by introducing a helper method.
Differential Revision: https://reviews.llvm.org/D121641
Augie Fackler [Mon, 4 Apr 2022 16:43:16 +0000 (12:43 -0400)]
InstCombineCalls: infer return alignment from allocalign attributes
This exposes a couple of lingering bugs, which will be fixed in
the next two commits.
Differential Revision: https://reviews.llvm.org/D123052
Fangrui Song [Thu, 7 Apr 2022 16:37:59 +0000 (09:37 -0700)]
[crt][test] Fix dso_handle.cpp for Linux systems which default to PIE
chenglin.bi [Thu, 7 Apr 2022 16:33:05 +0000 (00:33 +0800)]
[x86] Replace getNodeIfExists to doesNodeExist when only check node exist
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D123224
Craig Topper [Thu, 7 Apr 2022 16:17:30 +0000 (09:17 -0700)]
[RISCV] Add more .vx patterns for VLMax integer setccs.
This patch synchronizes the structure of the templates with those
in RISCVInstrInfoVVLPatterns.td so that we get patterns with .vx
on the left hand side.
Reviewed By: rogfer01
Differential Revision: https://reviews.llvm.org/D123255
Zixu Wang [Wed, 6 Apr 2022 21:45:35 +0000 (14:45 -0700)]
[clang][ExtractAPI] Fix appendSpace in DeclarationFragments
There is a bug in `DeclarationFragments::appendSpace` where the space
character is added to a local copy of the last fragment.
Differential Revision: https://reviews.llvm.org/D123259
Craig Topper [Thu, 7 Apr 2022 16:05:51 +0000 (09:05 -0700)]
[RISCV] Add swapped patterns to VPatIntegerSetCCVL_VIPlus1.
This matches VPatIntegerSetCCVL_VI_Swappable. But as noted in the
FIXME this may only be needed due to lack of canonicalization on
VP_SETCC.
Reviewed By: rogfer01
Differential Revision: https://reviews.llvm.org/D123239
Paul Walker [Thu, 7 Apr 2022 15:42:08 +0000 (16:42 +0100)]
[SVE] Add more gather/scatter tests to highlight bugs in their generated code.
Siva Chandra Reddy [Fri, 1 Apr 2022 06:42:14 +0000 (06:42 +0000)]
[libc] Add a linux Thread class in __support/threads.
This change is essentially a mechanical change which moves the thread
creation and join implementations from src/threads/linux to
src/__support/threads/linux/thread.h. The idea being that, in future, a
pthread implementation can reuse the common thread implementations in
src/__support/threads.
Reviewed By: lntue
Differential Revision: https://reviews.llvm.org/D123287
Arthur Eubanks [Wed, 6 Apr 2022 02:16:39 +0000 (19:16 -0700)]
[libcxx] Add flag to disable __builtin_assume in _LIBCPP_ASSERT
Introduce _LIBCPP_ASSERTIONS_DISABLE_ASSUME which makes _LIBCPP_ASSERT
not call __builtin_assume when _LIBCPP_ENABLE_ASSERTIONS == 0.
Calling __builtin_assume was introduced in D122397.
__builtin_assume is generally supposed to improve optimizations, but can
cause regressions when LLVM has trouble handling the calls to
`llvm.assume()` (see comments in D122397).
Reviewed By: philnik
Differential Revision: https://reviews.llvm.org/D123175
Changpeng Fang [Thu, 7 Apr 2022 15:35:23 +0000 (08:35 -0700)]
AMDGPU: Set implicit kernarg size to be of 256 bytes for code object version 5
Summary:
If implicitarg_ptr intrinsic is not used, set implicit kernarg size to 0, otherwise
set it to 256 bytes for code object version 5 (and beyond).
Reviewers: arsenm
Differential Revision: https://reviews.llvm.org/D123262
Simon Pilgrim [Thu, 7 Apr 2022 15:00:42 +0000 (16:00 +0100)]
[X86] Enable fast variable per-lane shuffle tuning on all Ryzen targets (PR44795)
rGa3b8695bf592 enabled this for znver3, but AMD SoG, Agner and uops.info all agree that even znver1 has a fast per-lane shuffle op (VPSHUFB), but cross-lane shuffles seem to be slow (PERMPS etc.)
Fixes #44140
Differential Revision: https://reviews.llvm.org/D123306
Sam McCall [Wed, 6 Apr 2022 09:37:25 +0000 (11:37 +0200)]
Remove a few effectively-unused FileEntry APIs. NFC
- isValid: FileManager only ever returns valid FileEntries (see next point)
- construction from outside FileManager (both FileEntry and DirectoryEntry).
It's not possible to create a useful FileEntry this way, there are no setters.
This was only used in FileEntryTest, added a friend to enable this.
A real constructor is cleaner but requires larger changes to FileManager.
Differential Revision: https://reviews.llvm.org/D123197
Alex Zinenko [Thu, 7 Apr 2022 14:36:30 +0000 (16:36 +0200)]
[mlir] specify dialect names in doc generation
In several cases, a doc is being generated from a .td file that includes
files containing other dialects. Specify the dialect for which the
documentation is being generated explicitly.
Nikita Popov [Thu, 7 Apr 2022 14:23:56 +0000 (16:23 +0200)]
[Sink] Don't sink non-willreturn calls (PR51188)
Fixes https://github.com/llvm/llvm-project/issues/51188.
Nikita Popov [Thu, 7 Apr 2022 14:21:23 +0000 (16:21 +0200)]
[Sink] Add willreturn test
Explicitly test the nounwind/willreturn combinations.
Simon Pilgrim [Thu, 7 Apr 2022 14:13:46 +0000 (15:13 +0100)]
[InstCombine] SimplifyDemandedUseBits - allow and(srem(X,Pow2),C) -> and(X,C) to work on vector types
Replace m_ConstantInt with m_APInt to match uniform (no-undef) vector remainder amounts.
Arjun P [Thu, 7 Apr 2022 13:41:04 +0000 (14:41 +0100)]
[MLIR][Presburger] refactor subtraction to be non-recursive
Subtraction was previously implemented recursively. This refactors it to be
non-recursive to avoid issues with potential stack overflows.
Reviewed By: Groverkss
Differential Revision: https://reviews.llvm.org/D123248
Louis Dionne [Mon, 4 Apr 2022 21:53:31 +0000 (17:53 -0400)]
[libc++] Add back-deployment testing on arm64 macs
Differential Revision: https://reviews.llvm.org/D123081
Alexey Bataev [Thu, 7 Apr 2022 13:18:17 +0000 (06:18 -0700)]
Add missing template keywords
GCC 14 warns about these.
Reviewed By: ABataev
Differential Revision: https://reviews.llvm.org/D121047
Nico Weber [Thu, 7 Apr 2022 14:06:45 +0000 (10:06 -0400)]
Revert "Reland "[Driver] Default CLANG_DEFAULT_PIE_ON_LINUX to ON"""
This reverts commit
2aca33baf15926afe2520a06b1427a9894226fd2.
Broke tests on several bots, see comments on https://reviews.llvm.org/D120305
Dmitry Preobrazhensky [Thu, 7 Apr 2022 14:02:50 +0000 (17:02 +0300)]
[AMDGPU][MC][GFX10] Added syntactic sugar for s_waitcnt_depctr operand
Added the following helpers:
depctr_hold_cnt(...)
depctr_sa_sdst(...)
depctr_va_vdst(...)
depctr_va_sdst(...)
depctr_va_ssrc(...)
depctr_va_vcc(...)
depctr_vm_vsrc(...)
Differential Revision: https://reviews.llvm.org/D123022
Simon Pilgrim [Thu, 7 Apr 2022 13:58:39 +0000 (14:58 +0100)]
[InstCombine] Regenerate and(srem(X,Pow2),C) test and add vector coverage
Ties Stuij [Thu, 7 Apr 2022 13:35:30 +0000 (14:35 +0100)]
remove dead code in parseRegisterList checking for ARM::RA_AUTH_CODE
Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/D122577
Simon Pilgrim [Thu, 7 Apr 2022 13:35:11 +0000 (14:35 +0100)]
[InstCombine] SimplifyDemandedUseBits - add TODO to remove shl node if we only demand known sign bits of the shift source
Similar to what we already perform for ashr/lshr
Simon Pilgrim [Thu, 7 Apr 2022 13:33:31 +0000 (14:33 +0100)]
[InstCombine] SimplifyDemandedUseBits - remove lshr node if we only demand known sign bit
This is a lshr equivalent to D122340 - if we don't demand any of the additional sign bits introduced by the ashr, the lshr can be treated as an ashr and we can remove the shift entirely if we only demand already known sign bits.
Another step towards PR21929
https://alive2.llvm.org/ce/z/6f3kjq
Differential Revision: https://reviews.llvm.org/D123118
LLVM GN Syncbot [Thu, 7 Apr 2022 13:18:45 +0000 (13:18 +0000)]
[gn build] Port
1306b1025c50
Nikolas Klauser [Thu, 7 Apr 2022 11:02:02 +0000 (13:02 +0200)]
[libc++][ranges] Implement ranges::count{, _if}
Reviewed By: var-const, Mordante, ldionne, #libc
Spies: tcanens, libcxx-commits, mgorny
Differential Revision: https://reviews.llvm.org/D121523
Jez Ng [Thu, 7 Apr 2022 13:05:33 +0000 (09:05 -0400)]
[lld-macho][nfc] Factor out findSymbolAtOffset
Our compact unwind handling code currently has some logic to locate a
symbol at a given offset in an InputSection. The EH frame code will need
to do something similar, so let's factor out the code.
Reviewed By: #lld-macho, thakis
Differential Revision: https://reviews.llvm.org/D123301
Simon Pilgrim [Thu, 7 Apr 2022 13:01:06 +0000 (14:01 +0100)]
Fix MSVC "not all control paths return a value" warning
Simon Pilgrim [Thu, 7 Apr 2022 12:38:21 +0000 (13:38 +0100)]
[X86] Ensure ZN3Tuning inherits from ZN2Tuning instead of ZNTuning
At the moment ZN2Tuning is just a copy of ZNTuning, but we should try to keep a clean inheritance.
Simon Pilgrim [Thu, 7 Apr 2022 12:36:37 +0000 (13:36 +0100)]
[X86] Add test case for PR44795
Nathan Sidwell [Wed, 6 Apr 2022 14:24:06 +0000 (07:24 -0700)]
[clang] Verify internal entity module mangling
Internal symbol mangling is implementation-defined. We do not mangle
any module attachment, and this adds a test to verify that.
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D123220
Antonio Frighetto [Thu, 7 Apr 2022 12:20:54 +0000 (08:20 -0400)]
Fix warnings when `-Wdeprecated-enum-enum-conversion` is enabled
clang may throw the following warning:
include/clang/AST/DeclarationName.h:210:52: error: arithmetic between
different enumeration types ('clang::DeclarationName::StoredNameKind'
and 'clang::detail::DeclarationNameExtra::ExtraKind') is deprecated
when flags -Werror,-Wdeprecated-enum-enum-conversion are on.
This adds the `addEnumValues()` helper function to STLExtras.h to hide
the details of adding enumeration values together from two different
enumerations.
Nico Weber [Thu, 7 Apr 2022 12:15:33 +0000 (08:15 -0400)]
[gn build] (manually) port
3031fa88f01e
Nico Weber [Thu, 7 Apr 2022 12:13:26 +0000 (08:13 -0400)]
[gn build] (manually) port
5390606aa963
Nico Weber [Wed, 6 Apr 2022 19:55:42 +0000 (15:55 -0400)]
[lld/mac] Don't emit stabs entries for functions folded during ICF
This matches ld64, and makes dsymutil work better with lld's output.
Fixes PR54783, see there for details.
Reduces time needed to run dsymutil on Chromium Framework from 8m30s
(which is already down from 26 min with D123218) to 6m30s and removes
many lines of "could not find object file symbol for symbol" from dsymutil output
(previously: several MB of those messages, now dsymutil is completely silent).
Differential Revision: https://reviews.llvm.org/D123252
Nikolas Klauser [Wed, 6 Apr 2022 21:10:21 +0000 (23:10 +0200)]
[libc++] Remove redundant __invoke_constexpr functions
There are `constexpr` versions for the different `__invoke` functions, which seem to be identical other than begin `constexpr` since C++11 instead of being `constexpr` since C++20.
Reviewed By: ldionne, #libc
Spies: libcxx-commits
Differential Revision: https://reviews.llvm.org/D123003
Nikita Popov [Thu, 7 Apr 2022 11:52:19 +0000 (13:52 +0200)]
[Clang] Remove redundant -no-opaque-pointers flag in test (NFC)
This was accidentally caught in an automated replacement. This
test is testing the -opaque-pointers flag itself, so we shouldn't
add -no-opaque-pointers here (though it doesn't hurt either).
Also drop the line testing the default, as the default is now
determined by a cmake option.
Kavitha Natarajan [Mon, 7 Mar 2022 07:15:52 +0000 (12:45 +0530)]
[clang][DebugInfo] Support debug info for alias variable
clang to emit DWARF information for global alias variable as
DW_TAG_imported_declaration. This change also handles nested
(recursive) imported declarations.
Reviewed by: dblaikie, aprantl
Differential Revision: https://reviews.llvm.org/D120989
Weining Lu [Thu, 7 Apr 2022 08:07:42 +0000 (16:07 +0800)]
[LoongArch] Split asmstr to opcstr and opnstr in LAInst class definition. NFC
This change removes a lot of redundant strconcat usings.
Simon Pilgrim [Thu, 7 Apr 2022 11:13:55 +0000 (12:13 +0100)]
[bugpoint] ReduceCrashingFunctions::TestFuncs - fix dereference of null point static analyzer warning
Alias.getAliaseeObject() shouldn't be null, do use dyn_cast instead of dyn_cast_or_null
Also, remove redundant `else if (!F)` test - that is always true at the point in the if-else chain
Priyansh Singh [Thu, 7 Apr 2022 11:11:11 +0000 (07:11 -0400)]
Fix grammar and punctuation across several docs; NFC