platform/upstream/llvm.git
3 years ago[DebugInfo] Skip ODRUniquing for mismatched tags
Yuanfang Chen [Tue, 26 Oct 2021 20:58:43 +0000 (13:58 -0700)]
[DebugInfo] Skip ODRUniquing for mismatched tags

Otherwise, ODRUniquing would map some member method/variable MDNodes
to have enum type DIScope, resulting in invalid debug info and bad
DWARF.

- Add a Verifier check that when a 'scope:' operand is an ODR type that is not an enum.
- Makes ODRUniquing apply to only ODR types with the same tag so that the debuginfo/DWARF is well-formed.

Reviewed By: probinson, aprantl

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

3 years agoAdd new key/value pairs to the module statistics for "statistics dump".
Greg Clayton [Tue, 26 Oct 2021 01:03:06 +0000 (18:03 -0700)]
Add new key/value pairs to the module statistics for "statistics dump".

The new key/value pairs that are added to each module's stats are:
"debugInfoByteSize": The size in bytes of debug info for each module.
"debugInfoIndexTime": The time in seconds that it took to index the debug info.
"debugInfoParseTime": The time in seconds that debug info had to be parsed.

At the top level we add up all of the debug info size, parse time and index time with the following keys:
"totalDebugInfoByteSize": The size in bytes of all debug info in all modules.
"totalDebugInfoIndexTime": The time in seconds that it took to index all debug info if it was indexed for all modules.
"totalDebugInfoParseTime": The time in seconds that debug info was parsed for all modules.

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

3 years agoRegenerate LC_CODE_SIGNATURE during llvm-objcopy operations
Nuri Amari [Tue, 26 Oct 2021 21:25:34 +0000 (14:25 -0700)]
Regenerate LC_CODE_SIGNATURE during llvm-objcopy operations

**Context:**

This is a second attempt at introducing signature regeneration to llvm-objcopy. In this diff: https://reviews.llvm.org/D109840, a script was introduced to test
the validity of a code signature. In this diff: https://reviews.llvm.org/D109803 (now reverted), an effort was made to extract the signature generation behavior out of LLD into a common location for use in llvm-objcopy. In this diff: https://reviews.llvm.org/D109972 it was decided that there was no appropriate common location and that a small amount of duplication to bring signature generation to llvm-objcopy would be better. This diff introduces this duplication.

**Summary**

Prior to this change, if a LC_CODE_SIGNATURE load command
was included in the binary passed to llvm-objcopy, the command and
associated section were simply copied and included verbatim in the
new binary. If rest of the binary was modified at all, this results
in an invalid Mach-O file. This change regenerates the signature
rather than copying it.

The code_signature_lc.test test was modified to include the yaml
representation of a small signed MachO executable in order to
effectively test the signature generation.

Reviewed By: alexander-shaposhnikov, #lld-macho

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

3 years ago[formatters] Add a libstdcpp formatter for bitset and unify tests across stdlibs
Danil Stefaniuc [Tue, 26 Oct 2021 21:24:46 +0000 (14:24 -0700)]
[formatters] Add a libstdcpp formatter for bitset and unify tests across stdlibs

This diff adds a data formatter for libstdcpp's bitset. Besides, it unifies the tests for bitset for libcxx and libstdcpp for maintainability.

Reviewed By: wallace

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

3 years ago[InstCombine] try to canonicalize icmp with trunc op into mask and cmp
Sanjay Patel [Tue, 26 Oct 2021 21:41:19 +0000 (17:41 -0400)]
[InstCombine] try to canonicalize icmp with trunc op into mask and cmp

The motivating test is based on:
https://llvm.org/PR52260

We have better analysis for X == 0, so try harder to form that.

3 years ago[InstCombine] add tests for icmp with trunc op; NFC
Sanjay Patel [Tue, 26 Oct 2021 21:09:10 +0000 (17:09 -0400)]
[InstCombine] add tests for icmp with trunc op; NFC

3 years ago[mlir][sparse] refine trait of sparse_tensor.convert
Aart Bik [Tue, 26 Oct 2021 21:16:05 +0000 (14:16 -0700)]
[mlir][sparse] refine trait of sparse_tensor.convert

Rationale:
The currently used trait was demanding that all types are the same
which is not true (since the sparse part may change and the dim sizes
may be relaxed). This revision uses the correct trait and makes the
rank match test explicit in the verify method.

Reviewed By: ftynse

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

3 years ago[Bazel] link backtrace library when building llvm/lib/Support under FreeBSD
William Muir [Tue, 26 Oct 2021 21:23:11 +0000 (14:23 -0700)]
[Bazel] link backtrace library when building llvm/lib/Support under FreeBSD

Links the backtrace library which is required under FreeBSD when building llvm/lib/Support.  This library is similarly linked by CMake on BSD builds at [llvm/lib/Support/CMakeLists.txt](https://github.com/llvm/llvm-project/blob/e158b5634aa67ea3039a62c3d8bda79b77b3b21c/llvm/lib/Support/CMakeLists.txt#L39-L46)

Reviewed By: GMNGeoffrey

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

3 years ago[SLP][NFC]Add a test for poison-free or reduction.
Alexey Bataev [Tue, 26 Oct 2021 21:04:05 +0000 (14:04 -0700)]
[SLP][NFC]Add a test for poison-free or reduction.

3 years ago[mlir][sparse] refactor loop sequence codegen
Aart Bik [Tue, 26 Oct 2021 03:10:42 +0000 (20:10 -0700)]
[mlir][sparse] refactor loop sequence codegen

This refactoring adds a few "event" functions (start/end loop-seq/loop) for
readability of the core function of codegen. This also prepares sparse tensor
output codegen, where these "event" functions will provide convenient
placeholders to start or stop insertion bookkeeping.

This revision also includes a few various minor changes that kept on
pending in my local workspace.

Reviewed By: bixia

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

3 years ago[libomptarget][nfc]Generalise DeviceRTL cmake to allow building for amdgpu
Jon Chesterfield [Tue, 26 Oct 2021 20:18:19 +0000 (21:18 +0100)]
[libomptarget][nfc]Generalise DeviceRTL cmake to allow building for amdgpu

Essentially moves the foreach over sm integers into a macro and instantiates it for nvptx.

NFC in that the macro is not presently instantiated for amdgpu as the corresponding code doesn't compile yet.

Reviewed By: Meinersbur

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

3 years ago[lld-macho] Simplify the handling of "no unwind info" functions
Jez Ng [Tue, 26 Oct 2021 20:04:06 +0000 (16:04 -0400)]
[lld-macho] Simplify the handling of "no unwind info" functions

This diff does away with `addEntriesForFunctionsWithoutUnwindInfo()`,
because `addSymbol()` can now determine which functions need those
entries.

While overhauling UnwindInfoSection, I also parallelized the relocation
of the contents of the CUEs. This somewhat offsets the time regression
from creating one InputSection per CUE (which was done in D109944).

Reviewed By: #lld-macho, oontvoo

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

3 years ago[lld-macho] Associate compact unwind entries with function symbols
Jez Ng [Tue, 26 Oct 2021 20:04:04 +0000 (16:04 -0400)]
[lld-macho] Associate compact unwind entries with function symbols

Compact unwind entries (CUEs) contain pointers to their respective
function symbols. However, during the link process, it's far more useful
to have pointers from the function symbol to the CUE than vice versa.
This diff adds that pointer in the form of `Defined::compactUnwind`.

In particular, when doing dead-stripping, we want to mark CUEs live when
their function symbol is live; and when doing ICF, we want to dedup
sections iff the symbols in that section have identical CUEs. In both
cases, we want to be able to locate the symbols within a given section,
as well as locate the CUEs belonging to those symbols. So this diff also
adds `InputSection::symbols`.

The ultimate goal of this refactor is to have ICF support dedup'ing
functions with unwind info, but that will be handled in subsequent
diffs. This diff focuses on simplifying `-dead_strip` --
`findFunctionsWithUnwindInfo` is no longer necessary, and
`Defined::isLive()` is now a lot simpler. Moreover, UnwindInfoSection no
longer has to check for dead CUEs -- we simply avoid adding them in the
first place.

Additionally, we now support stripping of dead LSDAs, which follows
quite naturally since `markLive()` can now reach them via the CUEs.

Reviewed By: #lld-macho, gkm

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

3 years ago[InstCombine] Precommit new and-xor-or.ll tests. NFC.
Stanislav Mekhanoshin [Tue, 26 Oct 2021 19:57:17 +0000 (12:57 -0700)]
[InstCombine] Precommit new and-xor-or.ll tests. NFC.

3 years ago[fir] Avoid slice with substr in fir.array_load, fir.array_coor and fir.array_merge_store
Valentin Clement [Tue, 26 Oct 2021 19:42:26 +0000 (21:42 +0200)]
[fir] Avoid slice with substr in fir.array_load, fir.array_coor and fir.array_merge_store

Substring information on slice operation has been added in D112441.
The operations fir.array_load, fir.array_coor and fir.array_merge_store can take
a slice but not with a substring. This patch add this check in their verifier.

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

Reviewed By: schweitz

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

3 years ago[mlir] Use float literals to make Windows build happy.
Alexander Belyaev [Tue, 26 Oct 2021 19:35:49 +0000 (21:35 +0200)]
[mlir] Use float literals to make Windows build happy.

3 years agoReinstate "[clang-repl] Re-implement clang-interpreter as a test case."
Vassil Vassilev [Mon, 25 Oct 2021 17:52:20 +0000 (17:52 +0000)]
Reinstate "[clang-repl] Re-implement clang-interpreter as a test case."

Original commit message: "
  Original commit message: "
    Original commit message: "
       Original commit message:"
         The current infrastructure in lib/Interpreter has a tool, clang-repl, very
         similar to clang-interpreter which also allows incremental compilation.

         This patch moves clang-interpreter as a test case and drops it as conditionally
         built example as we already have clang-repl in place.
       "

       This patch also ignores ppc due to missing weak symbol for __gxx_personality_v0
       which may be a feature request for the jit infrastructure. Also, adds a missing
       build system dependency to the orc jit.
    "

    Additionally, this patch defines a custom exception type and thus avoids the
    requirement to include header <exception>, making it easier to deploy across
    systems without standard location of the c++ headers.
  "

  This patch also works around PR49692 and finds a way to use llvm::consumeError
  in rtti mode.
"

This patch also checks if stl is built with rtti.

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

3 years ago[Matrix] Replace some err kinds with err_builtin_invalid_arg_type. (NFC)
Florian Hahn [Tue, 26 Oct 2021 19:19:36 +0000 (20:19 +0100)]
[Matrix] Replace some err kinds with err_builtin_invalid_arg_type. (NFC)

Replace some custom matrix diagnostic kinds with the more generic
err_builtin_invalid_arg_type introduced in D111985.

Reviewed By: aaron.ballman, erichkeane

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

3 years ago[mlir] Update Erf approximation.
Alexander Belyaev [Tue, 26 Oct 2021 19:27:20 +0000 (21:27 +0200)]
[mlir] Update Erf approximation.

3 years ago[fir][NFC] Move RewritePatterns.td to CanonicalizationPatterns.td in Dialect
Valentin Clement [Tue, 26 Oct 2021 19:12:36 +0000 (21:12 +0200)]
[fir][NFC] Move RewritePatterns.td to CanonicalizationPatterns.td in Dialect

RewritePatterns.td/RewritePatterns.inc is used only by the
FIROps.cpp file. This patch move this file logically in the Dialect
folder together with FIRDialet, FIROps, FIRTypes ...
It also rename it to CanonicalizationPatterns.td.

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

Reviewed By: schweitz

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

3 years ago[lldb] [unittests] Fix TcpListen() call in RNBSocketTest
Michał Górny [Tue, 26 Oct 2021 19:08:03 +0000 (21:08 +0200)]
[lldb] [unittests] Fix TcpListen() call in RNBSocketTest

3 years ago[TSan] Ensure test uses tagged pointer
Julian Lettner [Tue, 26 Oct 2021 18:43:04 +0000 (11:43 -0700)]
[TSan] Ensure test uses tagged pointer

This is a test-only failure. The test wrongly assumes that this gets us
a tagged pointer:
```
NSObject* num1 = @7;
assert(isTaggedPtr(num1));
```

However, on newer deployment targets that have “const data support” we
get a “normal” pointer to constant object.

Radar-Id: rdar://problem/83217293

3 years ago[mlir] Allow polynomial approximations for N-d vectors.
Alexander Belyaev [Tue, 26 Oct 2021 18:39:25 +0000 (20:39 +0200)]
[mlir] Allow polynomial approximations for N-d vectors.

Polynomial approximation can be extented to support N-d vectors.
N-dimensional vectors are useful when vectorizing operations on N-dimensional
tiles. Before lowering to LLVM these vectors are usually unrolled or flattened
to 1-dimensional vectors.

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

3 years ago[mlir][python] Segment MLIR Python test dialect to avoid testonly dependency.
Stella Laurenzo [Tue, 26 Oct 2021 17:14:50 +0000 (17:14 +0000)]
[mlir][python] Segment MLIR Python test dialect to avoid testonly dependency.

With https://reviews.llvm.org/rG14c9207063bb00823a5126131e50c93f6e288bd3, the build is broken with -DMLIR_INCLUDE_TESTS=OFF. This patch fixes the build and we may want to do a better fix to the layering in a followup.

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

3 years ago[ARC] Fix `undefined symbol: llvm::MachineFunction::dump() const`
Fangrui Song [Tue, 26 Oct 2021 18:44:18 +0000 (11:44 -0700)]
[ARC] Fix `undefined symbol: llvm::MachineFunction::dump() const`

3 years ago[AST] Fix the EndLoc calculation for ObjCObjectPointer
Luke Petre [Tue, 26 Oct 2021 18:02:08 +0000 (14:02 -0400)]
[AST] Fix the EndLoc calculation for ObjCObjectPointer

There is an issue where the AST code does not compute the correct SourceRange
for a ObjCObjectPointer.

From Richard Smith (ie @zygoloid) in discord:

I think the problem is that we set an invalid location for the * (because there
isn't one): https://github.com/llvm/llvm-project/blob/main/clang/lib/Sema/SemaType.cpp#L1121
And then we use the default getLocalSourceRangeImpl for a PointerLikeTypeLoc
that just assumes the * location is the type's end location:
https://github.com/llvm/llvm-project/blob/main/clang/include/clang/AST/TypeLoc.h#L1293
Possibly we should be special-casing that here:
https://github.com/llvm/llvm-project/blob/main/clang/lib/AST/TypeLoc.cpp#L228

My change:

introduces a AST dump test to show the issue in the first commit
special cases ObjCObjectPointerType in the second commit to correctly compute
the end location

3 years agoFix indentation and pragma name.
Zahira Ammarguellat [Tue, 26 Oct 2021 16:18:28 +0000 (12:18 -0400)]
Fix indentation and pragma name.

3 years agoaddress an test error on window os , exclude the test llvm/test/tools/llvm-readobj...
zhijian [Tue, 26 Oct 2021 17:56:52 +0000 (13:56 -0400)]
address an test error on window os , exclude the test llvm/test/tools/llvm-readobj/XCOFF/xcoff-auxiliary-header.test from
windows OS.
http://45.33.8.238/win/47662/step_11.txt
for
https://reviews.llvm.org/D82549

3 years agoRevert "tsan: turn off COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED"
Dmitry Vyukov [Tue, 26 Oct 2021 17:47:34 +0000 (19:47 +0200)]
Revert "tsan: turn off COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED"

This reverts commit 5ec832269eedeeddcf00d34efd7272a107e2c7c1.

It broke a number of bots, e.g.:
https://lab.llvm.org/buildbot/#/builders/52/builds/11811

Reviewed By: melver

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

3 years ago[libc++][NFC] Mark LWG2731 as complete
Joe Loser [Tue, 26 Oct 2021 17:45:52 +0000 (13:45 -0400)]
[libc++][NFC] Mark LWG2731 as complete

Mark LWG2731 as complete. The type alias `mutex_type` is only provided if
`scoped_lock` is given one mutex type and it has been implemented that
way since the beginning of Clang 5 it seems. There already are tests for
verifying existence (and lack thereof) for `mutex_type` type alias
depending on the number of mutex types, so there is nothing to
do for this LWG issue.

Reviewed By: Quuxplusone, Mordante, #libc

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

3 years ago[mlir] Placeholder used in predicate should be the base type
Chia-hung Duan [Tue, 26 Oct 2021 17:35:15 +0000 (17:35 +0000)]
[mlir] Placeholder used in predicate should be the base type

Added a notification in the placeholder section. While writing things
like preciate of an attribute, we may embed certain placeholder in the C
expression. Note that the type of the placeholder is only guaranteed to
be the base type like mlir::Type, it's better not to use the derived
type which is based on the implementation.

Reviewed By: mehdi_amini

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

3 years ago[NFC][Instcombine] Pre-commit some tests for negative fabs
Usman Nadeem [Tue, 26 Oct 2021 17:22:17 +0000 (10:22 -0700)]
[NFC][Instcombine] Pre-commit some tests for negative fabs

Change-Id: Idcce321c825ecc6b3a111a683e24dc10015f6872

3 years ago[SLP][NFC]Add a test for logical reduction with extra op.
Alexey Bataev [Tue, 26 Oct 2021 17:11:26 +0000 (10:11 -0700)]
[SLP][NFC]Add a test for logical reduction with extra op.

3 years ago[InstCombine] Precommit new and-xor-or.ll tests. NFC.
Stanislav Mekhanoshin [Tue, 26 Oct 2021 17:09:21 +0000 (10:09 -0700)]
[InstCombine] Precommit new and-xor-or.ll tests. NFC.

3 years ago[libc++] Implement shared_ptr methods inline in the class
Louis Dionne [Mon, 25 Oct 2021 19:05:27 +0000 (15:05 -0400)]
[libc++] Implement shared_ptr methods inline in the class

This patch refactors the shared_ptr methods from being defined out-of-line
to being defined inline in the class, like what we do for all new code in
the library. The benefits of doing that are that code is not as scattered
around and is hence easier to understand, and it avoids a ton of duplication
due to SFINAE checks. Defining the method where it is declared also removes
the possibility for mismatched attributes.

As a fly-by change, this also:

- Adds a few _LIBCPP_HIDE_FROM_ABI attributes
- Uses __enable_if_t instead of enable_if as a function argument, to match
  the style that we use everywhere else.

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

3 years ago[NFC][Instcombine] Cleanup some obsolete matches in visitSelectInstr
Usman Nadeem [Tue, 26 Oct 2021 17:07:08 +0000 (10:07 -0700)]
[NFC][Instcombine] Cleanup some obsolete matches in visitSelectInstr

These are now redundant after https://reviews.llvm.org/D106872

Change-Id: I82edfedf1d45cac4e3368d77ce3a48c78e342c19

3 years ago[LoopVectorize] Clean up VPReductionRecipe::execute. NFC
Rosie Sumpter [Tue, 26 Oct 2021 10:24:28 +0000 (11:24 +0100)]
[LoopVectorize] Clean up VPReductionRecipe::execute. NFC

Use RdxDesc->getOpcode instead of getUnderlingInstr()->getOpcode.
Move the code which finds Kind and IsOrdered to be outside the for loop
since neither of these change with the vector part.

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

3 years ago[analyzer] Fix StringChecker for Unknown params
Balazs Benics [Tue, 26 Oct 2021 16:15:00 +0000 (18:15 +0200)]
[analyzer] Fix StringChecker for Unknown params

It seems like protobuf crashed the `std::string` checker.
Somehow it acquired `UnknownVal` as the sole `std::string` constructor
parameter, causing a crash in the `castAs<Loc>()`.

This patch addresses this.

Reviewed By: martong

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

3 years ago[mlir] Fix getVectorReductionOp
Amy Zhuang [Tue, 26 Oct 2021 15:42:22 +0000 (08:42 -0700)]
[mlir] Fix getVectorReductionOp

1.Combining kind min/max of Vector reduction op has been changed to
  minf/maxf, minsi/maxsi, and minui/maxui. Modify getVectorReductionOp
  accordingly.
2.Add min/max to supported reductions.

Reviewed By: dcaballe, nicolasvasilache

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

3 years ago[CodeGen, Hexagon] Use MachineBasicBlock::phis (NFC)
Kazu Hirata [Tue, 26 Oct 2021 16:01:29 +0000 (09:01 -0700)]
[CodeGen, Hexagon] Use MachineBasicBlock::phis (NFC)

3 years ago[Clang] Add elementwise min/max builtins.
Florian Hahn [Tue, 26 Oct 2021 14:38:32 +0000 (15:38 +0100)]
[Clang] Add elementwise min/max builtins.

This patch implements __builtin_elementwise_max and
__builtin_elementwise_min, as specified in D111529.

Reviewed By: aaron.ballman

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

3 years ago[x86] add test/run for mayLoadFold with alignment; NFC
Sanjay Patel [Tue, 26 Oct 2021 14:44:19 +0000 (10:44 -0400)]
[x86] add test/run for mayLoadFold with alignment; NFC

3 years ago[lld-macho] Put GOT into `__DATA` segment where appropriate
Jez Ng [Tue, 26 Oct 2021 15:36:09 +0000 (11:36 -0400)]
[lld-macho] Put GOT into `__DATA` segment where appropriate

We were previously always emitting the GOT into `__DATA_CONST`, even for
target platforms where it should end up in `__DATA`.

I stumbled onto this while trying to use the `class-dump` tool -- with
the wrong segment names, it fails to locate the ObjC runtime info and
therefore fails to dump any classes.

Reviewed By: #lld-macho, oontvoo

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

3 years ago[clangd] AddUsing: Fix support for template specializations.
Adam Czachorowski [Tue, 26 Oct 2021 13:04:03 +0000 (15:04 +0200)]
[clangd] AddUsing: Fix support for template specializations.

Before this change, we would add "using std::vector<int>" instead of
just "using std::vector;", which would not even compile.

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

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

3 years ago[clangd] Fix a hover crash on templated spaceship operator.
Adam Czachorowski [Tue, 26 Oct 2021 11:34:10 +0000 (13:34 +0200)]
[clangd] Fix a hover crash on templated spaceship operator.

We make assumption that:
getDeclForComment(getDeclForComment(X)) == getDeclForComment(X)
but this is not true if you have a template
instantionation of a template instantiation, which is the case when, for
example, you have a <=> operator in a templated class.

This fix makes getDeclForComment() call itself recursively to ensure
this property is always true.

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

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

3 years ago[clang] Do not traverse EnumDecl's type in RecursiveASTVisitor
Kirill Bobyrev [Tue, 26 Oct 2021 15:10:51 +0000 (17:10 +0200)]
[clang] Do not traverse EnumDecl's type in RecursiveASTVisitor

This is inconsistent with the code and comments in
RecursiveASTVisitor.h and is not a correct behavior:

https://github.com/llvm/llvm-project/blob/main/clang/include/clang/AST/RecursiveASTVisitor.h#L1879-L1880

> We shouldn't traverse D->getTypeForDecl(); it's a result of
> declaring the type, not something that was written in the source.

Fixes the failures in 1c2e249f938c50e1b331a1f7adc83c0a381f3897

3 years ago[libFuzzer] Improve corpus replacement unit test.
Matt Morehouse [Tue, 26 Oct 2021 15:08:23 +0000 (08:08 -0700)]
[libFuzzer] Improve corpus replacement unit test.

Verify that SecondII is not replaced.

3 years ago[SystemZ] Improvement of emitMemMemWrapper()
Jonas Paulsson [Tue, 19 Oct 2021 10:47:15 +0000 (12:47 +0200)]
[SystemZ] Improvement of emitMemMemWrapper()

It was discovered that an extra register COPY remained when expanding a
(variable length) memory operation with a loop and there was another use of
the involved address register(s) afterwards.

A simple fix for this is to COPY the address registers before the loop and
use that new vreg instead.

Review: Ulrich Weigand

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

3 years ago[SLP]Do not reorder reduction nodes.
Alexey Bataev [Mon, 25 Oct 2021 16:40:59 +0000 (09:40 -0700)]
[SLP]Do not reorder reduction nodes.

The final reduction nodes should not be reordered, the order does not
matter for reductions. Also, it might be profitable to vectorize smaller
reduction trees, reduction cost may compensate small tree cost.

Part of D111574

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

3 years ago[AIX][XCOFF] parsing xcoff object file auxiliary header
zhijian [Tue, 26 Oct 2021 14:40:25 +0000 (10:40 -0400)]
[AIX][XCOFF] parsing xcoff object file auxiliary header
Summary:

The patch supports parsing the xcoff object file auxiliary header with llvm-readobj with option "auxiliary-headers"

the format of auxiliary header as
https://www.ibm.com/support/knowledgecenter/en/ssw_aix_72/filesreference/XCOFF.html#XCOFF__fyovh386shar

Reviewers: James Henderson, Jason Liu, Hubert Tong, Esme yi, Sean Fertile.

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

3 years agoSpecify Clang vector builtins.
Florian Hahn [Mon, 25 Oct 2021 08:55:21 +0000 (09:55 +0100)]
Specify Clang vector builtins.

This patch specifies a set of vector builtins for Clang, as discussed on
cfe-dev:
https://lists.llvm.org/pipermail/cfe-dev/2021-September/068999.html
https://lists.llvm.org/pipermail/cfe-dev/2021-October/069070.html

Reviewed By: scanon

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

3 years ago[libc++] Include nasty_macros.h when running tests with from-scratch configs
Louis Dionne [Mon, 25 Oct 2021 14:59:59 +0000 (10:59 -0400)]
[libc++] Include nasty_macros.h when running tests with from-scratch configs

This was forgotten when setting up the from-scratch configs.

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

3 years agotsan: turn off COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED
Dmitry Vyukov [Mon, 25 Oct 2021 12:58:43 +0000 (14:58 +0200)]
tsan: turn off COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED

All tsan interceptors check for initialization and/or initialize things
as necessary lazily, so we can pretend everything is initialized in the
COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED check to avoid double-checking
for initialization (this is only necessary for sanitizers that don't
handle initialization on common grounds).

Reviewed By: melver

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

3 years agosanitizer_common: fix deadlock detector output
Dmitry Vyukov [Tue, 26 Oct 2021 13:01:09 +0000 (15:01 +0200)]
sanitizer_common: fix deadlock detector output

Print PC of the previous lock, not the current one.
The current one will be printed during unwind.

Reviewed By: melver

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

3 years ago[clangd] IncludeCleaner: don't stop the traversal
Kirill Bobyrev [Tue, 26 Oct 2021 14:08:54 +0000 (16:08 +0200)]
[clangd] IncludeCleaner: don't stop the traversal

I was under the impression that `return false;` in the
RecursiveASTVisitor stops the traversal for the subtree but it appears
that it stops the whole tree traversal, so this change introduces a bug
where `ReferencedLocationCrawler` will not collect any symbols past an
enum.

This is a follow-up on D112209.

3 years ago[AMDGPU] Remove unused CSR defs
Neubauer, Sebastian [Tue, 26 Oct 2021 13:45:10 +0000 (15:45 +0200)]
[AMDGPU] Remove unused CSR defs

CSR_AMDGPU_VGPRs_24_255 and CSR_AMDGPU_VGPRs_32_255 are not used
anywhere, so remove them.

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

3 years ago[openmp][lit] Add support to OpenMP lit.cfg for ROCR_VISIBLE_DEVICES env-var
Ron Lieberman [Tue, 26 Oct 2021 01:53:15 +0000 (01:53 +0000)]
[openmp][lit] Add support to OpenMP lit.cfg for ROCR_VISIBLE_DEVICES env-var

add support for ROCR_VISIBLE_DEVICES similar to name and purpose
as CUDA_VISIBLE_DEVICES

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

3 years ago[clang] Implement CFG construction for @try and @catch
Nico Weber [Thu, 21 Oct 2021 10:53:12 +0000 (06:53 -0400)]
[clang] Implement CFG construction for @try and @catch

@finally is still not implemented.

With this, clang can emit -Wreturn-type warnings for functions containing
@try/@catch (but not yet @finally), and -Wunreachable-code also works for those
functions.

The implementation is similar to D36914.

Part of PR46693.

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

3 years ago[clang] Make loop in CFGBuilder::VisitCXXTryStmt() more canonical
Nico Weber [Tue, 26 Oct 2021 13:35:20 +0000 (09:35 -0400)]
[clang] Make loop in CFGBuilder::VisitCXXTryStmt() more canonical

No behavior change.

3 years ago[clang] Simplify CFG block printing code a bit
Nico Weber [Tue, 26 Oct 2021 13:29:41 +0000 (09:29 -0400)]
[clang] Simplify CFG block printing code a bit

No behavior change.

3 years ago[clang] Use consistent punctuation at end of Block NULL comment
Nico Weber [Tue, 26 Oct 2021 13:23:16 +0000 (09:23 -0400)]
[clang] Use consistent punctuation at end of Block NULL comment

No behavior change.

3 years ago[AMDGPU] Add constrained shift pattern matches.
Abinav Puthan Purayil [Wed, 22 Sep 2021 10:32:52 +0000 (16:02 +0530)]
[AMDGPU] Add constrained shift pattern matches.

The motivation for this is due to clang's conformance to
https://www.khronos.org/registry/OpenCL/specs/3.0-unified/html/OpenCL_C.html#operators-shift
which makes clang emit (<shift> a, (and b, <width> - 1)) for `a <shift> b`
in OpenCL where a is an int of bit width <width>.

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

3 years ago[libunwind] Take 2: Use the from-scratch testing configuration by default
Louis Dionne [Tue, 12 Oct 2021 18:10:02 +0000 (14:10 -0400)]
[libunwind] Take 2: Use the from-scratch testing configuration by default

Summary:
This commit switches libunwind from using the complicated logic in
libc++'s testing configuration to a from-scratch configuration.
I tried to make sure that all cases that were handled in the old
config were handled by this one too, so hopefully this shouldn't
break anyone. However, if you encounter issues with this change,
please let me know and feel free to revert if I don't reply quickly.

This change was engineered to be easily revertable.

This commit is a re-application of 5a8ad80b6fa5, which was reverted in
070a2ddcb665 because it broke the Bootstrapping build. This has now been
addressed by tweaking the from-scratch config.

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

3 years ago[PowerPC] use right extend type for SCEV
Chen Zheng [Tue, 26 Oct 2021 01:33:27 +0000 (01:33 +0000)]
[PowerPC] use right extend type for SCEV

Fix an issue caused by D108750

Reviewed By: nemanjai

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

3 years ago[AMDGPU] Enable 48-bit mul in AMDGPUCodeGenPrepare.
Abinav Puthan Purayil [Sat, 23 Oct 2021 15:35:32 +0000 (21:05 +0530)]
[AMDGPU] Enable 48-bit mul in AMDGPUCodeGenPrepare.

We were bailing out of creating 24-bit muls for results wider than 32
bits in AMDGPUCodeGenPrepare. With the 24-bit mulhi intrinsic, this
change teaches AMDGPUCodeGenPrepare to generate the 48-bit mul
correctly.

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

3 years ago[AMDGPU] Implement llvm.amdgcn.mulhi.[i,u]24 intrinsics.
Abinav Puthan Purayil [Sat, 23 Oct 2021 07:15:32 +0000 (12:45 +0530)]
[AMDGPU] Implement llvm.amdgcn.mulhi.[i,u]24 intrinsics.

These intrinsics maps to the 24-bit v_mul_hi instructions.

This change also fixes an incorrect assumption on the associativity of
24-bit mulhi in its SDNode record in tblgen.

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

3 years ago[fir][NFC] Fix indentation for fir.alloca builders
Valentin Clement [Tue, 26 Oct 2021 12:55:47 +0000 (14:55 +0200)]
[fir][NFC] Fix indentation for fir.alloca builders

3 years ago[x86] use cast instead of dyn_cast for unchecked usage; NFC
Sanjay Patel [Tue, 26 Oct 2021 12:10:34 +0000 (08:10 -0400)]
[x86] use cast instead of dyn_cast for unchecked usage; NFC

This was noted as an independent clean-up in D112464.

3 years ago[x86] add test for vector increment; NFC
Sanjay Patel [Mon, 25 Oct 2021 19:45:08 +0000 (15:45 -0400)]
[x86] add test for vector increment; NFC

3 years ago[clangd] Remove tricky integration test that flakes/fails on some platforms.
Sam McCall [Tue, 26 Oct 2021 12:19:05 +0000 (14:19 +0200)]
[clangd] Remove tricky integration test that flakes/fails on some platforms.

This functionality is covered by unittests, will add a better
integration test soon.

3 years ago[lldb] [Host] Move port predicate-related logic to gdb-remote
Michał Górny [Sat, 23 Oct 2021 09:15:00 +0000 (11:15 +0200)]
[lldb] [Host] Move port predicate-related logic to gdb-remote

Remove the port predicate from Socket and ConnectionFileDescriptor,
and move it to gdb-remote.  It is specifically relevant to the threading
used inside gdb-remote and with the new port callback API, we can
reliably move it there.  While at it, switch from the custom Predicate
to std::promise/std::future.

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

3 years ago[AMDGPU] Fix setcc combine for i128
Neubauer, Sebastian [Mon, 25 Oct 2021 08:58:01 +0000 (10:58 +0200)]
[AMDGPU] Fix setcc combine for i128

The combine asserted if constants could not be represented as uint64_t.
Use APInts to fix this.

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

3 years ago[AMDGPU] Use standard MachineBasicBlock::getFallThrough method. NFCI.
Jay Foad [Tue, 4 May 2021 10:14:42 +0000 (11:14 +0100)]
[AMDGPU] Use standard MachineBasicBlock::getFallThrough method. NFCI.

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

3 years ago[lldb] [lldb-gdbserver] Unify listen/connect code to use ConnectionFileDescriptor
Michał Górny [Fri, 22 Oct 2021 15:42:23 +0000 (17:42 +0200)]
[lldb] [lldb-gdbserver] Unify listen/connect code to use ConnectionFileDescriptor

Unify the listen and connect code inside lldb-server to use
ConnectionFileDescriptor uniformly rather than a mix of it and Acceptor.
This involves:

- adding a function to map legacy values of host:port parameter
  (including legacy server URLs) into CFD-style URLs

- adding a callback to return "local socket id" (i.e. UNIX socket path
  or TCP port number) between listen() and accept() calls in CFD

- adding a "unix-abstract-accept" scheme to CFD

As an additional advantage, this permits lldb-server to accept any URL
known to CFD including the new serial:// scheme.  Effectively,
lldb-server can now listen on the serial port.  Tests for connecting
over a pty are added to test that.

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

3 years ago[lldb] Fix PlatformAppleSimulator for a458ef4f
Pavel Labath [Tue, 26 Oct 2021 11:03:09 +0000 (13:03 +0200)]
[lldb] Fix PlatformAppleSimulator for a458ef4f

3 years ago[clangd] Add a way to enable IncludeCleaner through config
Kirill Bobyrev [Tue, 26 Oct 2021 09:53:34 +0000 (11:53 +0200)]
[clangd] Add a way to enable IncludeCleaner through config

This is useful for dogfooding the feature and spotting bugs.

Reviewed By: sammccall

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

3 years ago[MLIR] Fix AffineExpr getLargestKnownDivisor for ceildiv and floordiv
Uday Bondhugula [Mon, 11 Oct 2021 10:18:06 +0000 (15:48 +0530)]
[MLIR] Fix AffineExpr getLargestKnownDivisor for ceildiv and floordiv

Fix AffineExpr `getLargestKnownDivisor` for ceil/floor div cases.
In these cases, nothing can be inferred on the divisor of the
result.

Add test case for `mod` as well.

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

3 years ago[lldb] [Communication] Add a WriteAll() method that resumes writing
Michał Górny [Wed, 20 Oct 2021 19:28:25 +0000 (21:28 +0200)]
[lldb] [Communication] Add a WriteAll() method that resumes writing

Add a Communication::WriteAll() that resumes Write() if the initial call
did not write all data.  Use it in GDBRemoteCommunication when sending
packets in order to fix handling partial writes (i.e. just resume/retry
them rather than erring out).  This fixes LLDB failures when writing
large packets to a pty.

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

3 years ago[SystemZ] Provide size values for PATCHPOINT, STACKMAP and FENTRY_CALL.
Jonas Paulsson [Mon, 25 Oct 2021 14:02:20 +0000 (16:02 +0200)]
[SystemZ] Provide size values for PATCHPOINT, STACKMAP and FENTRY_CALL.

All instructions must have a correct size value close to emission when
SystemZLongBranch runs, or a necessary branch relaxation may be missed.

This patch also adds an assert for instruction sizes in SystemZLongBranch.

Review: Ulrich Weigand

3 years ago[LangRef] Document that DataLayout defaults to little-endian
Fraser Cormack [Fri, 22 Oct 2021 14:19:25 +0000 (15:19 +0100)]
[LangRef] Document that DataLayout defaults to little-endian

Little-endian has apparently been the default since 2014.

Reviewed By: nikic

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

3 years ago[AArch64] Add a costmodel test for overflowing arithmatic. NFC
David Green [Tue, 26 Oct 2021 09:35:12 +0000 (10:35 +0100)]
[AArch64] Add a costmodel test for overflowing arithmatic. NFC

3 years agoModernize and simplify HostInfo::GetOSKernelDescription
Pavel Labath [Mon, 25 Oct 2021 14:44:12 +0000 (16:44 +0200)]
Modernize and simplify HostInfo::GetOSKernelDescription

Replace bool+by-ref argument with llvm::Optional, and move the common
implementation into HostInfoPOSIX. Based on my (simple) experiment,
the uname and the sysctl approach return the same value on MacOS, so
there's no need for a mac-specific implementation of this functionality.

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

3 years ago[SCEV] Use reverse() (NFC)
Nikita Popov [Tue, 26 Oct 2021 09:08:58 +0000 (11:08 +0200)]
[SCEV] Use reverse() (NFC)

3 years ago[clangd] IncludeCleaner: Don't consider the definition as usage for function forward...
Kirill Bobyrev [Tue, 26 Oct 2021 08:37:05 +0000 (10:37 +0200)]
[clangd] IncludeCleaner: Don't consider the definition as usage for function forward declarations

Reviewed By: kadircet

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

3 years ago[fir] Add substring to fir.slice operation
Valentin Clement [Tue, 26 Oct 2021 08:32:48 +0000 (10:32 +0200)]
[fir] Add substring to fir.slice operation

This patch adds the substriing information to the fir.slice
operation. This will be used by character operations in later
upstreaming patches.

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

Reviewed By: jeanPerier

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

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
3 years ago[lldb] Remove ConstString from Platform plugin names
Pavel Labath [Thu, 21 Oct 2021 19:00:33 +0000 (21:00 +0200)]
[lldb] Remove ConstString from Platform plugin names

3 years ago[lldb/DWARF] Move a declaration closer to its use
Pavel Labath [Tue, 26 Oct 2021 07:58:10 +0000 (09:58 +0200)]
[lldb/DWARF] Move a declaration closer to its use

Adresses post-commit feedback on D112310.

3 years agoMake Python MLIR Operation not iterable
Mehdi Amini [Wed, 20 Oct 2021 19:51:52 +0000 (19:51 +0000)]
Make Python MLIR Operation not iterable

The current behavior is conveniently allowing to iterate on the regions of an operation
implicitly by exposing an operation as Iterable. However this is also error prone and
code that may intend to iterate on the results or the operands could end up "working"
apparently instead of throwing a runtime error.
The lack of static type checking in Python contributes to the ambiguity here, it seems
safer to not do this and require and explicit qualification to iterate (`op.results`, `op.regions`, ...).

Reviewed By: ftynse

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

3 years ago[LLDB] Fix LLDB buildbots break due to --image-base
Muhammad Omair Javaid [Tue, 26 Oct 2021 07:07:11 +0000 (12:07 +0500)]
[LLDB] Fix LLDB buildbots break due to --image-base

LLDB build were failing due to following two test failures:
lldb-shell :: ObjectFile/ELF/basic-info.yaml
lldb-shell :: SymbolFile/DWARF/x86/debug-types-address-ranges.s

There were caused by commit 6506907a0a1a8a789ad7036ef911f7e31213c9a5

3 years ago[llvm-profgen] Allow unsymbolized profile as perf input
wlei [Fri, 15 Oct 2021 03:18:53 +0000 (20:18 -0700)]
[llvm-profgen] Allow unsymbolized profile as perf input

This change allows the unsymbolized profile as input. The unsymbolized profile is created by `llvm-profgen` with `--skip-symbolization` and it's after the sample aggregation but before symbolization , so it has much small file size. It can be used for sample merging and trimming,  also is useful for debugging or adding test cases. A switch `--unsymbolized-profile=file-patch` is added for this.

Format of unsymbolized profile:
```

   [context stack1]    # If it's a CS profile
      number of entries in RangeCounter
      from_1-to_1:count_1
      from_2-to_2:count_2
      ......
      from_n-to_n:count_n
      number of entries in BranchCounter
      src_1->dst_1:count_1
      src_2->dst_2:count_2
      ......
      src_n->dst_n:count_n
    [context stack2]
      ......
```

Reviewed By: hoy, wenlei

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

3 years ago[NFC] Remove obsolete simplifyOnceImpl function
Max Kazantsev [Tue, 26 Oct 2021 06:38:03 +0000 (13:38 +0700)]
[NFC] Remove obsolete simplifyOnceImpl function

The function simplifyOnce only calls simplifyOnceImpl and does nothing else.
Having this separate helper makes no sense. Removing it.

Patch by Dmitry Bakunevich!

Differential Revision: https://reviews.llvm.org/D112517
Reviewed By: mkazantsev

3 years agollvm pretty printers: Fix StringRef and workaround StringMap in Python 2
David Blaikie [Tue, 26 Oct 2021 06:48:09 +0000 (23:48 -0700)]
llvm pretty printers: Fix StringRef and workaround StringMap in Python 2

3 years ago[NFC] [LoopPeel] Update IDoms of non-loop blocks dominated by the loop
Max Kazantsev [Tue, 26 Oct 2021 06:09:07 +0000 (13:09 +0700)]
[NFC] [LoopPeel] Update IDoms of non-loop blocks dominated by the loop

When peeling a loop, we assume that the latch has a `br` terminator and that
all loop exits are either terminated with an `unreachable` or have a terminating
deoptimize call. So when we peel off the 1st iteration, we change the IDom of
all loop exits to the peeled copy of `NCD(IDom(Exit), Latch)`. This works now,
but if we add logic to support loops with exits that are followed by a block
with an `unreachable` or a terminating deoptimize call, changing the exit's idom
wouldn't be enough and DT would be broken.

For example, let `Exit1` and `Exit2` are loop exits, and each of them
unconditionally branches to the same `unreachable` terminated block. So neither
of the exits dominates this unreachable block. If we change the IDoms of the
exits to some peeled loop block, we don't update the dominators of the unreachable
block. Currently we just don't get to the peeling logic, saying that we can't peel
such loops.

Previously we stored exits' IDoms in a map before peeling a loop and then, after
peeling off one iteration, we changed their IDoms.
Now we use the same logic not only for exits but for all non-loop blocks dominated
by the loop.
So when we add logic to support peeling loops with exits which branch, for example,
to an unreachable-terminated block, we would update the IDoms not only for exits,
but for their successors.

Patch by Dmitry Makogon!

Differential Revision: https://reviews.llvm.org/D111611
Reviewed By: mkazantsev, nikic

3 years ago[clang-tidy] Suppress readability-static-access-through-instance for CUDA built-in...
Carlos Galvez [Fri, 22 Oct 2021 17:38:34 +0000 (17:38 +0000)]
[clang-tidy] Suppress readability-static-access-through-instance for CUDA built-in variables

clang-tidy can be used to statically analyze CUDA code,
thanks to clang being able to compile CUDA code natively.
This makes clang-tidy the one and only open-source
static analyzer for CUDA.

However it currently warns for native CUDA built-in
variables, like threadIdx, due to the way they
are implemented in clang.

Users don't need to know the details of the clang
implementation, and they should continue to write
idiomatic code. Therefore, suppress the warning
if a CUDA built-in variable is encountered.

Fixes https://bugs.llvm.org/show_bug.cgi?id=48758

3 years ago[X86] Move splat addends from the gather/scatter index operand to the base address
Phoebe Wang [Tue, 26 Oct 2021 03:56:15 +0000 (11:56 +0800)]
[X86] Move splat addends from the gather/scatter index operand to the base address

This can avoid a vector add and a constant pool load. Or an explicit broadcast in case of non-constant.

Also reverse the transform any time we encounter a constant index addend that can't be moved to base. In that case pull the constant from base into the index. This reduces code size needed for the displacement since we needed the index add anyway. Limit this to scale of 1 to avoid divisibility and wrap issues.

Authored by Craig.

Reviewed By: craig.topper

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

3 years ago[mlir-c] Avoid compiler warning
Jacques Pienaar [Tue, 26 Oct 2021 04:11:50 +0000 (21:11 -0700)]
[mlir-c] Avoid compiler warning

Setting visibility & static leads to warning about attribute being
ignored.

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

3 years ago[TableGen] Fix codgen of InstrMapping with multiple columns and values
Jyun-Yan You [Tue, 26 Oct 2021 04:00:23 +0000 (21:00 -0700)]
[TableGen] Fix codgen of InstrMapping with multiple columns and values

This patch fixes invalid syntax of generated code for InstrMapping
that has multiple columns and values.

Reviewed By: craig.topper

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

3 years ago[lldb] Skip tests for target var without a proc on both arm64 & arm64e
Jonas Devlieghere [Tue, 26 Oct 2021 03:44:59 +0000 (20:44 -0700)]
[lldb] Skip tests for target var without a proc on both arm64 & arm64e

LLDB needs to be taught about chained fixups.

<rdar://problem/37773624>

3 years ago[AIX][ZOS] Disable tests due to lack of Objective-C support
Jake Egan [Tue, 26 Oct 2021 03:32:02 +0000 (23:32 -0400)]
[AIX][ZOS] Disable tests due to lack of Objective-C support

AIX and z/OS lack Objective-C support, so mark these tests as unsupported for AIX and z/OS.

This patch follows the same reasoning as D109060.

Reviewed By: jsji

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

3 years ago[clangd] Attempt to fix buildbots
Shoaib Meenai [Tue, 26 Oct 2021 03:16:59 +0000 (20:16 -0700)]
[clangd] Attempt to fix buildbots

http://45.33.8.238/win/47615/step_4.txt is a sample error; I believe it
just needs the right header to be included.