Commit Graph

412471 Commits

Author SHA1 Message Date
Benjamin Kramer f15014ff54 Revert "Rename llvm::array_lengthof into llvm::size to match std::size from C++17"
This reverts commit ef82063207.

- It conflicts with the existing llvm::size in STLExtras, which will now
  never be called.
- Calling it without llvm:: breaks C++17 compat
2022-01-26 16:55:53 +01:00
serge-sans-paille 297bbf1062 Fix ambiguous call to llvm::size introduced in ef82063207 2022-01-26 16:54:26 +01:00
Stanislav Gatev 75c22b382f [clang][dataflow] Add a transfer function for CXXBoolLiteralExpr
This is part of the implementation of the dataflow analysis framework.
See "[RFC] A dataflow analysis framework for Clang AST" on cfe-dev.

Reviewed-by: xazax.hun

Differential Revision: https://reviews.llvm.org/D118236
2022-01-26 15:33:00 +00:00
dongAxis df597bf000 [NFC][ORC][AArch64] use isInt<N> to replace fitsRangeSignedInt on aarch64
Summary:
This is the first path to support more relocation types on aarch64.
 The patch just uses the isInt<N> to replace fitsRangeSignedInt.

Test Plan:
check-all

Differential Revision: https://reviews.llvm.org/D118231
2022-01-26 23:26:31 +08:00
Sanjay Patel 63daea8b35 [SDAG] fix bug in ComputeNumSignBits of target constant
The loop below the changed line assumes that the element
width of the target constant is the same as the element
width of the loaded value, but that is not always true.

We could try harder to do some kind of min/max calc even
if the sizes don't match, but that can be another patch
if needed. This fixes #53401 (miscompile) and does not
change the motivating cases added when this analysis
was introduced:
ad298f86b7
2022-01-26 10:22:41 -05:00
Sanjay Patel d70d997799 [x86] add test for miscompile from wrong min signbits ( #53401 ); NFC 2022-01-26 10:22:41 -05:00
serge-sans-paille ef82063207 Rename llvm::array_lengthof into llvm::size to match std::size from C++17
As a conquence move llvm::array_lengthof from STLExtras.h to
STLForwardCompat.h (which is included by STLExtras.h so no build
breakage expected).
2022-01-26 16:17:45 +01:00
Simon Pilgrim 99ae5c13f6 [X86] Add 'getSplitVectorSrc' helper to determine if subvectors all come from the same source
Helps determine if the subvector ops come from the same larger vector and match the lower/upper extractions
2022-01-26 15:17:21 +00:00
Nikita Popov de8867a0b6 [AMDGPUEmitPrintf] Don't require specific pointer element type
Rather than checking for i8*, simply add a bitcast to i8*, so the
appendString() code sees the expected type.
2022-01-26 16:16:32 +01:00
Marek Kurdej 93948c5299 [clang-format] Correctly format lambdas with variadic template parameters.
Fixes https://github.com/llvm/llvm-project/issues/53405.

Reviewed By: MyDeveloperDay, owenpan

Differential Revision: https://reviews.llvm.org/D118220
2022-01-26 16:10:52 +01:00
Kadir Cetinkaya b777d354f6
[clang][DeclPrinter] Fix printing for noexcept expressions
We are already building into the final result, no need to append it
again.

Fixes https://github.com/clangd/vscode-clangd/issues/290.

Differential Revision: https://reviews.llvm.org/D118245
2022-01-26 16:04:24 +01:00
Matthias Springer 268524238e [mlir][bufferization] Add an option to use memref types without layout maps
This is for compatibility with existing bufferization passes. Also clean up memref type generation a bit.

Differential Revision: https://reviews.llvm.org/D118243
2022-01-27 00:03:34 +09:00
Marek Kurdej 1f3aa2af9d [Visualizers] Fix SmallVector<T> visualizer for T inside an anonymous namespace. Use `value_type` instead of `$T1`.
At least on MSVC 2022, using $T1 does not work.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D118105
2022-01-26 15:59:43 +01:00
Nemanja Ivanovic 0c56bc92e4 [PowerPC] Fix eq/ne comparison of v2i64 pre-Power8
In commit 1674d9b6b2, I fixed the bug where we didn't consider
both words of the result of the comparison. However, the logic
needs to be different for eq and ne.
Namely for eq, we need both words of the doubleword to equal so it
is an AND. OTOH for ne, we need either word to be unequal so it
is an OR.
2022-01-26 08:59:08 -06:00
Christian Sigg dc441d776f [NVPTX] NFC: Remove unused arguments and attribute from test 2022-01-26 15:57:27 +01:00
Jan Svoboda f720272330 [clang][lex] Include tracking: simplify and move to preprocessor
This patch replaces the exact include count of each file in `HeaderFileInfo` with a set of included files in `Preprocessor`.

The number of includes isn't a property of a header file but rather a preprocessor state. The exact number of includes is not used anywhere except statistic tracking.

Reviewed By: vsapsai

Differential Revision: https://reviews.llvm.org/D114095
2022-01-26 15:56:26 +01:00
Sam McCall 33c3ef2fbe [CodeCompletion][clangd] Clean __uglified parameter names in completion & hover
Underscore-uglified identifiers are used in standard library implementations to
guard against collisions with macros, and they hurt readability considerably.
(Consider `push_back(Tp_ &&__value)` vs `push_back(Tp value)`.
When we're describing an interface, the exact names of parameters are not
critical so we can drop these prefixes.

This patch adds a new PrintingPolicy flag that can applies this stripping
when recursively printing pieces of AST.
We set it in code completion/signature help, and in clangd's hover display.
All three features also do a bit of manual poking at names, so fix up those too.

Fixes https://github.com/clangd/clangd/issues/736

Differential Revision: https://reviews.llvm.org/D116387
2022-01-26 15:51:17 +01:00
Nikita Popov a5e324e3e2 [AMDGPUHSAMetadataStreamer] Do not assume ABI alignment for pointers
AMDGPUHSAMetadataStreamer currently assumes that pointer arguments
without align attribute have ABI alignment of the pointee type.
This is incompatible with opaque pointers, but also plain incorrect:
Pointer arguments without explicit alignment have alignment 1. It is
the responsibility of the frontent to add correct align annotations.

Differential Revision: https://reviews.llvm.org/D118229
2022-01-26 15:45:14 +01:00
David Spickett 070090d08e [lldb] Add option to show memory tags in memory read output
This adds an option --show-tags to "memory read".

(lldb) memory read mte_buf mte_buf+32 -f "x" -s8 --show-tags
0x900fffff7ff8000: 0x0000000000000000 0x0000000000000000 (tag: 0x0)
0x900fffff7ff8010: 0x0000000000000000 0x0000000000000000 (tag: 0x1)

Tags are printed on the end of each line, if that
line has any tags associated with it. Meaning that
untagged memory output is unchanged.

Tags are printed based on the granule(s) of memory that
a line covers. So you may have lines with 1 tag, with many
tags, no tags or partially tagged lines.

In the case of partially tagged lines, untagged granules
will show "<no tag>" so that the ordering is obvious.
For example, a line that covers 2 granules where the first
is not tagged:

(lldb) memory read mte_buf-16 mte_buf+16 -l32 -f"x" --show-tags
0x900fffff7ff7ff0: 0x00000000 <...> (tags: <no tag> 0x0)

Untagged lines will just not have the "(tags: ..." at all.
Though they may be part of a larger output that does have
some tagged lines.

To do this I've extended DumpDataExtractor to also print
memory tags where it has a valid execution context and
is asked to print them.

There are no special alignment requirements, simply
use "memory read" as usual. All alignment is handled
in DumpDataExtractor.

We use MakeTaggedRanges to find all the tagged memory
in the current dump, then read all that into a MemoryTagMap.

The tag map is populated once in DumpDataExtractor and re-used
for each subsequently printed line (or recursive call of
DumpDataExtractor, which some formats do).

Reviewed By: omjavaid

Differential Revision: https://reviews.llvm.org/D107140
2022-01-26 14:40:39 +00:00
Nikita Popov 903c3d2863 [SCEVExpander] Always use i8 GEP for reused value offset
We could keep the non-i8 GEP code for non-opaque pointers, but
there's two reasons I'm dropping it: First, this actually appears
to be dead code, at least it isn't hit in any of our tests. I
expect that this is because we usually expand trip counts, and
those are never pointers (anymore). Second, the non-i8 GEP was
actually incorrect in multiple ways, because it used SCEV type
sizes, which don't match DL type sizes (for pointers) and certainly
don't match type alloc sizes (which is what GEPs actually use).
As such, I'm simplifying the code to always use the i8 GEP code
path if it does get hit.
2022-01-26 15:38:58 +01:00
Alban Bridonneau 2feddb37b4 Implement correct cost for SVE bitcasts
We have some bitcasts which we know will be simplified,
so their cost is zero.

Reviewed By: david-arm, sdesmalen

Differential Revision: https://reviews.llvm.org/D118019
2022-01-26 14:25:44 +00:00
Sebastian Neubauer ecf7a0e338 [CMake] Disable mvsc warning for new versions
Starting with VS 2019, CMake defaults to the x64 host toolchain, so the
warning does not apply anymore.

References:
VS 2017 defaults to x86
https://cmake.org/cmake/help/latest/generator/Visual%20Studio%2015%202017.html?highlight=host#toolset-selection
VS 2019 and 2022 default to x64 for x64 targets
https://cmake.org/cmake/help/latest/generator/Visual%20Studio%2016%202019.html?highlight=host#toolset-selection
https://cmake.org/cmake/help/latest/generator/Visual%20Studio%2017%202022.html?highlight=host#toolset-selection

Differential Revision: https://reviews.llvm.org/D118228
2022-01-26 15:07:35 +01:00
David Spickett 8d714e4ad5 [lldb] Correct \params to \param in StackFrame Doxygen comments 2022-01-26 14:05:58 +00:00
David Spickett 5d2f90cbcd [lldb] Correct some uses of \b in Doxygen documentation 2022-01-26 14:05:58 +00:00
Abhina Sreeskantharajan 360af60e17 [SystemZ][z/OS] Add AutoConvert.h header to MemoryBuffer.cpp
This commit 75e164f61d removed the AutoConvert.h header causing a build break on z/OS. This patch adds it back to fix it.

Reviewed By: zibi

Differential Revision: https://reviews.llvm.org/D118129
2022-01-26 09:02:29 -05:00
LLVM GN Syncbot 8700b22cf6 [gn build] Port 37c4bd0fdb 2022-01-26 13:56:09 +00:00
David Spickett 37c4bd0fdb [lldb] Add MemoryTagMap class
The tag map holds a sparse set of memory tags and allows
you to query ranges for tags.

Granules that do not have tags will be set to llvm::None.
to keep the ordering intact. If there are no tags for the
requested range we'll just return an empty result so that
callers don't need to check that all values are llvm::None.

This will be combined with MemoryTagManager's MakeTaggedRanges:
* MakeTaggedRanges
* Read from all those ranges
* Insert the results into the tag map
* Give the tag map to whatever needs to print tags

Which in this case will be "memory read"/DumpDataExtractor.

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D112825
2022-01-26 13:55:48 +00:00
Nikita Popov 31c1842a7b [DSE] Add test with sret argument (NFC) 2022-01-26 14:25:31 +01:00
serge-sans-paille b48e378218 Cleanup LLVMTextAPI headers
Based on the output of iwyu. A full rebuild of llvm-project doesn't exhibit any
significant false dependencies.

The impact on preprocessed output is larger than expected, given the small
amount of changes

$ clang++ -E  -Iinclude -I../llvm/include ../llvm/lib/TextAPI/*.cpp -std=c++14 -fno-rtti -fno-exceptions | wc -l
before: 635319
After: 643716

Discourse thread on the topic: https://llvm.discourse.group/t/include-what-you-use-include-cleanup
2022-01-26 14:21:25 +01:00
Salman Javed c283c8dfb5 Rewrite Doxygen comment to resolve -Wdocumentation warning (NFC)
Comment change only, no functional change intended.
Example of warning:
https://lab.llvm.org/buildbot/#/builders/188/builds/8696/steps/4/logs/warnings__2_
2022-01-27 02:21:05 +13:00
Simon Moll 5ceb0bc7ea [VE] Packed 32/64bit broadcast isel and tests
Packed-mode broadcast of f32/i32 requires the subregister to be
replicated to the full I64 register prior. Add repl_i32 and repl_f32 to
faciliate this.

Reviewed By: kaz7

Differential Revision: https://reviews.llvm.org/D117878
2022-01-26 14:16:06 +01:00
serge-sans-paille 0984aa70da Fix conditional include in ThreadPool
Should fix  https://lab.llvm.org/buildbot#builders/37/builds/10259
2022-01-26 14:16:01 +01:00
Nikita Popov 03d0acc545 [DSE] Use helper for unwind check (NFCI)
This should be no functional change, as the cases supported by the
helper and the cases supported by DSE are currently the same, the
code structure is just slightly different.
2022-01-26 14:08:08 +01:00
Paul Walker e30525b6a5 [AArch64] Add NEON test cases for ISD::ABDS/U. 2022-01-26 13:05:57 +00:00
Andrzej Warzynski 718562a469 [flang][tco] Remove unneeded dependencies
`tco` does not generate machine code, so it does not require (machine)
code-gen related dependencies.

Differential Revision: https://reviews.llvm.org/D118112
2022-01-26 13:02:58 +00:00
Nathan Sidwell 4e5fce5848 [demangler] refactor SpecialSubKind
Code generating the special substitutions in std is a switch statement
with each case block containing the same conststruction template.  It
is more efficient to commonize that after the switch, having
determined which SubKind to create.  Also, let's sort the cases.

Reviewed By: ChuanqiXu

Differential Revision: https://reviews.llvm.org/D118131
2022-01-26 04:59:25 -08:00
Nathan Sidwell 52c7faeae8 [demangler] improve test harness
The demangler test harness is a little unclear.  The failed demangling
message always causes me to think about 'reality', changing to a
simple 'Found' seems clearer.

The expected-to-fail tests abort as soon as one passes, rather than
continue, and then abort if any passed.  This changes that loop to
fail at the end, in a similar manner to the expected-to-work loop.

Reviewed By: ChuanqiXu

Differential Revision: https://reviews.llvm.org/D118130
2022-01-26 04:59:25 -08:00
serge-sans-paille b58174d624 Cleanup headers for BinaryFormat
A few header removal, some forward declarations. As usual, this can
break your build due to false dependencies, the most notable change are:

- "llvm/BinaryFormat/AMDGPUMetadataVerifier.h" no longer includes "llvm/BinaryFormat/MsgPackDocument.h"

The impact on generated preprocessed lines for LLVMBinaryFormat is
pretty nice:

$ clang++ -E  -Iinclude -I../llvm/include ../llvm/lib/BinaryFormat/*.cpp -std=c++14 -fno-rtti -fno-exceptions | wc -l
before this patch: 705281
after this patch: 751456

Discourse thread on the topic: https://llvm.discourse.group/t/include-what-you-use-include-cleanup
2022-01-26 13:44:32 +01:00
Nicolas Vasilache e6ce2c0b8d [mlir][LLVM] Add support for operand_attrs to InlineAsmOp
This revision adds enough support to allow InlineAsmOp to work properly with indirect memory constraints "*m".
These require an explicit "elementtype" TypeAttr on the operands to pass LLVM verification and need to be provided.

Reviewed By: bkramer

Differential Revision: https://reviews.llvm.org/D118006
2022-01-26 07:42:35 -05:00
Simon Pilgrim ff64327a80 [X86] Extend PR53419 test coverage
Test on SSE2/SSE41/AVX1 targets to compare PMOVMSK vs PTEST codegen paths

Add v8i8 reduction case and test on X64 and X86 targets to check 32-bit handling
2022-01-26 12:32:49 +00:00
alex-t 5157f984ae [AMDGPU] Enable divergence-driven XNOR selection
Currently not (xor_one_use) pattern is always selected to S_XNOR irrelative od the node divergence.
This relies on further custom selection pass which converts to VALU if necessary and replaces with V_NOT_B32 ( V_XOR_B32)
on those targets which have no V_XNOR.
Current change enables the patterns which explicitly select the not (xor_one_use) to appropriate form.
We assume that xor (not) is already turned into the not (xor) by the combiner.

Reviewed By: rampitec

Differential Revision: https://reviews.llvm.org/D116270
2022-01-26 15:33:10 +03:00
LLVM GN Syncbot bfd5696b55 [gn build] Port 5da7c04003 2022-01-26 12:14:21 +00:00
Pavel Labath 4fa1ad0521 [lldb] Convert POSIXLog to use the new API 2022-01-26 13:10:10 +01:00
Paul Walker 66bd7ebdf7 [SVE] Use DUPM to handling more splat immediate cases.
NOTE: Only considers i64 based vectors at this time because smaller
element types require extra isel operand parsing.

Differential Revision: https://reviews.llvm.org/D118040
2022-01-26 12:04:44 +00:00
Salman Javed 5da7c04003 Re-land "Cache the locations of NOLINTBEGIN/END blocks" with fix for build bot 2022-01-27 01:03:27 +13:00
LLVM GN Syncbot 3d8fa00b2d [gn build] Port 8e29d19b8d 2022-01-26 11:52:58 +00:00
Salman Javed 8e29d19b8d Revert "[clang-tidy] Cache the locations of NOLINTBEGIN/END blocks"
Build warning here:
https://lab.llvm.org/buildbot/#/builders/57/builds/14322
2022-01-27 00:52:44 +13:00
LLVM GN Syncbot c5907f8a72 [gn build] Port 19eaad94c4 2022-01-26 11:47:14 +00:00
Nikita Popov 6b69985da4 [MemCpyOpt] Use helper for unwind check
This extends support to byval arguments. It would be further
extended to handle the case of non-captured noalias returns.
2022-01-26 12:43:31 +01:00
Stanislav Gatev d3597ec0aa [clang][dataflow] Enable merging distinct values in Environment::join
Make specializations of `DataflowAnalysis` extendable with domain-specific
logic for merging distinct values when joining environments. This could be
a strict lattice join or a more general widening operation.

This is part of the implementation of the dataflow analysis framework.
See "[RFC] A dataflow analysis framework for Clang AST" on cfe-dev.

Reviewed-by: xazax.hun

Differential Revision: https://reviews.llvm.org/D118038
2022-01-26 11:40:51 +00:00