platform/upstream/llvm.git
2 years ago[clang][dataflow] Add flow condition constraints to Environment
Stanislav Gatev [Tue, 1 Mar 2022 11:19:00 +0000 (11:19 +0000)]
[clang][dataflow] Add flow condition constraints to Environment

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: ymandel, xazax.hun
Differential Revision: https://reviews.llvm.org/D120711

2 years ago[pseudo] Fix an out-of-bound error in LRTable::find.
Haojian Wu [Tue, 1 Mar 2022 14:49:21 +0000 (15:49 +0100)]
[pseudo] Fix an out-of-bound error in LRTable::find.

The linear scan should not escape the TargetedStates range.

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

2 years ago[Object] [COFF] Improve error messages
Martin Storsjö [Mon, 28 Feb 2022 10:25:22 +0000 (12:25 +0200)]
[Object] [COFF] Improve error messages

This aids debugging when working with possibly broken files,
instead of just flat out erroring out without telling what's wrong.

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

2 years ago[libcxx] [test] Make filesystem tests not rely on libc++ internals
Martin Storsjö [Tue, 1 Mar 2022 20:41:49 +0000 (22:41 +0200)]
[libcxx] [test] Make filesystem tests not rely on libc++ internals

As part of https://reviews.llvm.org/D119036
(506cf6dc048835c598b654e43ed8f723a42e39ba), `-DNOMINMAX` was
dropped from the Windows CI configurations, replaced with a
block with `_LIBCPP_PUSH_MACROS`, `#include <__undef_macros>`
and `_LIBCPP_POP_MACROS` (and
`ADDITIONAL_COMPILE_FLAGS: -DNOMINMAX` left in two tests).

However, this workaround breaks the running the libc++ tests
against a different C++ standard library than libc++, as those
macros and that header are libc++ internals.

Therefore, reinstate `-DNOMINMAX` for clang-cl configurations
and remove the libc++ specific bits in filesystem_test_helper.h.

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

2 years ago[C++20][Modules] Improve efficiency of isModulePartition method.
Iain Sandoe [Tue, 1 Mar 2022 20:34:13 +0000 (20:34 +0000)]
[C++20][Modules] Improve efficiency of isModulePartition method.

The original implementation of this used the presence of a ":" in the module
name as the key, but since we now generate modules with the correct kind, we
can just test that.

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

2 years ago[clang-offload-bundler] HIP and OpenMP comaptibility for linking heterogeneous archiv...
Saiyedul Islam [Tue, 1 Mar 2022 06:31:57 +0000 (06:31 +0000)]
[clang-offload-bundler] HIP and OpenMP comaptibility for linking heterogeneous archive library

`hip-openmp-compatible` flag treats hip and hipv4 offload kinds
as compatible with openmp offload kind while extracting code objects
from a heterogenous archive library. Vice versa is also considered
compatible if hip code was compiled with -fgpu-rdc.

This flag only relaxes compatibility criteria on `OffloadKind`,
rest of the components like `Triple` and `GPUArhc` still needs to
be compatible.

Reviewed By: yaxunl

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

2 years ago[RISCV] add the MC layer support of Zfinx extension
Shao-Ce SUN [Tue, 1 Mar 2022 05:19:17 +0000 (13:19 +0800)]
[RISCV] add the MC layer support of Zfinx extension

This patch added the MC layer support of Zfinx extension.

Authored-by: StephenFan
Co-Authored-by: Shao-Ce Sun
Reviewed By: asb

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

2 years ago[gn build] Port 65588a0776ae
LLVM GN Syncbot [Wed, 2 Mar 2022 06:10:52 +0000 (06:10 +0000)]
[gn build] Port 65588a0776ae

2 years agoRevert "TLS loads opimization (hoist)"
Xiang1 Zhang [Wed, 2 Mar 2022 06:10:11 +0000 (14:10 +0800)]
Revert "TLS loads opimization (hoist)"
Revert for more reviews

This reverts commit 30e612ebdfb0f243eb63d93487790a53c26ae873.

2 years ago[nfc][codegen] Move RegisterBank[Info].h under CodeGen
Mircea Trofin [Tue, 15 Feb 2022 19:54:38 +0000 (11:54 -0800)]
[nfc][codegen] Move RegisterBank[Info].h under CodeGen

This wraps up from D119053. The 2 headers are moved as described,
fixed file headers and include guards, updated all files where the old
paths were detected (simple grep through the repo), and `clang-format`-ed it all.

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

2 years ago[mlir][OpenMP] Added assemblyFormat for atomic and critical operations
Shraiysh Vaishay [Wed, 2 Mar 2022 05:23:53 +0000 (10:53 +0530)]
[mlir][OpenMP] Added assemblyFormat for atomic and critical operations

This patch adds assemblyFormat for `omp.critical.declare`, `omp.atomic.read`,
`omp.atomic.write`, `omp.atomic.update` and `omp.atomic.capture`.

Also removing those clauses from `parseClauses` that aren't needed
anymore, thanks to the new assemblyFormats.

Reviewed By: NimishMishra, rriddle

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

2 years ago[AMDGPU] Select no-return atomic ops in BUFInstructions.td
Abinav Puthan Purayil [Fri, 25 Feb 2022 05:21:44 +0000 (10:51 +0530)]
[AMDGPU] Select no-return atomic ops in BUFInstructions.td

This change adds the selection of no-return buffer_* instructions in
tblgen. The motivation for this is to get the no-return atomic isel
working without relying on post-isel hooks so that GlobalISel can start
selecting them (once GlobalISelEmitter allows no return atomic patterns
like how DAGISel does).

This change handles the selection of no-return mubuf_atomic_cmpswap in
tblgen without changing the extract_subreg generation for the return
variant. This handling was done by the post-isel hook.

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

2 years ago[llvm-profgen] Generating probe-based non-CS profile.
Hongtao Yu [Wed, 2 Mar 2022 02:43:53 +0000 (18:43 -0800)]
[llvm-profgen] Generating probe-based non-CS profile.

I'm bring up the support of pseudo-probe-based non-CS profile generation. The approach is quite similar to generating dwarf-based non-CS profile. The main difference is for a given linear instruction range, instead of each disassembled instruction,  pseudo probes that are covered by the range are processed. The pseudo probe extraction code is shared with CS probe profile generation.

I'm seeing 0.7% performance win for one of our internal large benchmark compared to using non-CS dwarf-based profile, and 0.5% win for another large benchmark when combined with profi.

Reviewed By: wenlei

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

2 years ago[CSSPGO][PriorityInliner] Do not use block weight to drive callsite inlining.
Hongtao Yu [Sun, 27 Feb 2022 19:40:11 +0000 (11:40 -0800)]
[CSSPGO][PriorityInliner] Do not use block weight to drive callsite inlining.

The priority-based inliner currenlty uses block count combined with callee entry count to drive callsite inlining. This doesn't work well with LTO where postlink inlining is driven by prelink-annotated block count which could be based on the merge of all context profiles. I'm fixing it by using callee profile entry count only which should be context-sensitive.

I'm seeing 0.2% perf improvment for one of our internal large benchmarks with probe-based non-CS profile.

Reviewed By: wenlei

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

2 years ago[gn build] Port 30e612ebdfb0
LLVM GN Syncbot [Wed, 2 Mar 2022 02:38:00 +0000 (02:38 +0000)]
[gn build] Port 30e612ebdfb0

2 years agoTLS loads opimization (hoist)
Xiang1 Zhang [Fri, 25 Feb 2022 00:38:00 +0000 (08:38 +0800)]
TLS loads opimization (hoist)
Reviewed By: Wang Pheobe, Topper Craig

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

2 years ago[BOLT][test] Fix function size in test case
Maksim Panchenko [Wed, 2 Mar 2022 01:52:47 +0000 (17:52 -0800)]
[BOLT][test] Fix function size in test case

2 years ago[AST] Print NTTP args as string-literals when possible
Zhihao Yuan [Wed, 2 Mar 2022 01:33:43 +0000 (19:33 -0600)]
[AST] Print NTTP args as string-literals when possible

C++20 non-type template parameter prints `MyType<{{116, 104, 105, 115}}>` when the code is as simple as `MyType<"this">`. This patch prints `MyType<{"this"}>`, with one layer of braces preserved for the intermediate structural type to trigger CTAD.

`StringLiteral` handles this case, but `StringLiteral` inside `APValue` code looks like a circular dependency. The proposed patch implements a cheap strategy to emit string literals in diagnostic messages only when they are readable and fall back to integer sequences.

Reviewed By: aaron.ballman

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

2 years agoRevert "[SLP] Schedule only sub-graph of vectorizable instructions"
Arthur Eubanks [Tue, 1 Mar 2022 23:51:32 +0000 (15:51 -0800)]
Revert "[SLP] Schedule only sub-graph of vectorizable instructions"

This reverts commit 0539a26d91a1b7c74022fa9cf33bd7faca87544d.

Causes a miscompile, see comments on D118538.

Required updating bottom-to-top-reorder.ll.

2 years agoRevert "[SLP] Remove SchedulingPriority from ScheduleData [NFC]"
Arthur Eubanks [Tue, 1 Mar 2022 23:51:26 +0000 (15:51 -0800)]
Revert "[SLP] Remove SchedulingPriority from ScheduleData [NFC]"

This reverts commit a3e9b32c00959ad5c73189d8378d019fbe80ade5.

Required for reverting D118538.

2 years ago[examples][BuildingAJIT] Use the right layer when adding code in Chapter 3.
Lang Hames [Wed, 2 Mar 2022 00:43:39 +0000 (16:43 -0800)]
[examples][BuildingAJIT] Use the right layer when adding code in Chapter 3.

We were incorrectly using the OptimizeLayer and bypassing the COD layer.

2 years ago[ORC] Set ResolverBlockAddr in EPCIndirectionUtils::writeResolverBlock.
Lang Hames [Tue, 1 Mar 2022 23:52:19 +0000 (15:52 -0800)]
[ORC] Set ResolverBlockAddr in EPCIndirectionUtils::writeResolverBlock.

Without this, EPCIndirectionUtils::getResolverBlockAddr (and lazy compilation
via EPC) won't work.

No test case: lli is still using LocalLazyCallThroughManager. I'll revisit this
soon when I look at adding lazy compilation support to the ORC runtime.

2 years ago[mlir][sparse][pytaco] added test with various sparse annotations
Aart Bik [Tue, 1 Mar 2022 23:47:16 +0000 (15:47 -0800)]
[mlir][sparse][pytaco] added test with various sparse annotations

This also found a bug in the new toMLIR code (missing permutation)

Reviewed By: bixia

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

2 years ago[gn build] Add -fsanitize=fuzzer to link flags in fuzzer targets when llvm_use_saniti...
Arthur Eubanks [Wed, 2 Mar 2022 00:09:48 +0000 (16:09 -0800)]
[gn build] Add -fsanitize=fuzzer to link flags in fuzzer targets when llvm_use_sanitize_coverage

2 years ago[gn build] (manually) port 15ab7bc3af3c (TestingSupportTests)
Nico Weber [Tue, 1 Mar 2022 23:50:22 +0000 (18:50 -0500)]
[gn build] (manually) port 15ab7bc3af3c (TestingSupportTests)

2 years ago[LegalizeTypes] Remove incomplete StrictFP support from SplitVecRes_UnaryOp. NFC
Craig Topper [Tue, 1 Mar 2022 23:41:54 +0000 (15:41 -0800)]
[LegalizeTypes] Remove incomplete StrictFP support from SplitVecRes_UnaryOp. NFC

There is no handling of Chain operands in this function so it can't
work. There's a separate splitting function for all strict fp nodes.

2 years ago[mlir][sparse][taco] Support tensor dimension storage ordering and more general
Bixia Zheng [Tue, 1 Mar 2022 22:44:43 +0000 (14:44 -0800)]
[mlir][sparse][taco] Support tensor dimension storage ordering and more general
sparsity values.

Previously, we can't properly handle input tensors with a dimension
ordering that is different from the natural ordering or with a mixed of
compressed and dense dimensions. This change fixes the problems by
passing the dimension ordering and sparsity values to the runtime
routine.

Modify an existing test to test the situation.

Reviewed By: aartbik

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

2 years ago[AArch64] Add simple arithmetic cost model test. NFC
David Green [Tue, 1 Mar 2022 23:31:02 +0000 (23:31 +0000)]
[AArch64] Add simple arithmetic cost model test. NFC

2 years ago[MLIR] [Arith] [NFC] Remove switch statement default label due to warning
Max Kudryavtsev [Tue, 1 Mar 2022 23:22:14 +0000 (15:22 -0800)]
[MLIR] [Arith] [NFC] Remove switch statement default label due to warning

We are getting compiler warning because default label is excessive. Removing it for now.

[[ http://lab.llvm.org:8011/#/builders/61/builds/22782/steps/5/logs/warnings__2_ | view on buildbot ]]

```
/vol/worker/mlir-nvidia/mlir-nvidia/llvm.src/mlir/lib/Dialect/Arithmetic/IR/ArithmeticOps.cpp:1597:9: warning: default label in switch which covers all enumeration values [-Wcovered-switch-default]
```

Related to: [[ https://reviews.llvm.org/D117257 | D117257 ]]

Reviewed By: stella.stamenova

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

2 years ago[lld][WebAssembly] Improve error reporting for bad ar archive members
Sam Clegg [Tue, 1 Mar 2022 00:32:02 +0000 (16:32 -0800)]
[lld][WebAssembly] Improve error reporting for bad ar archive members

Show the name of of the archive in the error message as well as the name
of the object within it.

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

2 years ago[bazel] Add a missing dependency after 1f971e23f089
Benjamin Kramer [Tue, 1 Mar 2022 23:20:08 +0000 (00:20 +0100)]
[bazel] Add a missing dependency after 1f971e23f089

2 years ago[flang] Extension: don't require commas between most edit descriptors in formats
Peter Klausler [Thu, 17 Feb 2022 00:41:53 +0000 (16:41 -0800)]
[flang] Extension: don't require commas between most edit descriptors in formats

The standard explicitly allows a comma to be omitted between a 'P'
edit descriptor and a following numeric edit descriptor (e.g., 1PE10.1),
and before and after a '/' edit descriptor, but otherwise requires them
between edit descriptors.  Most implementations, however, only require
commas where they prevent ambiguity, and accept things like 1XI10.
This extension is already assumed by the static FORMAT checker in
semantics.  Patch the runtime to behave accordingly.

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

2 years ago[bazel] Build fixes for 23aa5a744666
Benjamin Kramer [Tue, 1 Mar 2022 23:07:56 +0000 (00:07 +0100)]
[bazel] Build fixes for 23aa5a744666

2 years ago[RISCV] Remove accidental negate from recently added i64 abs test. NFC
Craig Topper [Tue, 1 Mar 2022 23:07:38 +0000 (15:07 -0800)]
[RISCV] Remove accidental negate from recently added i64 abs test. NFC

I copied the tests from neg-abs.ll and thought I removed all the
negations.

2 years ago[lldb] Hyphenate Objective-C exception breakpoint labels ✍️
Stephane Moore [Tue, 1 Mar 2022 23:02:00 +0000 (15:02 -0800)]
[lldb] Hyphenate Objective-C exception breakpoint labels ✍️

Objective-C is officially hyphenated:
https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/ObjectiveC/Introduction/introObjectiveC.html#//apple_ref/doc/uid/TP30001163

Reviewed By: mwyman, clayborg

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

2 years ago[libc][NFC] Add a static assert for futex size.
Siva Chandra Reddy [Tue, 1 Mar 2022 22:53:46 +0000 (22:53 +0000)]
[libc][NFC] Add a static assert for futex size.

2 years ago[mlir] Add option to control python search priming
rkayaith [Tue, 1 Mar 2022 22:51:25 +0000 (14:51 -0800)]
[mlir] Add option to control python search priming

This adds an option to configure the CMake python search priming
behaviour that was introduced in D118148. In some environments the
priming would cause the "real" search to fail. The default behaviour is
unchanged, i.e. the search will be primed.

Reviewed By: stellaraccident

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

2 years ago[HWASAN] Add test for optnone function.
Florian Mayer [Fri, 18 Feb 2022 00:51:05 +0000 (16:51 -0800)]
[HWASAN] Add test for optnone function.

Reviewed By: eugenis

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

2 years ago[HWASAN] erase lifetime intrinsics if tag is outside.
Florian Mayer [Wed, 23 Feb 2022 22:32:19 +0000 (14:32 -0800)]
[HWASAN] erase lifetime intrinsics if tag is outside.

Reviewed By: eugenis

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

2 years ago[flang] Allow data transfer stmt control list errors to be caught
Peter Klausler [Wed, 16 Feb 2022 22:55:19 +0000 (14:55 -0800)]
[flang] Allow data transfer stmt control list errors to be caught

The runtime crashes on several fundamental I/O data transfer statement
control list errors, like list I/O on a direct-access unit, or
input from a write-only unit, &c.  These errors should not be fatal
when ERR= or IOSTAT= are present.

This patch creates a new ErroneousIoStatementState class and
uses it for the state of an I/O statement that is doomed to fail
from these errors.  If there is no ERR= label or IOSTAT= variable,
the error will be raised at the end of the statement.  Data transfer
operations along the way will be no-op failures.

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

2 years ago[flang] Add test for allocatable on the caller side
Valentin Clement [Tue, 1 Mar 2022 22:25:27 +0000 (23:25 +0100)]
[flang] Add test for allocatable on the caller side

This patch adds test for allocatable on the caller side.
Lowering for missing features is added as well.

This patch is part of the upstreaming effort from fir-dev branch.

Depends on D120746

Reviewed By: PeteSteinfeld, schweitz

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

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
2 years ago[PDB] add missing char8_t for 5c9e20d
Zequan Wu [Tue, 1 Mar 2022 22:24:13 +0000 (14:24 -0800)]
[PDB] add missing char8_t for 5c9e20d

2 years ago[OpenMP][NFC] Add an option to print the module before in OpenMPOpt
Joseph Huber [Tue, 1 Mar 2022 21:33:26 +0000 (16:33 -0500)]
[OpenMP][NFC] Add an option to print the module before in OpenMPOpt

Previously there was a debug flag to print the module after
optimizations. Sometimes we wanted to print the module before
optimizations so this is being split into two flags.
`-openmp-opt-print-module` is now `-openmp-opt-print-module-after`.

Reviewed By: jdoerfert

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

2 years ago[mlir][NFC] Remove several dead references to the old standard dialect
River Riddle [Tue, 1 Mar 2022 22:00:26 +0000 (14:00 -0800)]
[mlir][NFC] Remove several dead references to the old standard dialect

2 years ago[flang] Add test for allocatable on the callee side
Valentin Clement [Tue, 1 Mar 2022 21:57:58 +0000 (22:57 +0100)]
[flang] Add test for allocatable on the callee side

This patch adds couple of tests for allocatable
on the callee side. Lowering for some missing underlying features
is added as well.

This patch is part of the upstreaming effort from fir-dev branch.

Depends on D120744

Reviewed By: PeteSteinfeld, schweitz

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

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
2 years ago[mlir][NFC] Rename the old Standard dialect test directory to Func
River Riddle [Tue, 1 Mar 2022 21:47:00 +0000 (13:47 -0800)]
[mlir][NFC] Rename the old Standard dialect test directory to Func

The remanants of Standard was renamed to Func, but the test directory
remained named as Standard. In adidition to fixing the name, this commit
also moves the tests for operations not in the Func dialect to the proper
parent dialect test directory.

2 years agoTesting: Make TempFile safe to move; test Temp{Dir,File,Link}
Duncan P. N. Exon Smith [Tue, 1 Mar 2022 00:47:29 +0000 (16:47 -0800)]
Testing: Make TempFile safe to move; test Temp{Dir,File,Link}

Default the moves and delete the copies for TempFile, matching TempDir
and TempLink, and add tests for all of them to confirm that the
destructor is not harmful after it has been moved from.

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

2 years ago[libcxx] [test] Place output from newconfig tests under a 'test' subdir
Martin Storsjö [Thu, 24 Feb 2022 10:38:26 +0000 (12:38 +0200)]
[libcxx] [test] Place output from newconfig tests under a 'test' subdir

Previously, all the output from the tests were placed directly in
the build directory. The tests produce a couple directories named
`__config_{exec,cache,src}__` which are easy to distinguish, but
the output from the individual tests are placed in subdirectories
named `std` or `libcxx`. Especially the build output from libcxx
tests ends up conflated in the same directories as are used for
building libcxx with cmake.

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

2 years ago[PDB] Add char8_t type
Zequan Wu [Tue, 1 Mar 2022 01:22:56 +0000 (17:22 -0800)]
[PDB] Add char8_t type

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

2 years ago[flang] Handle dynamic array lowering
Valentin Clement [Tue, 1 Mar 2022 21:28:16 +0000 (22:28 +0100)]
[flang] Handle dynamic array lowering

This patch enables dynamic array lowering
and use the funcationality inside some IO tests.

This patch is part of the upstreaming effort from fir-dev branch.

Depends on D120743

Reviewed By: PeteSteinfeld, schweitz

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

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
2 years ago[clang-format][docs] Fix a bad comment
Krystian Kuzniarek [Sun, 27 Feb 2022 09:30:49 +0000 (10:30 +0100)]
[clang-format][docs] Fix a bad comment

Follow up to 8f310d1967c20d348c617af3a30999031c71fee0.

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

2 years ago[clang-format] Fix BreakBeforeBinaryOperators with TemplateCloser on the lhs
Björn Schäpers [Thu, 24 Feb 2022 14:14:49 +0000 (15:14 +0100)]
[clang-format] Fix BreakBeforeBinaryOperators with TemplateCloser on the lhs

In the presence of pp branches we parse the token stream multiple times.
Thus the token already has the type set. It's best just not to assert on
any type in the parser.

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

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

2 years ago[clang-format] Fix requires related crash
Björn Schäpers [Thu, 24 Feb 2022 14:14:49 +0000 (15:14 +0100)]
[clang-format] Fix requires related crash

In the presence of pp branches we parse the token stream multiple times.
Thus the token already has the type set. It's best just not to assert on
any type in the parser.

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

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

2 years ago[clang-format] Allow to set token types final
Björn Schäpers [Thu, 24 Feb 2022 07:57:03 +0000 (08:57 +0100)]
[clang-format] Allow to set token types final

We have a little problem. TokenAnnotator::resetTokenMetadata() resets
the type, except for a (growing) whitelist. This is because the
TokenAnnotator visits some tokens multiple times. E.g. trying to
identify if a < is an operator less or a template opener. And in some
runs, which are bascially "reverted" the types are reset.

On the other hand, if the parser does already know the type, it should
be able to set it, without it being reset. So we introduce the ability
to set a type and make that final.

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

2 years ago[libc++][AIX] Use C++ overloads from libc++'s math.h
David Tenty [Mon, 7 Feb 2022 23:22:35 +0000 (18:22 -0500)]
[libc++][AIX] Use C++ overloads from libc++'s math.h

AIX's system header provides these C++ overloads for compatibility with
older XL C++ implementations, but they can be disabled by defining
__LIBC_NO_CPP_MATH_OVERLOADS__ since AIX 7.2 TL 5 SP 3.

Since D109078 landed clang will define this macro when using libc++ on
AIX and we already run the lit tests with it too. This change will
enable the overloads in libc++'s math.h and we'll continue to require
the compiler to define the macro going forward.

Reviewed By: ldionne, jsji, EricWF

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

co-authored-by: Jason Liu <jasonliu.development@gmail.com>

2 years ago[SVE] Update patterns to commute FMLS multiplication operands
Cameron McInally [Tue, 1 Mar 2022 20:05:41 +0000 (12:05 -0800)]
[SVE] Update patterns to commute FMLS multiplication operands

Use PatFrags to commute the multiplication operands of an AArch64ISD::FMA_PRED
node, allowing unpredicated FMLS instructions to match.

Reviewed by: paulwalker-arm

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

2 years ago[flang] Lower basic IO statement
Valentin Clement [Tue, 1 Mar 2022 20:47:40 +0000 (21:47 +0100)]
[flang] Lower basic IO statement

This patch enables the lowering of the print, read and write
IO statements.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: PeteSteinfeld, schweitz

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

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
Co-authored-by: Kiran Chandramohan <kiran.chandramohan@arm.com>
2 years ago[flang] Check constraint C711 correctly
Peter Klausler [Fri, 18 Feb 2022 20:25:58 +0000 (12:25 -0800)]
[flang] Check constraint C711 correctly

An assumed-type actual argument that corresponds to an assumed-rank dummy
argument shall be assumed-shape or assumed-rank.

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

2 years ago[mlir] Trim a huge number of unnecessary dependencies on the Func dialect
River Riddle [Mon, 28 Feb 2022 22:25:39 +0000 (14:25 -0800)]
[mlir] Trim a huge number of unnecessary dependencies on the Func dialect

The Func has a large number of legacy dependencies carried over from the old
Standard dialect, which was pervasive and contained a large number of varied
operations. With the split of the standard dialect and its demise, a lot of lingering
dead dependencies have survived to the Func dialect. This commit removes a
large majority of then, greatly reducing the dependence surface area of the
Func dialect.

2 years ago[mlir] Rename the Standard dialect to the Func dialect
River Riddle [Sat, 26 Feb 2022 22:49:54 +0000 (14:49 -0800)]
[mlir] Rename the Standard dialect to the Func dialect

The last remaining operations in the standard dialect all revolve around
FuncOp/function related constructs. This patch simply handles the initial
renaming (which by itself is already huge), but there are a large number
of cleanups unlocked/necessary afterwards:

* Removing a bunch of unnecessary dependencies on Func
* Cleaning up the From/ToStandard conversion passes
* Preparing for the move of FuncOp to the Func dialect

See the discussion at https://discourse.llvm.org/t/standard-dialect-the-final-chapter/6061

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

2 years ago[libcxx] Make test case fmt specifiers more portable
Brian Cain [Fri, 25 Feb 2022 03:59:18 +0000 (19:59 -0800)]
[libcxx] Make test case fmt specifiers more portable

These printf()s fail to compile like so on hexagon:

.../tools/llvm-top/libcxx/test/std/utilities/charconv/charconv.msvc/test.cpp:94:23: error: format specifies type 'unsigned int' but the argument has type 'unsigned long' [-Werror,-Wformat]
        printf("%u ", elem);
                ~~    ^~~~
                %lu
.../tools/llvm-top/libcxx/test/std/utilities/charconv/charconv.msvc/test.cpp:569:56: error: format specifies type 'unsigned int' but the argument has type 'uint32_t' (aka 'unsigned long') [-Werror,-Wformat]
        fprintf(stderr, "%s failed for 0x%08X\n", msg, bits);
                                         ~~~~          ^~~~
                                         %08lX
.../tools/llvm-top/libcxx/test/std/utilities/charconv/charconv.msvc/test.cpp:1096:43: error: format specifies type 'unsigned int' but the argument has type 'unsigned long' [-Werror,-Wformat]
    printf("Randomized test cases: %u\n", PrefixesToTest * Fractions);
                                   ~~     ^~~~~~~~~~~~~~~~~~~~~~~~~~
                                   %lu

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

2 years ago[RISCV] Add more test case for absolute value. NFC
Craig Topper [Tue, 1 Mar 2022 19:50:43 +0000 (11:50 -0800)]
[RISCV] Add more test case for absolute value. NFC

This adds tests for i8 through i128 with intrinsic and select forms.

Covering rv32 and rv64 with the base ISA, Zbb, and Zbt. Some
Zbb tests already covered part of this, but not all.

FIXMEs have been added for some obviously suboptimal codegen.

2 years agoCleanup includes: TransformsUtils
serge-sans-paille [Tue, 1 Mar 2022 13:28:22 +0000 (14:28 +0100)]
Cleanup includes: TransformsUtils

Estimation on the impact on preprocessor output:
before: 1065307662
after:  1064800684

Discourse thread: https://discourse.llvm.org/t/include-what-you-use-include-cleanup
Differential Revision: https://reviews.llvm.org/D120741

2 years agoAdd missing include under EXPENSIVE_CHECK
serge-sans-paille [Tue, 1 Mar 2022 19:59:08 +0000 (20:59 +0100)]
Add missing include under EXPENSIVE_CHECK

This is a followup to 344f8ec3048b6eeef94569800acb012f794ad372

It should fix
https://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-expensive/21961/console

2 years ago[mlir] Fix unused var warning in the IR/MemRefOps.cpp
rdzhabarov [Tue, 1 Mar 2022 19:44:12 +0000 (19:44 +0000)]
[mlir] Fix unused var warning in the IR/MemRefOps.cpp

Fix unused var compiler warning.

Reviewed By: Mogball

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

2 years ago[RISCV] Fix the indentation of 'ret' in rv*zb*-intrinsic.ll tests. NFC
Craig Topper [Tue, 1 Mar 2022 19:36:34 +0000 (11:36 -0800)]
[RISCV] Fix the indentation of 'ret' in rv*zb*-intrinsic.ll tests. NFC

Many of these test cases had a single space before 'ret' while
every other instruction had two space indentation. I did not audit
any other tests for this problem.

2 years ago[libc++] Add `explicit` to a bunch of internal detail ctors.
Arthur O'Dwyer [Wed, 9 Feb 2022 22:30:46 +0000 (17:30 -0500)]
[libc++] Add `explicit` to a bunch of internal detail ctors.

Notably the following ctors remain non-explicit because they
are used as implicit conversions in too many places:
* __debug_less(_Compare&)
* __map_iterator(_TreeIterator)
* __map_const_iterator(_TreeIterator)
* __hash_map_iterator(_HashIterator)
* __hash_map_const_iterator(_HashIterator)

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

2 years agoFix -DLLVM_ENABLE_EXPENSIVE_CHECKS=on build after D120659
Fangrui Song [Tue, 1 Mar 2022 19:36:25 +0000 (11:36 -0800)]
Fix -DLLVM_ENABLE_EXPENSIVE_CHECKS=on build after D120659

2 years ago[libcxx] [test] Fix the put_double, put_long_double tests for clang-cl
Martin Storsjö [Thu, 10 Feb 2022 09:56:44 +0000 (09:56 +0000)]
[libcxx] [test] Fix the put_double, put_long_double tests for clang-cl

These tests are hit hard by a bug that is fixed in a newer version
of UCRT. Add a test for the specific bug, and XFAIL the tests if
that bug is present (as it is in CI).

Split out hex formatting of floats to separate test files, that
are excluded with `XFAIL: msvc`. (Based on reading the C standard for
printf formatting, it seems like this isn't necessarily a proper bug
in printf, but just a case of differing optional behaviour.)

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

2 years ago[libcxx] [test] Add a 'win32-' prefix to the 'broken-utf8-wchar-ctype' feature
Martin Storsjö [Thu, 24 Feb 2022 11:14:21 +0000 (13:14 +0200)]
[libcxx] [test] Add a 'win32-' prefix to the 'broken-utf8-wchar-ctype' feature

This was suggested in the review of https://reviews.llvm.org/D120022.

Also indent the code for the compilation test one step compared
to the surrounding expression.

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

2 years agoFix build breaks on ml-* bots introduced by include cleanups
Mircea Trofin [Tue, 1 Mar 2022 19:28:51 +0000 (11:28 -0800)]
Fix build breaks on ml-* bots introduced by include cleanups

2 years ago[libc++] Remove _LIBCPP_HAS_NO_STRONG_ENUMS.
Mark de Wever [Fri, 11 Feb 2022 18:34:33 +0000 (19:34 +0100)]
[libc++] Remove _LIBCPP_HAS_NO_STRONG_ENUMS.

All supported compilers have implemented this feature.
Therefore use the language version instead of the feature macro.

Reviewed By: #libc, philnik, ldionne, Quuxplusone

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

2 years ago[mlir][sparse] fix compile-time warning
Aart Bik [Tue, 1 Mar 2022 19:21:50 +0000 (11:21 -0800)]
[mlir][sparse] fix compile-time warning

Reviewed By: bixia

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

2 years ago[libc++] Remove extraneous space in module.modulemap. NFC.
Arthur O'Dwyer [Tue, 1 Mar 2022 19:25:09 +0000 (14:25 -0500)]
[libc++] Remove extraneous space in module.modulemap. NFC.

2 years ago[libc++] [test] Improve the tests for std::{begin,end}(valarray).
Arthur O'Dwyer [Mon, 14 Feb 2022 04:28:19 +0000 (23:28 -0500)]
[libc++] [test] Improve the tests for std::{begin,end}(valarray).

Incidentally, this removes some unqualified ADL calls to `begin` and `end`.

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

2 years ago[NVPTX] Add ex2.approx.f16/f16x2 support
Nicolas Miller [Tue, 1 Mar 2022 18:34:02 +0000 (10:34 -0800)]
[NVPTX] Add ex2.approx.f16/f16x2 support

NOTE: this is a follow-up commit with the missing clang-side changes.

This patch adds builtins and intrinsics for the f16 and f16x2 variants of the ex2
instruction.

These two variants were added in PTX7.0, and are supported by sm_75 and above.

Note that this isn't wired with the exp2 llvm intrinsic because the ex2
instruction is only available in its approx variant.

Running ptxas on the assembly generated by the test f16-ex2.ll works as
expected.

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

2 years ago[NVPTX] Add more FMA intriniscs/builtins
Jakub Chlanda [Tue, 1 Mar 2022 18:29:54 +0000 (10:29 -0800)]
[NVPTX] Add more FMA intriniscs/builtins

This patch adds builtins/intrinsics for the following variants of FMA:

NOTE: follow-up commit with the missing clang-side changes.

- f16, f16x2
  - rn
  - rn_ftz
  - rn_sat
  - rn_ftz_sat
  - rn_relu
  - rn_ftz_relu
- bf16, bf16x2
  - rn
  - rn_relu

ptxas (Cuda compilation tools, release 11.0, V11.0.194) is happy with the generated assembly.

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

2 years ago[NVPTX] Expose float tys min, max, abs, neg as builtins
Jakub Chlanda [Tue, 1 Mar 2022 18:15:07 +0000 (10:15 -0800)]
[NVPTX] Expose float tys min, max, abs, neg as builtins

Adds support for the following builtins:

abs, neg:
- .bf16,
- .bf16x2
min, max
- {.ftz}{.NaN}{.xorsign.abs}.f16
- {.ftz}{.NaN}{.xorsign.abs}.f16x2
- {.NaN}{.xorsign.abs}.bf16
- {.NaN}{.xorsign.abs}.bf16x2
- {.ftz}{.NaN}{.xorsign.abs}.f32

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

2 years ago[llvm-pdbutil] Fix crashes when TypeIndex is simple or doesn't exist in type stream
Zequan Wu [Tue, 1 Mar 2022 02:03:07 +0000 (18:03 -0800)]
[llvm-pdbutil] Fix crashes when TypeIndex is simple or doesn't exist in type stream

- Print simple TypeIndex
- Print error message when type doesn't exist.

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

2 years ago[mlir][sparse] Extend convertToMLIRSparseTensor to support permutation and more gener...
Bixia Zheng [Mon, 28 Feb 2022 22:22:41 +0000 (14:22 -0800)]
[mlir][sparse] Extend convertToMLIRSparseTensor to support permutation and more general sparsity values.

Previously, convertToMLIRSparseTensor assumes identity storage ordering and all
compressed dimensions. This change extends the function with two parameters for
users to specify the storage ordering and the sparsity of each dimension.

Modify PyTACO to reflect this change.

Reviewed By: aartbik

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

2 years ago[libcxx] Add an explicit option to build against system-libcxxabi
Michał Górny [Tue, 1 Mar 2022 18:43:25 +0000 (13:43 -0500)]
[libcxx] Add an explicit option to build against system-libcxxabi

Add an explicit LIBCXX_CXX_ABI=system-libcxxabi option for linking to
system-installed libc++abi. This fixes the ability to link against one
when building libcxx via the runtimes build, as otherwise the build
system insists on linking into in-tree targets.

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

2 years ago[bazel] add missing dependency
Jorge Gorbe Moya [Tue, 1 Mar 2022 18:43:27 +0000 (10:43 -0800)]
[bazel] add missing dependency

2 years ago[SCF][MemRef] Enable SCF.Parallel Lowering to use Scope Op
William S. Moses [Wed, 23 Feb 2022 19:08:51 +0000 (14:08 -0500)]
[SCF][MemRef] Enable SCF.Parallel Lowering to use Scope Op

As discussed in https://reviews.llvm.org/D119743 scf.parallel would continuously stack allocate since the alloca op was placd in the wsloop rather than the omp.parallel. This PR is the second stage of the fix for that problem. Specifically, we now introduce an alloca scope around the inlined body of the scf.parallel and enable a canonicalization to hoist the allocations to the surrounding allocation scope (e.g. omp.parallel).

Reviewed By: ftynse

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

2 years ago[RISCV] Lower VECTOR_SPLICE to RVV instructions.
Craig Topper [Tue, 1 Mar 2022 18:10:08 +0000 (10:10 -0800)]
[RISCV] Lower VECTOR_SPLICE to RVV instructions.

This lowers VECTOR_SPLICE of scalable vectors to a slidedown follow by a slideup.
Fixed vectors are encouraged to use shufflevector instruction. The equivalent patch
for fixed vectors is D119039.

I've used a tail agnostic slidedown and limited the VL to only the
elements that will not be overwritten by the slideup. The slideup
uses VLMax for its VL. It unfortunately uses tail undisturbed policy
but it isn't required as there is no tail. We just need the merge
operand to carry the bits for the lower portion of the result.

Care was taken to ensure that either the slideup or slidedown will
be able to use a .vi instruction when the immediate is small. Which
one uses the immediate depends on the sign of the immediate.

Reviewed By: frasercrmck, ABataev

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

2 years ago[Analysis] Simplify the interface to llvm::getICmpCode. NFC
Craig Topper [Tue, 1 Mar 2022 17:53:26 +0000 (09:53 -0800)]
[Analysis] Simplify the interface to llvm::getICmpCode. NFC

Instead of passing an InstCmpInt * and a bool just pass the predicate
from the caller.

I'm considering moving the similar FCmp functions from InstCombine
over here and this makes the interface consistent with what is used
for FCmp.

Reviewed By: RKSimon

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

2 years ago[SanitizerBounds] Add support for NoSanitizeBounds function
Tong Zhang [Tue, 1 Mar 2022 09:58:10 +0000 (10:58 +0100)]
[SanitizerBounds] Add support for NoSanitizeBounds function

Currently adding attribute no_sanitize("bounds") isn't disabling
-fsanitize=local-bounds (also enabled in -fsanitize=bounds). The Clang
frontend handles fsanitize=array-bounds which can already be disabled by
no_sanitize("bounds"). However, instrumentation added by the
BoundsChecking pass in the middle-end cannot be disabled by the
attribute.

The fix is very similar to D102772 that added the ability to selectively
disable sanitizer pass on certain functions.

In this patch, if no_sanitize("bounds") is provided, an additional
function attribute (NoSanitizeBounds) is attached to IR to let the
BoundsChecking pass know we want to disable local-bounds checking. In
order to support this feature, the IR is extended (similar to D102772)
to make Clang able to preserve the information and let BoundsChecking
pass know bounds checking is disabled for certain function.

Reviewed By: melver

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

2 years ago[Openmp]: Missing import statement in openmp interface for Fortran
Malhar Jajoo [Tue, 1 Mar 2022 10:51:21 +0000 (10:51 +0000)]
[Openmp]: Missing import statement in openmp interface for Fortran

Essentially removed the "use omp_lib_kinds" statement and replaced it
with import to maintain consistency (and avoid compilation error
in case the omp_lib_kinds.mod file is not accessible) in header file.

The import is required to access entities in host scoping unit.

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

2 years ago[libc++] Re generate header tests
Louis Dionne [Tue, 1 Mar 2022 17:17:32 +0000 (12:17 -0500)]
[libc++] Re generate header tests

This must have been missed in 368faacac7525.

2 years ago[libc] Remove the remaining uses of stdatomic.h.
Siva Chandra Reddy [Tue, 1 Mar 2022 08:54:46 +0000 (08:54 +0000)]
[libc] Remove the remaining uses of stdatomic.h.

New methods to the Atomic class have been added as required. Futex
related types have been consolidated at a common place.

Reviewed By: lntue

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

2 years ago[mlir][spirv] Convert gpu.barrier to spv.ControlBarrier
Lei Zhang [Tue, 1 Mar 2022 17:00:38 +0000 (12:00 -0500)]
[mlir][spirv] Convert gpu.barrier to spv.ControlBarrier

Reviewed By: ThomasRaoux

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

2 years agoCleanup includes: LLVMAnalysis
serge-sans-paille [Mon, 28 Feb 2022 13:08:36 +0000 (14:08 +0100)]
Cleanup includes: LLVMAnalysis

Number of lines output by preprocessor:
before: 1065940348
after:  1065307662

Discourse thread: https://discourse.llvm.org/t/include-what-you-use-include-cleanup
Differential Revision: https://reviews.llvm.org/D120659

2 years ago[AMDGPU] Handle legacy multiply-accumulate opcodes in convertToThreeAddress
Jay Foad [Mon, 28 Feb 2022 16:56:19 +0000 (16:56 +0000)]
[AMDGPU] Handle legacy multiply-accumulate opcodes in convertToThreeAddress

Handle V_MAC_LEGACY_F32 and V_FMAC_LEGACY_F32 in
convertToThreeAddress, to avoid the need for an extra mov
instruction in some cases.

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

2 years ago[AMDGPU] Disentangle MFMA handling in convertToThreeAddress. NFC.
Jay Foad [Mon, 28 Feb 2022 16:33:20 +0000 (16:33 +0000)]
[AMDGPU] Disentangle MFMA handling in convertToThreeAddress. NFC.

Move MFMA handling to the top of convertToThreeAddress and pull
IsF16 calculation out of the switch. I think this makes it clearer
exactly which mac/fmac opcodes are handled, since they are now
listed in the switch with minimal extra clutter.

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

2 years ago[LLD] [COFF] Use StringTableBuilder to optimize the string table
Martin Storsjö [Mon, 28 Feb 2022 11:01:51 +0000 (13:01 +0200)]
[LLD] [COFF] Use StringTableBuilder to optimize the string table

This does tail merging (and deduplication) of the strings.

On a statically linked clang.exe, this shrinks the ~17 MB string
table by around 0.5 MB. This adds ~160 ms to the linking time
which originally was around 950 ms.

For cases where `-debug:symtab` or `-debug:dwarf` isn't set, the
string table is only used for long section names, where this
shouldn't make any difference at all.

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

2 years ago[AMDGPU] Fix test_fmaak_otherimm_src0_f64 test
Jay Foad [Tue, 1 Mar 2022 16:07:12 +0000 (16:07 +0000)]
[AMDGPU] Fix test_fmaak_otherimm_src0_f64 test

Judging by the name, and comparing with the f32 version, this was
supposed to be testing that FMAC with a non-inlinable constant
operand did not get converted to FMA.

2 years ago[NFC]Promote addInstantiatedParametersToScope to a private Sema function
Erich Keane [Tue, 1 Mar 2022 15:22:44 +0000 (07:22 -0800)]
[NFC]Promote addInstantiatedParametersToScope to a private Sema function

This is used a few places in SemaTeplateInstantiateDecl, but is going
to be useful in SemaConcept.cpp as well. This patch switches it to be
a private function in Sema.

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

2 years ago[NFC][analyzer] Allow CallDescriptions to be matched with CallExprs
Kristóf Umann [Fri, 4 Feb 2022 14:40:08 +0000 (15:40 +0100)]
[NFC][analyzer] Allow CallDescriptions to be matched with CallExprs

Since CallDescriptions can only be matched against CallEvents that are created
during symbolic execution, it was not possible to use it in syntactic-only
contexts. For example, even though InnerPointerChecker can check with its set of
CallDescriptions whether a function call is interested during analysis, its
unable to check without hassle whether a non-analyzer piece of code also calls
such a function.

The patch adds the ability to use CallDescriptions in syntactic contexts as
well. While we already have that in Signature, we still want to leverage the
ability to use dynamic information when we have it (function pointers, for
example). This could be done with Signature as well (StdLibraryFunctionsChecker
does it), but it makes it even less of a drop-in replacement.

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

2 years ago[UpdateTestChecks][AMDGPU] Run test update script
Joe Nash [Tue, 1 Mar 2022 15:25:33 +0000 (10:25 -0500)]
[UpdateTestChecks][AMDGPU] Run test update script

NFC. Run the mir test auto-update script. These tests haven't been updated
since the script changed from inserting CHECK to CHECK-NEXT.

2 years ago[libc] Add LLVM_LIBC_CLANG_TIDY option and allow LLVM_LIBC_ENABLE_LINTING without...
Tue Ly [Mon, 7 Feb 2022 16:46:09 +0000 (11:46 -0500)]
[libc] Add LLVM_LIBC_CLANG_TIDY option and allow LLVM_LIBC_ENABLE_LINTING without full build.

Add LLVM_LIBC_CLANG_TIDY option and allow LLVM_LIBC_ENABLE_LINTING without full build.

Reviewed By: sivachandra

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

2 years ago[Clang-tidy] Check the existence of ElaboratedType's qualifiers
Jun Zhang [Wed, 16 Feb 2022 15:48:27 +0000 (23:48 +0800)]
[Clang-tidy] Check the existence of ElaboratedType's qualifiers

The ElaboratedType can have no qualifiers, so we should check it before
use.

Fix #issue53874(https://github.com/llvm/llvm-project/issues/53874)

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