platform/upstream/llvm.git
18 months ago[libc][Obvious] Temporarily disable log10_test for further investigation.
Tue Ly [Sun, 8 Jan 2023 23:21:30 +0000 (18:21 -0500)]
[libc][Obvious] Temporarily disable log10_test for further investigation.

18 months ago[libc][Obvious] Remove constexpr fomr exact_mult in double_double.h
Tue Ly [Sun, 8 Jan 2023 22:52:46 +0000 (17:52 -0500)]
[libc][Obvious] Remove constexpr fomr exact_mult in double_double.h

18 months ago[libc][math] Implement log10 function correctly rounded for all rounding modes
Tue Ly [Sun, 8 Jan 2023 22:19:13 +0000 (17:19 -0500)]
[libc][math] Implement log10 function correctly rounded for all rounding modes

Implement double precision log10 function correctly rounded for all
rounding modes.  This implementation currently needs FMA instructions for
correctness.

Use 2 passes:
Fast pass:
- 1 step range reduction with a lookup table of `2^7 = 128` elements to reduce the ranges to `[-2^-7, 2^-7]`.
- Use a degree-7 minimax polynomial generated by Sollya, evaluated using a mixed of double-double and double precisions.
- Apply Ziv's test for accuracy.
Accurate pass:
- Apply 5 more range reduction steps to reduce the ranges further to [-2^-27, 2^-27].
- Use a degree-4 minimax polynomial generated by Sollya, evaluated using 192-bit precisions.
- By the result of Lefevre (add quote), this is more than enough for correct rounding to all rounding modes.

In progress: Adding detail documentations about the algorithm.

Depend on: https://reviews.llvm.org/D136799

Reviewed By: zimmermann6

Differential Revision: https://reviews.llvm.org/D139846

18 months ago[AAUnderlyingObjects] Introduce an AA for getting underlying objects of a pointer
Shilei Tian [Sun, 8 Jan 2023 21:45:42 +0000 (16:45 -0500)]
[AAUnderlyingObjects] Introduce an AA for getting underlying objects of a pointer

This patch introduces a new AA `AAUnderlyingObjects`. It is basically like a wrapper
AA of the function `AA::getAssumedUnderlyingObjects`, but it can recursively do
query if the underlying object is an indirect access, such as a phi node or a select
instruction.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D141164

18 months ago[mlir][analysis] Add an analysis for preserving symbol tables
Jeff Niu [Thu, 8 Dec 2022 20:22:40 +0000 (12:22 -0800)]
[mlir][analysis] Add an analysis for preserving symbol tables

This patch adds a `SymbolTableAnalysis` that can be used with the
analysis manager. It contains a symbol table collection. This analysis
allows symbol tables to be preserved across passes so that they do not
need to be recomputed. The analysis assumes it remains valid because
most transformations automatically keep symbol tables up-to-date using
its `insert` and `erase` methods.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D139666

18 months ago[AArch64][compiler-rt] Option to build compiler-rt without FMV support.
Pavel Iliin [Fri, 30 Dec 2022 13:34:45 +0000 (13:34 +0000)]
[AArch64][compiler-rt] Option to build compiler-rt without FMV support.

This commit adds compiler-rt cmake option COMPILER_RT_DISABLE_AARCH64_FMV
which, when enabled, doesn't include function multiversioning features
initilization code in 'builtins' build.

Differential Revision: https://reviews.llvm.org/D141199

18 months ago[X86] Add shuffle test coverage for Issue #59860
Simon Pilgrim [Sun, 8 Jan 2023 19:05:54 +0000 (19:05 +0000)]
[X86] Add shuffle test coverage for Issue #59860

18 months ago[AVR] Optimize 32-bit shifts: optimize REG_SEQUENCE
Ayke van Laethem [Tue, 6 Dec 2022 13:47:31 +0000 (14:47 +0100)]
[AVR] Optimize 32-bit shifts: optimize REG_SEQUENCE

This pseudo-instruction stores two small (8-bit) registers into one wide
(16-bit) register. But apparently the order matters a lot to the
register allocator.
This patch changes the order of inserting the registers to optimize for
the best register allocation in the tests of shift32.ll. It might be
detrimental in other cases, but keeping the registers in the same
physical register seems like it would be a common case.

Differential Revision: https://reviews.llvm.org/D140573

18 months ago[AVR] Optimize 32-bit shifts: reverse shift + move
Ayke van Laethem [Tue, 6 Dec 2022 13:39:37 +0000 (14:39 +0100)]
[AVR] Optimize 32-bit shifts: reverse shift + move

This optimization turns shifts of almost a multiple of 8 into a shift
into the opposite direction. Unfortunately it doesn't compose well with
the other optimizations (I've tried) so it's separate from them.

Differential Revision: https://reviews.llvm.org/D140572

18 months ago[AVR] Optimize 32-bit shifts: shift by 4 bits
Ayke van Laethem [Tue, 6 Dec 2022 13:26:01 +0000 (14:26 +0100)]
[AVR] Optimize 32-bit shifts: shift by 4 bits

This uses a complicated shift sequence that avr-gcc also uses, but
extended to work over any number of bytes and in both directions
(logical shift left and logical shift right). Unfortunately it can't be
used for an arithmetic shift right: I've tried to come up with a
sequence but couldn't.

Differential Revision: https://reviews.llvm.org/D140571

18 months ago[AVR] Optimize 32-bit shift: move bytes around
Ayke van Laethem [Tue, 6 Dec 2022 12:58:08 +0000 (13:58 +0100)]
[AVR] Optimize 32-bit shift: move bytes around

This patch optimizes 32-bit constant shifts by renaming registers. This
is very effective as the compiler would otherwise need to do a lot of
single bit shift instructions. Instead, the registers are renamed at the
SSA level which means the register allocator will insert the necessary
mov instructions.

Unfortunately, the register allocator will insert some unnecessary movs
with the current code. This will be fixed in a later patch.

Differential Revision: https://reviews.llvm.org/D140570

18 months ago[AVR] Custom lower 32-bit shift instructions
Ayke van Laethem [Tue, 6 Dec 2022 12:43:23 +0000 (13:43 +0100)]
[AVR] Custom lower 32-bit shift instructions

32-bit shift instructions were previously expanded using the default
SelectionDAG expander, which meant it used 16-bit constant shifts and
ORed them together. This works, but is far from optimal.

I've optimized 32-bit shifts on AVR using a custom inserter. This is
done using three new pseudo-instructions that take the upper and lower
bits of the value in two separate 16-bit registers and outputs two
16-bit registers.

This is the first commit in a series. When completed, shift instructions
will take around 31% less instructions on average for constant 32-bit
shifts, and is in all cases equal or better than the old behavior. It
also tends to match or outperform avr-gcc: the only cases where avr-gcc
does better is when it uses a loop to shift, or when the LLVM register
allocator inserts some unnecessary movs. But it even outperforms avr-gcc
in some cases where avr-gcc does not use a loop.

As a side effect, non-constant 32-bit shifts also become more efficient.

For some real-world differences: the build of compiler-rt I use in
TinyGo becomes 2.7% smaller and the build of picolibc I use becomes 0.9%
smaller. I think picolibc is a better representation of real-world code,
but even a ~1% reduction in code size is really significant.

The current patch just lays the groundwork. The result is actually a
regression in code size. Later patches will use this as a basis to
optimize these shift instructions.

Differential Revision: https://reviews.llvm.org/D140569

18 months ago[gn] port b712aef5b37e
Nico Weber [Sun, 8 Jan 2023 18:24:53 +0000 (13:24 -0500)]
[gn] port b712aef5b37e

18 months ago[gn build] Port 86aac87fe4b5
Nico Weber [Sun, 8 Jan 2023 18:22:18 +0000 (13:22 -0500)]
[gn build] Port 86aac87fe4b5

18 months ago[SelectionDAG][AVR] Add support for lrint and lround intrinsics
Ayke van Laethem [Sun, 1 Jan 2023 18:05:35 +0000 (19:05 +0100)]
[SelectionDAG][AVR] Add support for lrint and lround intrinsics

Integer legalization already supported splitting the output integer of
llround and llrint, but did not support this for lround and lrint yet.
This is not a problem for 32-bit architectures, but for 8/16-bit
architectures like AVR it results in a crash like this:

    ExpandIntegerResult #0: t7: i32 = lround t6

    LLVM ERROR: Do not know how to expand the result of this operator!

This patch simply add lrint/lround to the list of ISD opcodes to expand.

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

Differential Revision: https://reviews.llvm.org/D140822

18 months ago[AVR] correctly declare __do_copy_data and __do_clear_bss
Ayke van Laethem [Mon, 2 Jan 2023 00:21:19 +0000 (01:21 +0100)]
[AVR] correctly declare __do_copy_data and __do_clear_bss

These two symbols are declared in object files to indicate whether .data
needs to be copied from flash or .bss needs to be cleared. They are
supported on avr-gcc and reduce firmware size a bit, which is especially
important on very small chips.

I checked the behavior of avr-gcc and matched it as well as possible.
From my investigation, it seems to work as follows:

__do_copy_data is set when the compiler finds a data symbol:
  * without a section name
  * with a section name starting with ".data" or ".gnu.linkonce.d"
  * with a section name starting with ".rodata" or ".gnu.linkonce.r" and
    flash and RAM are in the same address space

__do_clear_bss is set when the compiler finds a data symbol:
  * without a section name
  * with a section name that starts with .bss

Simply checking whether the calculated section name starts with ".data",
".rodata" or ".bss" should result in the same behavior.

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

Differential Revision: https://reviews.llvm.org/D140830

18 months ago[X86][Disassembler][NFCI] Read bytes with support::endian::read
Benjamin Kramer [Sun, 8 Jan 2023 17:19:01 +0000 (18:19 +0100)]
[X86][Disassembler][NFCI] Read bytes with support::endian::read

18 months ago[InstCombine] fold not-shift of signbit to icmp+zext, part 2
Sanjay Patel [Sun, 8 Jan 2023 16:36:21 +0000 (11:36 -0500)]
[InstCombine] fold not-shift of signbit to icmp+zext, part 2

Follow-up to:
6c39a3aae1dc

That converted a pattern with ashr directly to icmp+zext, and
this updates the pattern that we used to convert to.

This canonicalizes to icmp for better analysis in the minimum case
and shortens patterns where the source type is not the same as dest type:
https://alive2.llvm.org/ce/z/tpXJ64
https://alive2.llvm.org/ce/z/dQ405O

This requires an adjustment to an icmp transform to avoid infinite looping.

18 months ago[OpenMP] Migrate OpenMPOffloadMappingFlags from Clang CodeGen to OMPConstants
Akash Banerjee [Sun, 8 Jan 2023 16:45:12 +0000 (16:45 +0000)]
[OpenMP] Migrate OpenMPOffloadMappingFlags from Clang CodeGen to OMPConstants

This patch moves the OpenMPOffloadMappingFlags enum definiition from Clang codegen to OMPConstants.h

Differential Revision: https://reviews.llvm.org/D140292

18 months ago[NFCI][Offload Bundler] Replace hand-rolled endian conversion with llvm::support
Benjamin Kramer [Sun, 8 Jan 2023 16:32:54 +0000 (17:32 +0100)]
[NFCI][Offload Bundler] Replace hand-rolled endian conversion with llvm::support

18 months ago[NFC] Hide implementation details in anonymous namespaces
Benjamin Kramer [Sun, 8 Jan 2023 16:25:29 +0000 (17:25 +0100)]
[NFC] Hide implementation details in anonymous namespaces

18 months ago[libc++] Granularize <bit> and remove <__bits>
Nikolas Klauser [Tue, 27 Dec 2022 01:31:38 +0000 (02:31 +0100)]
[libc++] Granularize <bit> and remove <__bits>

Reviewed By: Mordante, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D141225

18 months ago[VPlan] Keep entries in worklist in sinkScalarOperands.
Florian Hahn [Sun, 8 Jan 2023 15:52:00 +0000 (15:52 +0000)]
[VPlan] Keep entries in worklist in sinkScalarOperands.

Not removing the entries ensures that duplicates are avoided,
reducing the number of iterations.

18 months ago[libc++][CI] Fixes robust against ADL for C++03.
Mark de Wever [Wed, 28 Dec 2022 19:02:01 +0000 (20:02 +0100)]
[libc++][CI] Fixes robust against ADL for C++03.

This was disabled in D139545.

Reviewed By: philnik, #libc

Differential Revision: https://reviews.llvm.org/D140731

18 months ago[clang-tidy][NFC] Remove unused User argument in misc-misleading-bidirectional check
Carlos Galvez [Fri, 6 Jan 2023 11:02:33 +0000 (11:02 +0000)]
[clang-tidy][NFC] Remove unused User argument in misc-misleading-bidirectional check

It's not used anywhere.

Differential Revision: https://reviews.llvm.org/D141118

18 months ago[clangd] Fix an inlay-hint crash on a null deduced type.
Haojian Wu [Sat, 7 Jan 2023 21:59:50 +0000 (22:59 +0100)]
[clangd] Fix an inlay-hint crash on a null deduced type.

18 months ago[libc++] [C++20] [P0415] Constexpr for std::complex.
Marek Kurdej [Thu, 15 Dec 2022 01:19:59 +0000 (02:19 +0100)]
[libc++] [C++20] [P0415] Constexpr for std::complex.

This patch adds constexpr to <complex> header: operators, member operators, and member functions (real, imag, norm, conj).

https://eel.is/c++draft/complex.numbers
https://wg21.link/p0415

Reviewed By: ldionne, #libc

Spies: philnik, danilaml, Quuxplusone, wmaxey, arichardson, libcxx-commits

Differential Revision: https://reviews.llvm.org/D79555

18 months ago[SVE] Fix incorrect VT usage when lowering fixed length vector divides.
Paul Walker [Tue, 20 Dec 2022 01:39:31 +0000 (01:39 +0000)]
[SVE] Fix incorrect VT usage when lowering fixed length vector divides.

Ensure the negation required when lowering negative power-of-two
divides uses the scalable vector container type with the fixed
length result extracted from it.

Fixes: #59647

Differential Revision: https://reviews.llvm.org/D140563

18 months ago[C++20][Modules] Do not allow non-inline external definitions in header units.
Iain Sandoe [Sat, 17 Dec 2022 15:33:07 +0000 (15:33 +0000)]
[C++20][Modules] Do not allow non-inline external definitions in header units.

[module.import/6] last sentence:
A header unit shall not contain a definition of a non-inline function or
variable whose name has external linkage.

Differential Revision: https://reviews.llvm.org/D140261

18 months agoApply clang-tidy fixes for llvm-qualified-auto in ModuleImport.cpp (NFC)
Mehdi Amini [Sat, 7 Jan 2023 01:07:20 +0000 (01:07 +0000)]
Apply clang-tidy fixes for llvm-qualified-auto in ModuleImport.cpp (NFC)

18 months agoApply clang-tidy fixes for readability-simplify-boolean-expr in Vectorization.cpp...
Mehdi Amini [Fri, 6 Jan 2023 22:49:44 +0000 (22:49 +0000)]
Apply clang-tidy fixes for readability-simplify-boolean-expr in Vectorization.cpp (NFC)

18 months agolibc++: bring back the unsigned in the return type in wcstoull_l
Sylvestre Ledru [Sat, 7 Jan 2023 23:32:42 +0000 (00:32 +0100)]
libc++: bring back the unsigned in the return type in wcstoull_l

got remove here:
https://github.com/llvm/llvm-project/commit/67b0b02ec9f2bbc57bf8f0550828d97f460ac11f#diff-e41832b8aa26da45585a57c5111531f2e1d07e91a67c4f8bf1cd6d566ae45a2bR42

Differential Revision: https://reviews.llvm.org/D141208

18 months agoImplement CWG2631
Corentin Jabot [Sun, 23 Oct 2022 15:32:58 +0000 (17:32 +0200)]
Implement CWG2631

Implement https://cplusplus.github.io/CWG/issues/2631.html.

Immediate calls in default arguments and defaults members
are not evaluated.

Instead, we evaluate them when constructing a
`CXXDefaultArgExpr`/`BuildCXXDefaultInitExpr`.

The immediate calls are executed by doing a
transform on the initializing expression.

Note that lambdas are not considering subexpressions so
we do not need to transform them.

As a result of this patch, unused default member
initializers are not considered odr-used, and
errors about members binding to local variables
in an outer scope only surface at the point
where a constructor is defined.

Reviewed By: aaron.ballman, #clang-language-wg, rupprecht

Differential Revision: https://reviews.llvm.org/D136554

18 months ago[InstCombine] Combine (zext a) mul (zext b) to llvm.umul.with.overflow only if mul...
luxufan [Sun, 8 Jan 2023 06:27:43 +0000 (14:27 +0800)]
[InstCombine] Combine (zext a) mul (zext b) to llvm.umul.with.overflow only if mul has NUW flag

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

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D141031

18 months agoflang] Remove remaining uses of llvm::Optional (NFC)
Kazu Hirata [Sun, 8 Jan 2023 06:32:38 +0000 (22:32 -0800)]
flang] Remove remaining uses of llvm::Optional (NFC)

This patch removes the unused "using" declaration and removes #include
"llvm/ADT/Optional.h".

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

18 months ago[flang] Use std::optional instead of llvm::Optional (NFC)
Kazu Hirata [Sun, 8 Jan 2023 06:26:48 +0000 (22:26 -0800)]
[flang] Use std::optional instead of llvm::Optional (NFC)

This patch replaces (llvm::|)Optional< with std::optional<.  I'll post
a separate patch to remove #include "llvm/ADT/Optional.h".

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

18 months ago[flang] Add #include <optional> (NFC)
Kazu Hirata [Sun, 8 Jan 2023 04:55:47 +0000 (20:55 -0800)]
[flang] Add #include <optional> (NFC)

This patch adds #include <optional> to those files containing
llvm::Optional<...> or Optional<...>.

I'll post a separate patch to actually replace llvm::Optional with
std::optional.

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

18 months ago[clang-tools-extra] Remove remaining uses of llvm::Optional (NFC)
Kazu Hirata [Sun, 8 Jan 2023 04:34:53 +0000 (20:34 -0800)]
[clang-tools-extra] Remove remaining uses of llvm::Optional (NFC)

This patch removes the unused "using" declaration and removes #include
"llvm/ADT/Optional.h".

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

18 months ago[clang-tools-extra] Use std::optional instead of llvm::Optional (NFC)
Kazu Hirata [Sun, 8 Jan 2023 04:19:42 +0000 (20:19 -0800)]
[clang-tools-extra] Use std::optional instead of llvm::Optional (NFC)

This patch replaces (llvm::|)Optional< with std::optional<.  I'll post
a separate patch to clean up the "using" declarations, #include
"llvm/ADT/Optional.h", etc.

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

18 months ago[clang-tools-extra] Add #include <optional> (NFC)
Kazu Hirata [Sun, 8 Jan 2023 04:02:20 +0000 (20:02 -0800)]
[clang-tools-extra] Add #include <optional> (NFC)

This patch adds #include <optional> to those files containing
llvm::Optional<...> or Optional<...>.

I'll post a separate patch to actually replace llvm::Optional with
std::optional.

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

18 months agoRevert "AMDGPU: Invert handling of enqueued block detection"
Matt Arsenault [Sun, 8 Jan 2023 02:39:04 +0000 (21:39 -0500)]
Revert "AMDGPU: Invert handling of enqueued block detection"

This reverts commit 47288cc977fa31c44cc92b4e65044a5b75c2597e.

The runtime is having trouble with this at -O0 when the inputs are
always enabled.

18 months ago[lldb] Remove remaining uses of llvm::Optional (NFC)
Kazu Hirata [Sat, 7 Jan 2023 22:36:35 +0000 (14:36 -0800)]
[lldb] Remove remaining uses of llvm::Optional (NFC)

This patch removes the unused "using" declarations, updates comments,
and removes #include "llvm/ADT/Optional.h".

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

18 months ago[lldb] Use std::optional instead of llvm::Optional (NFC)
Kazu Hirata [Sat, 7 Jan 2023 22:18:35 +0000 (14:18 -0800)]
[lldb] Use std::optional instead of llvm::Optional (NFC)

This patch replaces (llvm::|)Optional< with std::optional<.  I'll post
a separate patch to clean up the "using" declarations, #include
"llvm/ADT/Optional.h", etc.

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

18 months ago[lldb] Add #include <optional> (NFC)
Kazu Hirata [Sat, 7 Jan 2023 21:43:00 +0000 (13:43 -0800)]
[lldb] Add #include <optional> (NFC)

This patch adds #include <optional> to those files containing
llvm::Optional<...> or Optional<...>.

I'll post a separate patch to actually replace llvm::Optional with
std::optional.

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

18 months agoclang/AMDGPU: Force disable block enqueue arguments for HIP
Matt Arsenault [Sat, 7 Jan 2023 18:06:52 +0000 (13:06 -0500)]
clang/AMDGPU: Force disable block enqueue arguments for HIP

This is a dirty, dirty hack to workaround bot failures at
-O0. Currently these fields are only used by OpenCL features and
evidently the HIP runtime isn't expecting to see them in HIP
programs. The code objects should be language agnostic, so just force
optimize these out until the runtime is fixed.

18 months ago[llvm-driver] Mark some tests unsupported
Alex Brachet [Sat, 7 Jan 2023 17:45:26 +0000 (17:45 +0000)]
[llvm-driver] Mark some tests unsupported

These tests rely on making symlinks to unkown tool names which will
fail when in the llvm-driver build.

18 months ago[lldb] clang-format PathMappingList.cpp
Kazu Hirata [Sat, 7 Jan 2023 17:38:44 +0000 (09:38 -0800)]
[lldb] clang-format PathMappingList.cpp

This patch clang-formats AppendPathComponents in PathMappingList.cpp.

Without this patch, clang-format would indent the body of the
following function by four spaces.

18 months ago[BPF] generate btf_decl_tag records for params of extern functions
Eduard Zingerman [Sat, 7 Jan 2023 17:29:02 +0000 (09:29 -0800)]
[BPF] generate btf_decl_tag records for params of extern functions

After frontend changes in the following commit:
"BPF: preserve btf_decl_tag for parameters of extern functions"
same mechanics could be used to get the list of function parameters
and associated btf_decl_tag entries for both extern and non-extern
functions.

This commit extracts this mechanics as a separate auxiliary function
BTFDebug::processDISubprogram(). The function is called for both
extern and non-extern functions in order to generated corresponding
BTF_DECL_TAG records.

Differential Revision: https://reviews.llvm.org/D140971

18 months ago[AVR] Fix incorrect decoding of RJMP and RCALL
Ben Shi [Sat, 7 Jan 2023 06:33:24 +0000 (14:33 +0800)]
[AVR] Fix incorrect decoding of RJMP and RCALL

This patch fixes the inaccurate decoding of the offset operand of
the RCALL & RJMP instructions.

Reviewed By: aykevl, MaskRay

Differential Revision: https://reviews.llvm.org/D140815

18 months ago[SPIR-V] Map IR function pointers to registers in ModuleAnalysis
Michal Paszkowski [Sat, 7 Jan 2023 14:25:53 +0000 (15:25 +0100)]
[SPIR-V] Map IR function pointers to registers in ModuleAnalysis

SPIRVModuleAnalysis collects module and external function registers
(usually result of OpFunction) for use when emitting OpFunctionCall.
This patch makes the mapping between the functions and registers using
pointers (instead of name strings) to ensure anonymous functions and
calls can be resolved properly.

Differential Revision: https://reviews.llvm.org/D140548

18 months ago[ARM][AArch64] Add tests for And/Or into CSel fold. NFC
David Green [Sat, 7 Jan 2023 14:08:29 +0000 (14:08 +0000)]
[ARM][AArch64] Add tests for And/Or into CSel fold. NFC

18 months ago[libc++] remove weird empty line
Backl1ght [Sat, 7 Jan 2023 09:19:16 +0000 (17:19 +0800)]
[libc++] remove weird empty line

Differential Revision: https://reviews.llvm.org/D141181

18 months ago[LoongArch] Reorder code and inline variable in lowerGlobalTLSAddress for clarity...
wanglei [Sat, 7 Jan 2023 07:22:47 +0000 (15:22 +0800)]
[LoongArch] Reorder code and inline variable in lowerGlobalTLSAddress for clarity. NFC

18 months ago[BPF] preserve btf_decl_tag for parameters of extern functions
Eduard Zingerman [Sat, 7 Jan 2023 06:45:09 +0000 (22:45 -0800)]
[BPF] preserve btf_decl_tag for parameters of extern functions

Generate DILocalVariable entries for parameters of extern functions,
the "annotations" field of DILocalVariable is used to link
"btf_decl_tag" annotation with the parameter.

Do this only for BPF backend as there are no other users for this
information. Final DWARF is valid as "Appendix A" is very much lax in
what is allowed as attributes for "DW_TAG_formal_parameter":

    DWARF does not in general require that a given debugging information
    entry contain a particular attribute or set of attributes. Instead,
    a DWARF producer is free to generate any, all, or none of the
    attributes ... other attributes ... may also appear in a given
    debugging information entry.

DWARF Debugging Information Format Version 5,
Appendix A: Attributes by Tag Value (Informative)
Page 251, Line 3.

Differential Revision: https://reviews.llvm.org/D140970

18 months ago[BPF] Triple::isBPF() utility method
Eduard Zingerman [Sat, 7 Jan 2023 06:35:25 +0000 (22:35 -0800)]
[BPF] Triple::isBPF() utility method

Adds a utility method llvm::Triple::isBPF() aggregating Triple::bpfel
and Triple::bpfeb architectures. Similar to other predicates in this class.

Differential Revision: https://reviews.llvm.org/D140969

18 months ago[LoongArch] Move illegal ImmArg tests to llvm/test/Verifier
gonglingqin [Sat, 7 Jan 2023 02:38:41 +0000 (10:38 +0800)]
[LoongArch] Move illegal ImmArg tests to llvm/test/Verifier

This patch also fixes incorrect function declarations in test cases
and remove -disable-verify from the test case.

Fix https://github.com/llvm/llvm-project/issues/59839

18 months ago[libc++][test][NFC] revert indentation damage
Casey Carter [Fri, 6 Jan 2023 21:29:43 +0000 (13:29 -0800)]
[libc++][test][NFC] revert indentation damage

... from d65e66abb3bd4535e1900c0c7901c0f6254acf34.

Differential Revision: https://reviews.llvm.org/D141157

18 months ago[Clang] Fix warning on unused varaible
Joseph Huber [Sat, 7 Jan 2023 03:14:05 +0000 (21:14 -0600)]
[Clang] Fix warning on unused varaible

Summary:
Don't check the flag this way, it leads to unused variables. Fix.

18 months ago[AVR] Fix some ambiguous cases in AsmParser
Ben Shi [Fri, 30 Dec 2022 12:07:16 +0000 (20:07 +0800)]
[AVR] Fix some ambiguous cases in AsmParser

Some specific operands in specific instructions should be treated
as variables/symbols/labels, other than registers.

This patch fixes those ambiguous cases, such as "lds r25, r24",
which means loading the value inside symbol 'r24' into register 'r25'.

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

Reviewed by: aykevl

Differential Revision: https://reviews.llvm.org/D140777

18 months agoAMDGPU: Use getTypeAllocSize
Matt Arsenault [Fri, 6 Jan 2023 23:34:04 +0000 (18:34 -0500)]
AMDGPU: Use getTypeAllocSize

18 months agoAMDGPU: Use more accurate IR type for block handle
Matt Arsenault [Fri, 23 Dec 2022 20:52:41 +0000 (15:52 -0500)]
AMDGPU: Use more accurate IR type for block handle

The device library uses this as a struct with a pointer sized integer
and 2 ints.

18 months agoAMDGPU: Add more opencl printf tests
Matt Arsenault [Fri, 6 Jan 2023 22:34:02 +0000 (17:34 -0500)]
AMDGPU: Add more opencl printf tests

18 months agoAMDGPU: Invert handling of enqueued block detection
Matt Arsenault [Fri, 23 Dec 2022 21:18:43 +0000 (16:18 -0500)]
AMDGPU: Invert handling of enqueued block detection

Invert the sense of the attribute and let the attributor figure this
out like everything else. If needed we can have the not-OpenCL
languages set amdgpu-no-default-queue and amdgpu-no-completion-action
up front so they never have to pay the cost.

There are also so many of these now, the offset use API should
probably consider all of them at once. Maybe they should merge into
one attribute with used fields. Having separate functions for each
field in AMDGPUBaseInfo is also not the greatest API (might as well
fix this when the patch to get the object version from the module
lands).

18 months agoAMDGPU: Fix enqueue block lowering for opaque pointers
Matt Arsenault [Fri, 23 Dec 2022 20:39:55 +0000 (15:39 -0500)]
AMDGPU: Fix enqueue block lowering for opaque pointers

This was looking for a specific constant cast of the function, when
the type doesn't matter. Doesn't bother trying to handle typed
pointers, it will just assert.

Things probably don't work completely correctly if the block kernel
address is captured somewhere else, but that wouldn't work before
either. The uses should really be loads out of the handle, and the
handle initializer should contain the kernel address.

18 months agoAMDGPU: Convert enqueue-kernel.ll to opaque pointers
Matt Arsenault [Fri, 23 Dec 2022 22:14:06 +0000 (17:14 -0500)]
AMDGPU: Convert enqueue-kernel.ll to opaque pointers

This demonstrates the pass is broken with them, the follow up change
will fix it.

18 months ago[Clang] Fix mispelled option passed to the linker wrapper
Joseph Huber [Sat, 7 Jan 2023 02:02:23 +0000 (20:02 -0600)]
[Clang] Fix mispelled option passed to the linker wrapper

Summary:
This option was spelled wrong and caused errors if used in combination
with the linking job. Fix it.

18 months ago[OpenMP] Introduce '-f[no-]openmp-target-jit' flag to control JIT for offloading
Joseph Huber [Fri, 6 Jan 2023 21:22:12 +0000 (15:22 -0600)]
[OpenMP] Introduce '-f[no-]openmp-target-jit' flag to control JIT for offloading

JIT support for OpenMP offloading was introduced in D139287. This patch
adds a simple flag that enables this mode. It simply requires enabling
`-foffload-lto` mode and `--embed-bitcode` in the linker wrapper. This
option implies LTO if it is not enabled.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D141158

18 months ago[SLP][NFC]Fix compile build by declaring ArrayRef, NFC.
Alexey Bataev [Sat, 7 Jan 2023 01:01:48 +0000 (17:01 -0800)]
[SLP][NFC]Fix compile build by declaring ArrayRef, NFC.

Fix compiler build reported in https://lab.llvm.org/buildbot#builders/243/builds/218

18 months ago[SLP][NFC]Remove unused variables, NFC.
Alexey Bataev [Sat, 7 Jan 2023 00:55:54 +0000 (16:55 -0800)]
[SLP][NFC]Remove unused variables, NFC.

18 months ago[SLP]Fix incorrect reordering of clustered scalars.
Alexey Bataev [Fri, 6 Jan 2023 19:07:22 +0000 (11:07 -0800)]
[SLP]Fix incorrect reordering of clustered scalars.

The new mask represents the order, not the mask itself. At first, need
to treat as the order, convert to mask and only after that reorder
gathered scalars to build correct clustered order.

Differential Revision: https://reviews.llvm.org/D141161

18 months ago[libc] Add a separate install target for the libc static archives.
Siva Chandra Reddy [Fri, 6 Jan 2023 08:21:49 +0000 (08:21 +0000)]
[libc] Add a separate install target for the libc static archives.

Also, skip installing startup objects for baremetal targets for now.

Reviewed By: michaelrj

Differential Revision: https://reviews.llvm.org/D141112

18 months ago[mlir][spirv] Add folder for LogicalNotEqual
Thomas Raoux [Fri, 6 Jan 2023 23:03:12 +0000 (23:03 +0000)]
[mlir][spirv] Add folder for LogicalNotEqual

Add a folder for LogicalNotEqual when rhs is false. This pattern shows
up after lowering to SPIRV.

Differential Revision: https://reviews.llvm.org/D141163

18 months ago[DebugInfo] Add support for variadic DBG_INSTR_REFs in LiveDebugValues
Stephen Tozer [Tue, 3 Jan 2023 13:53:25 +0000 (13:53 +0000)]
[DebugInfo] Add support for variadic DBG_INSTR_REFs in LiveDebugValues

Following support from the previous patches in this stack being added for
variadic DBG_INSTR_REFs to exist, this patch modifies LiveDebugValues to
handle those instructions. Support already exists for DBG_VALUE_LISTs, which
covers most of the work needed to handle these instructions; this patch only
modifies the transferDebugInstrRef function to correctly track them.

Reviewed By: jmorse

Differential Revision: https://reviews.llvm.org/D133927

18 months ago[MLIR][TOSA] Switch Tosa to DenseArrayAttr
Alexander Shaposhnikov [Fri, 6 Jan 2023 22:57:14 +0000 (22:57 +0000)]
[MLIR][TOSA] Switch Tosa to DenseArrayAttr

This diff completes switching Tosa to DenseArrayAttr.

Test plan: ninja check-mlir check-all

Differential revision: https://reviews.llvm.org/D141111

18 months ago[Fix][-Wunsafe-buffer-usage] Add a new `forEachDescendant` matcher that skips callabl...
ziqingluo-90 [Fri, 6 Jan 2023 22:29:19 +0000 (14:29 -0800)]
[Fix][-Wunsafe-buffer-usage] Add a new `forEachDescendant` matcher that skips callable declarations

The original patch does include a `new` statement without a matching
`delete`, causing Sanitizer warnings in
https://lab.llvm.org/buildbot/#/builders/5/builds/30522/steps/13/logs/stdio.

This commit is a fix to it.

Differential Revision: https://reviews.llvm.org/D138329

18 months agoAMDGPU: Try to fix 32-bit build bot
Matt Arsenault [Fri, 6 Jan 2023 22:33:56 +0000 (17:33 -0500)]
AMDGPU: Try to fix 32-bit build bot

18 months ago[ubsan][test] Fix typo in D139230
Roy Sundahl [Mon, 19 Dec 2022 18:31:22 +0000 (10:31 -0800)]
[ubsan][test] Fix typo in D139230

Fix "runtime runtime error" -> "runtime error"

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D140321

18 months agoAMDGPU: Use BinaryByteStream in printf expansion
Matt Arsenault [Fri, 6 Jan 2023 17:51:10 +0000 (12:51 -0500)]
AMDGPU: Use BinaryByteStream in printf expansion

Attempt to fix test failures on big endian bots. This pass definitely
needs more test coverage.

18 months agoAMDGPU: Add additional printf string tests
Matt Arsenault [Fri, 6 Jan 2023 18:37:31 +0000 (13:37 -0500)]
AMDGPU: Add additional printf string tests

Test various inputs passed to %s.

18 months ago[mlir][tensor] Add producer fusion for tensor.unpack op.
Hanhan Wang [Fri, 6 Jan 2023 18:49:08 +0000 (10:49 -0800)]
[mlir][tensor] Add producer fusion for tensor.unpack op.

Reviewed By: mravishankar

Differential Revision: https://reviews.llvm.org/D141151

18 months ago[Support] On Windows 11 and Windows Server 2022, fix an affinity mask issue on large...
Alexandre Ganea [Thu, 5 Jan 2023 20:27:30 +0000 (15:27 -0500)]
[Support] On Windows 11 and Windows Server 2022, fix an affinity mask issue on large core count machines

Before Windows 11 and Windows Server 2022, only one 'processor group' is assigned by default to a starting process, then the program is responsible for dispatching its own threads on more 'processor groups'. That is what 8404aeb56a73ab24f9b295111de3b37a37f0b841 was doing, allowing LLVM tools to automatically use all hardware threads in the machine.

After Windows 11 and Windows Server 2022, the OS takes care of that. This has an adverse effect reported in #56618 which is that using `GetProcessAffinityMask()` API in some edge cases seems buggy now. That API is used to detect if an affinity mask was set, and adjust accordingly the available threads for a ThreadPool.

With this patch, on one hand, we let the OS dispatch threads on all 'processor groups', but only for Windows 11 & Windows Server 2022 and after. We retain the old behavior for older OS versions. On the other hand, a workaround was added to mitigate the `GetProcessAffinityMask()` issue described above (see Threading.inc, L226).

Differential Revision: https://reviews.llvm.org/D138747

18 months ago[mlir][py] Fix python modules build with clang-cl due to requiring exceptions
Markus Böck [Fri, 6 Jan 2023 21:48:02 +0000 (22:48 +0100)]
[mlir][py] Fix python modules build with clang-cl due to requiring exceptions

The generator expression previously used to enable exceptions would not work since the compiler id of clang-cl is Clang, even if used via clang-cl.

The patch fixes that by replacing the generator expression with simple logic, setting the right compiler flags for all MSVC like compilers (including clang-cl) and all GCC like compilers.

Differential Revision: https://reviews.llvm.org/D141155

18 months ago[BOLT][DWARF] Change rangelists to use DW_RLE_offset_pair
Alexander Yermolovich [Fri, 6 Jan 2023 21:45:43 +0000 (13:45 -0800)]
[BOLT][DWARF] Change rangelists to use DW_RLE_offset_pair

Before we always used DW_RLE_startx_length. This is not very efficient and leads
to bigger .debug_addr section. Changed it to use
DW_RLE_base_addressx/DW_RLE_offset_pair.

clang-16 build in debug mode
llvm-bolt ran on it with --update-debug-sections
| section | before | after | diff | % decrease |
| .debug_rnglists | 32732292 | 31986051 | -746241 | 2.3% |
| .debug_addr | 14415808 | 14184128 |  -231680 | 1.6% |

Reviewed By: maksfb

Differential Revision: https://reviews.llvm.org/D140439

18 months agoRevert "[Fix][-Wunsafe-buffer-usage] Add a new `forEachDescendant` matcher that skips...
ziqingluo-90 [Fri, 6 Jan 2023 21:37:13 +0000 (13:37 -0800)]
Revert "[Fix][-Wunsafe-buffer-usage] Add a new `forEachDescendant` matcher that skips callable declarations"

This reverts commit 6d140b952805bd9277fba666520ce46c19f2c637.

This commit may causes `test/SemaCXX/warn-unsafe-buffer-usage.cpp` failure.

18 months ago[Fix][-Wunsafe-buffer-usage] Add a new `forEachDescendant` matcher that skips callabl...
ziqingluo-90 [Fri, 6 Jan 2023 20:30:11 +0000 (12:30 -0800)]
[Fix][-Wunsafe-buffer-usage] Add a new `forEachDescendant` matcher that skips callable declarations

The original patch does include a `new` statement without a matching
`delete`, causing Sanitizer warnings in
https://lab.llvm.org/buildbot/#/builders/5/builds/30522/steps/13/logs/stdio.

This commit is a fix to it.

Differential Revision: https://reviews.llvm.org/D138329

18 months ago[mlir][Arith] Remove expansions of integer min and max ops
Krzysztof Drewniak [Mon, 2 Jan 2023 21:24:39 +0000 (21:24 +0000)]
[mlir][Arith] Remove expansions of integer min and max ops

As of several months ago, both ArithToLLVM and ArithToSPIRV have
native support for integer min and max operations. Since these are all
the targets available in MLIR core, the need to "expand" arith.minui,
arith.minsi, arith,maxsi, and arith.manxui to more primitive
operations is to longer present.

Therefore, the expanding of integer min and max operations in Arith,
while correct, is likely to lead to performance loss by way of
misoptimization further down the line, and is no longer needed for
anyone's correctness.

This change may break downstream tests, but will not affect the
semantics of MLIR programs.

arith.minf and arith.maxf have a lot of underlying complexity due to
the many different possible NaN and signed zero semantics available on
various platforms, and so removing their expansion is left to a future
commit.

Reviewed By: ThomasRaoux, Mogball

Differential Revision: https://reviews.llvm.org/D140856

18 months ago[-Wunsafe-buffer-usage] Changing the use of None with std::nullopt to address a warning.
MalavikaSamak [Fri, 6 Jan 2023 20:18:40 +0000 (12:18 -0800)]
[-Wunsafe-buffer-usage] Changing the use of None with std::nullopt to address a warning.

18 months ago[mlir] Add header file for ssize_t
Ashay Rane [Fri, 6 Jan 2023 20:29:04 +0000 (21:29 +0100)]
[mlir] Add header file for ssize_t

ssize_t is part of POSIX and not standard C/C++, so using ssize_t
without the necessary header files causes the build to fail on Windows
with the following error: 'ssize_t': undeclared identifier.

This patch includes llvm/Support/DataTypes.h to resolve the problem.

Differential Revision: https://reviews.llvm.org/D141149

18 months ago[-Wunsafe-buffer-usage] Safe-buffers re-architecture to introduce Fixable gadgets
MalavikaSamak [Fri, 6 Jan 2023 19:33:49 +0000 (11:33 -0800)]
[-Wunsafe-buffer-usage] Safe-buffers re-architecture to introduce Fixable gadgets

Re-architecture of safe-buffers gadgets to re-classify them as warning and fixable
gadgets. The warning gadgets identify unsafe operations on buffer variables and
emit suitable warnings. While the fixable gadgets consider all operations on
variables identified by the warning gadgets and emit necessary fixits.

Differential Revision: https://reviews.llvm.org/D140062?id=486625

18 months ago[libc] add noexcept to external function headers
Michael Jones [Wed, 4 Jan 2023 18:37:51 +0000 (10:37 -0800)]
[libc] add noexcept to external function headers

To improve code generation for C++ code that directly includes our
headers, the external function definitions will now be marked noexcept.
This may not be necessary for the internal definitions since we build
with the -fno-exceptions flag.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D141095

18 months agoFix PDL verifiers to be resilient to invalid IR
Mehdi Amini [Fri, 6 Jan 2023 19:34:28 +0000 (19:34 +0000)]
Fix PDL verifiers to be resilient to invalid IR

This would cause a crash when calling `dump()` on an operation that
didn't have a parent yet.

18 months ago[libc++][test] Add missing include
Casey Carter [Fri, 6 Jan 2023 19:35:26 +0000 (11:35 -0800)]
[libc++][test] Add missing include

`std::out_of_range` is in `<stdexcept>`

18 months ago[DebugInfo] Allow non-stack_value variadic expressions and use in DBG_INSTR_REF
Stephen Tozer [Tue, 3 Jan 2023 10:11:22 +0000 (10:11 +0000)]
[DebugInfo] Allow non-stack_value variadic expressions and use in DBG_INSTR_REF

Prior to this patch, variadic DIExpressions (i.e. ones that contain
DW_OP_LLVM_arg) could only be created by salvaging debug values to create
stack value expressions, resulting in a DBG_VALUE_LIST being created. As of
the previous patch in this patch stack, DBG_INSTR_REF's syntax has been
changed to match DBG_VALUE_LIST in preparation for supporting variadic
expressions. This patch adds some minor changes needed to allow variadic
expressions that aren't stack values to exist, and allows variadic expressions
that are trivially reduceable to non-variadic expressions to be handled
similarly to non-variadic expressions.

Reviewed by: jmorse

Differential Revision: https://reviews.llvm.org/D133926

18 months ago[mlir] Support TBAA metadata in LLVMIR dialect.
Slava Zakharin [Thu, 29 Dec 2022 23:14:41 +0000 (15:14 -0800)]
[mlir] Support TBAA metadata in LLVMIR dialect.

This change introduces new LLVMIR dialect operations to represent
TBAA root, type descriptor and access tag metadata nodes.

For the purpose of importing TBAA metadata from LLVM IR it only
supports the current version of TBAA format described in
https://llvm.org/docs/LangRef.html#tbaa-metadata (i.e. size-aware
representation introduced in D41501 is not supported).

TBAA attribute support is only added for LLVM::LoadOp and LLVM::StoreOp.
Support for intrinsics operations (e.g. LLVM::MemcpyOp) may be added later.

The TBAA attribute is represented as an array of access tags, though,
LLVM IR supports only single access tag per memory accessing instruction.
I implemented it as an array anticipating similar support in LLVM IR
to combine TBAA graphs with different roots for Flang - one of the options
described in https://docs.google.com/document/d/16kKZVmI585wth01VSaJAqZMZpoX68rcdBmgfj0kNAt0/edit#heading=h.jzzheaz9vqac

It should be easy to restrict MLIR operation to a single access tag,
if we end up using a different approach for Flang.

Differential Revision: https://reviews.llvm.org/D140768

18 months ago[AMDGPU] Combine redundant Asm64 and AsmVOP3DPPBase. NFC
Joe Nash [Thu, 5 Jan 2023 21:48:46 +0000 (16:48 -0500)]
[AMDGPU] Combine redundant Asm64 and AsmVOP3DPPBase. NFC

Reduce duplication in the codebase by combining these fields in
VOPProfile.

Reviewed By: rampitec

Differential Revision: https://reviews.llvm.org/D141088

18 months agoCleanup unwind table emission code a bit.
James Y Knight [Fri, 6 Jan 2023 18:26:03 +0000 (13:26 -0500)]
Cleanup unwind table emission code a bit.

This change removes the `tidyLandingPads` function, which previously
had a few responsibilities:

1. Dealing with the deletion of an invoke, after MachineFunction lowering.
2. Dealing with the deletion of a landing pad BB, after MachineFunction lowering.
3. Cleaning up the type-id list generated by `MachineFunction::addLandingPad`.

Case 3 has been fixed in the generator, and the others are now handled
during table emission.

This change also removes `MachineFunction`'s `addCatchTypeInfo`,
`addFilterTypeInfo`, and `addCleanup` helper fns, as they had a single
caller, and being outlined didn't make it simpler.

Finally, as calling `tidyLandingPads` was effectively the only thing
`DwarfCFIExceptionBase` did, that class has been eliminated.

18 months agoRemove special cases for invoke of non-throwing inline-asm.
James Y Knight [Fri, 6 Jan 2023 15:11:44 +0000 (10:11 -0500)]
Remove special cases for invoke of non-throwing inline-asm.

Non-throwing inline asm infers the nounwind attribute in
instcombine. Thus, it can be handled in the same manner as
non-throwing target functions are generally. Further special casing is
unnecessary complexity.

18 months ago[mlir][tosa] Add tosa.conv3d lowering to Linalg
Rob Suderman [Fri, 6 Jan 2023 18:13:32 +0000 (10:13 -0800)]
[mlir][tosa] Add tosa.conv3d lowering to Linalg

Conv3D has an existing linalg operation for floating point. Adding a quantized
variant and corresponding lowering from TOSA. Numerical correctness was validated
using the TOSA conformance tests.

Reviewed By: jpienaar

Differential Revision: https://reviews.llvm.org/D140919

18 months agoWhen loading mach-o corefile, new fallback for finding images
Jason Molenda [Fri, 6 Jan 2023 18:45:07 +0000 (10:45 -0800)]
When loading mach-o corefile, new fallback for finding images

When lldb is reading a user process corefile, it starts by finding
dyld, then finding the dyld_all_image_infos structure in dyld by
symbol name, then getting the list of loaded binaries.  If it fails
to find the structure by name, it can't load binaries.  There is
an additional fallback that this patch adds, which is to look for
this object by the section name it is stored in, if the symbol name
lookup fails.

Differential Revision: https://reviews.llvm.org/D140066
rdar://103369931

18 months agoRe-land "[-Wunsafe-buffer-usage] Add a new `forEachDescendant` matcher that skips...
ziqingluo-90 [Fri, 6 Jan 2023 18:33:21 +0000 (10:33 -0800)]
Re-land "[-Wunsafe-buffer-usage] Add a new `forEachDescendant` matcher that skips callable declarations"

This reverts commit 22df4549a3718dcd8b387ba8246978349e4be50c.

After a quick investigation, realizing that the Sanitizer test
failures caused by this patch is not likely to block other
contributors. I re-land this patch before taking a closer look at
those tests so that it won't block the [-Wunsafe-buffer-usage]
development.