platform/upstream/llvm.git
3 years ago[flang][NFC] Add source line to lowering TODO messages
Jean Perier [Tue, 23 Feb 2021 08:00:48 +0000 (09:00 +0100)]
[flang][NFC] Add source line to lowering TODO messages

- Add a fatal error handler that can print a message with source location
  before aborting.
- Update TODO macro to take an mlir location argument and to use the
  newly introduced fatal error handler.
- Introduce TODO_NOLOC for the few places where no source location is
  easily accessible.

Reviewed By: schweitz

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

3 years ago[CMake][profile] Don't use `TARGET lld` to avoid ordering issues
Petr Hosek [Tue, 23 Feb 2021 06:19:55 +0000 (22:19 -0800)]
[CMake][profile] Don't use `TARGET lld` to avoid ordering issues

Depending on the order in which lld and compiler-rt projects are
processed by CMake, `TARGET lld` might evaluate to `TRUE` or `FALSE`
even though `lld-available` lit stanza is always set because lld is
being built. We check whether lld project is enabled instead which
is used by other compiler-rt tests.

The ideal solution here would be to use CMake generator expressions,
but those cannot be used for dependencies yet, see:
https://gitlab.kitware.com/cmake/cmake/-/issues/19467

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

3 years ago[MLIR][LinAlg] Start detensoring implementation.
KareemErgawy-TomTom [Tue, 16 Feb 2021 06:42:41 +0000 (07:42 +0100)]
[MLIR][LinAlg] Start detensoring implementation.

This commit is the first baby step towards detensoring in
linalg-on-tensors.

Detensoring is the process through which a tensor value is convereted to one
or potentially more primitive value(s). During this process, operations with
such detensored operands are also converted to an equivalen form that works
on primitives.

The detensoring process is driven by linalg-on-tensor ops. In particular, a
linalg-on-tensor op is checked to see whether *all* its operands can be
detensored. If so, those operands are converted to thier primitive
counterparts and the linalg op is replaced by an equivalent op that takes
those new primitive values as operands.

This works towards handling github/google/iree#1159.

Reviewed By: nicolasvasilache

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

3 years ago[NFC][libc++] Fix _LIBCPP_HAS_BITSCAN64 usage.
Mark de Wever [Mon, 22 Feb 2021 19:31:47 +0000 (20:31 +0100)]
[NFC][libc++] Fix _LIBCPP_HAS_BITSCAN64 usage.

Seems line was accidentally left in
llvm-svn: 290924 86eebc5b658b5c2ccf2f4fbc16e8aee9880919a5

Reviewed By: #libc, ldionne

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

3 years ago[builtins] Replace __SOFT_FP__ with __SOFTFP__
Kamlesh Kumar [Tue, 23 Feb 2021 06:57:23 +0000 (22:57 -0800)]
[builtins] Replace __SOFT_FP__ with __SOFTFP__

Fix PR46294

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

3 years ago[docs][ORC] Fix section title and reference.
Lang Hames [Tue, 23 Feb 2021 06:37:36 +0000 (17:37 +1100)]
[docs][ORC] Fix section title and reference.

3 years ago[SLP][Test] Add test for PR49081.ll
Anton Afanasyev [Tue, 23 Feb 2021 04:55:55 +0000 (07:55 +0300)]
[SLP][Test] Add test for PR49081.ll

3 years agoMove the MLIR integration tests as a subdirectory of test (NFC)
Mehdi Amini [Tue, 23 Feb 2021 00:56:01 +0000 (00:56 +0000)]
Move the MLIR integration tests as a subdirectory of test (NFC)

This does not change the behavior directly: the tests only run when
`-DMLIR_INCLUDE_INTEGRATION_TESTS=ON` is configured. However running
`ninja check-mlir` will not run all the tests within a single
lit invocation. The previous behavior would wait for all the integration
tests to complete before starting to run the first regular test. The
test results were also reported separately. This change is unifying all
of this and allow concurrent execution of the integration tests with
regular non-regression and unit-tests.

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

3 years ago[libc][NFC] Eliminate couple of dependencies on llvm/ADT/StringExtras.h.
Siva Chandra Reddy [Tue, 23 Feb 2021 05:39:12 +0000 (21:39 -0800)]
[libc][NFC] Eliminate couple of dependencies on llvm/ADT/StringExtras.h.

3 years ago[BuildLibCalls] Add noundef to allocator fns' size
Juneyoung Lee [Fri, 19 Feb 2021 07:41:19 +0000 (16:41 +0900)]
[BuildLibCalls] Add noundef to allocator fns' size

This is a patch to explicitly mark the size parameter of allocator functions like malloc/realloc/... as noundef.

For C/C++: undef can be created from reading an uninitialized variable or padding.
Calling a function with uninitialized variable is already UB.
Calling malloc with padding value is.. something that's not expected. Padding bits may appear in a coerced aggregate, which doesn't apply to malloc's size.
Therefore, malloc's size can be marked as noundef.

For transformations that introduce malloc/realloc/..: I ran LLVM unit tests with an updated Alive2 semantics, and found no regression, so it seems okay.

Reviewed By: jdoerfert

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

3 years agoOnly verify LazyCallGraph under expensive checks
Arthur Eubanks [Mon, 22 Feb 2021 21:36:29 +0000 (13:36 -0800)]
Only verify LazyCallGraph under expensive checks

These verify calls are causing a lot of slowdown on some files, up to 8x.
The LazyCallGraph infra has been tested a lot over the years, so I'm fairly confident that we don't always need to run the verifys.

These verifies took >90% of total time in one of the compilations I looked at.

Reviewed By: thakis

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

3 years ago[Analysis] Use range-based for loops (NFC)
Kazu Hirata [Tue, 23 Feb 2021 04:17:18 +0000 (20:17 -0800)]
[Analysis] Use range-based for loops (NFC)

3 years ago[llvm] Use llvm::drop_begin (NFC)
Kazu Hirata [Tue, 23 Feb 2021 04:17:16 +0000 (20:17 -0800)]
[llvm] Use llvm::drop_begin (NFC)

3 years ago[Analysis] Use ListSeparator (NFC)
Kazu Hirata [Tue, 23 Feb 2021 04:17:15 +0000 (20:17 -0800)]
[Analysis] Use ListSeparator (NFC)

3 years ago[libc] [Obvious] Fix.
Raman Tenneti [Tue, 23 Feb 2021 03:14:21 +0000 (19:14 -0800)]
[libc] [Obvious] Fix.

3 years ago[mlir][pdl][NFC] Extract the execution of each bytecode operation into its own function
River Riddle [Tue, 23 Feb 2021 03:01:01 +0000 (19:01 -0800)]
[mlir][pdl][NFC] Extract the execution of each bytecode operation into its own function

This makes the implementation of each bytecode operation much easier to reason about, and lets the compiler decide which implementations are beneficial to inline into the main switch.

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

3 years ago[mlir][pdl] Fix bug when ordering predicates
River Riddle [Tue, 23 Feb 2021 03:00:54 +0000 (19:00 -0800)]
[mlir][pdl] Fix bug when ordering predicates

We should be ordering predicates with higher primary/secondary sums first, but we are currently ordering them last. This allows for predicates more frequently encountered to be checked first.

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

3 years ago[GVN] Fix a typo in comment
ksyx [Wed, 17 Feb 2021 08:43:34 +0000 (16:43 +0800)]
[GVN] Fix a typo in comment

NFC.

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

Reviewed By: fhahn

3 years agoChanges to mktime to handle invalid dates, overflow and underflow andcalculating...
Raman Tenneti [Tue, 23 Feb 2021 02:03:11 +0000 (18:03 -0800)]
Changes to mktime to handle invalid dates, overflow and underflow andcalculating the correct date and thenumber of seconds even if invalid datesare passed as arguments.

Added tests for invalid dates like the following
  Date 1970-01-01 00:00:-1 is treated as 1969-12-31 23:59:59 and seconds
  are returned for the modified date.

Tested the code by doing ninja check-libc (and cmake).

Reviewed By: sivachandra, rtenneti

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

3 years ago[dfsan] Propagate origins at non-memory/phi/call instructions
Jianzhou Zhao [Sun, 21 Feb 2021 19:38:56 +0000 (19:38 +0000)]
[dfsan] Propagate origins at non-memory/phi/call instructions

This is a part of https://reviews.llvm.org/D95835.

Reviewed-by: morehouse
Differential Revision: https://reviews.llvm.org/D97200

3 years ago[obj2yaml,yaml2obj] Add NumBlocks to the BBAddrMapEntry yaml field.
Rahman Lavaee [Tue, 23 Feb 2021 01:50:14 +0000 (17:50 -0800)]
[obj2yaml,yaml2obj] Add NumBlocks to the BBAddrMapEntry yaml field.

As discussed in D95511, this allows us to encode invalid BBAddrMap
sections to be used in more rigorous testing.

Reviewed By: jhenderson

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

3 years ago[lldb] add check for libcxx runtime
Richard Howell [Tue, 23 Feb 2021 01:53:18 +0000 (17:53 -0800)]
[lldb] add check for libcxx runtime

When enabling LLDB tests with `LLVM_ENABLE_RUNTIMES=libcxx` CMake will
fail with:

```
LLDB test suite requires libc++, but it is currently disabled.
```

The issue is that the targets in LLVM_ENABLE_RUNTIMES are configured
after the targets in LLVM_ENABLE_PROJECTS, so at this point the check
for the `cxx` target will fail. CMake will add a dependency for a target
that does not exist yet however, so by first checking for `libcxx` in
LLVM_ENABLE_RUNTIMES we ensure that the `cxx` target will be present at
build time.

Tested with:
```
% cmake -G Ninja \
    -C ~/local/llvm-project/lldb/cmake/caches/Apple-lldb-macOS.cmake \
    -DLLVM_ENABLE_PROJECTS="clang;lldb" -DLLVM_ENABLE_RUNTIMES="libcxx" \
    -DLIBCXX_INCLUDE_TESTS=NO ~/local/llvm-project/llvm
% ninja check-lldb
```

Reviewed By: smeenai, JDevlieghere

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

3 years ago[mlir][IR] Refactor the `getChecked` and `verifyConstructionInvariants` methods on...
River Riddle [Tue, 23 Feb 2021 01:30:19 +0000 (17:30 -0800)]
[mlir][IR] Refactor the `getChecked` and `verifyConstructionInvariants` methods on Attributes/Types

`verifyConstructionInvariants` is intended to allow for verifying the invariants of an attribute/type on construction, and `getChecked` is intended to enable more graceful error handling aside from an assert. There are a few problems with the current implementation of these methods:
* `verifyConstructionInvariants` requires an mlir::Location for emitting errors, which is prohibitively costly in the situations that would most likely use them, e.g. the parser.
This creates an unfortunate code duplication between the verifier code and the parser code, given that the parser operates on llvm::SMLoc and it is an undesirable overhead to pre-emptively convert from that to an mlir::Location.
* `getChecked` effectively requires duplicating the definition of the `get` method, creating a quite clunky workflow due to the subtle different in its signature.

This revision aims to talk the above problems by refactoring the implementation to use a callback for error emission. Using a callback allows for deferring the costly part of error emission until it is actually necessary.

Due to the necessary signature change in each instance of these methods, this revision also takes this opportunity to cleanup the definition of these methods by:
* restructuring the signature of `getChecked` such that it can be generated from the same code block as the `get` method.
* renaming `verifyConstructionInvariants` to `verify` to match the naming scheme of the rest of the compiler.

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

3 years agoRevert "[AArch64][GlobalISel] Match G_SHUFFLE_VECTOR -> insert elt + extract elt"
Jessica Paquette [Tue, 23 Feb 2021 01:36:17 +0000 (17:36 -0800)]
Revert "[AArch64][GlobalISel] Match G_SHUFFLE_VECTOR -> insert elt + extract elt"

This reverts commit 867e379c0e14527eb7aa68485a10324693e35f5d.

For some reason this is upsetting Linux/Windows bots. Reverting while I try to
reproduce.

3 years ago[Test][AArch64] Test SADDE/SSUBE/UADDE/USUBE narrowing legalization
Cassie Jones [Mon, 22 Feb 2021 22:11:58 +0000 (17:11 -0500)]
[Test][AArch64] Test SADDE/SSUBE/UADDE/USUBE narrowing legalization

Reviewed By: paquette

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

3 years ago[AArch64][GlobalISel] Make overflow legalization use clampScalar
Cassie Jones [Mon, 22 Feb 2021 22:11:46 +0000 (17:11 -0500)]
[AArch64][GlobalISel] Make overflow legalization use clampScalar

Reviewed By: arsenm

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

3 years ago[GlobalISel] Implement narrowScalar for SADDE/SSUBE/UADDE/USUBE
Cassie Jones [Mon, 22 Feb 2021 22:11:35 +0000 (17:11 -0500)]
[GlobalISel] Implement narrowScalar for SADDE/SSUBE/UADDE/USUBE

Reviewed By: arsenm

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

3 years ago[GlobalISel] Implement narrowScalar for SADDO/SSUBO
Cassie Jones [Mon, 22 Feb 2021 22:11:23 +0000 (17:11 -0500)]
[GlobalISel] Implement narrowScalar for SADDO/SSUBO

Reviewed By: arsenm

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

3 years ago[GlobalISel] Implement narrowScalar for UADDO/USUBO
Cassie Jones [Mon, 22 Feb 2021 22:10:58 +0000 (17:10 -0500)]
[GlobalISel] Implement narrowScalar for UADDO/USUBO

Reviewed By: arsenm

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

3 years ago[lldb] Reinstate support for LLDB_VERSION_STRING
Jonas Devlieghere [Tue, 23 Feb 2021 00:52:30 +0000 (16:52 -0800)]
[lldb] Reinstate support for LLDB_VERSION_STRING

Reinstate support for specifying -DLLDB_VERSION_STRING="best-lldb"
which seems to have gotten accidentally removed in the past.

rdar://38983903

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

3 years ago[MacroExpansionContext] Fix a warning.
Kazu Hirata [Tue, 23 Feb 2021 00:54:57 +0000 (16:54 -0800)]
[MacroExpansionContext] Fix a warning.

This patch fixes:

  error: private field 'PP' is not used [-Werror,-Wunused-private-field]

3 years ago[libunwind] unw_* alias fixes for ELF and Mach-O
Ryan Prichard [Tue, 23 Feb 2021 00:35:38 +0000 (16:35 -0800)]
[libunwind] unw_* alias fixes for ELF and Mach-O

Rename the CMake option, LIBUNWIND_HERMETIC_STATIC_LIBRARY, to
LIBUNWIND_HIDE_SYMBOLS. Rename the C macro define,
_LIBUNWIND_DISABLE_VISIBILITY_ANNOTATIONS, to _LIBUNWIND_HIDE_SYMBOLS,
because now the macro adds a .hidden directive rather than merely
suppress visibility annotations.

For ELF, when LIBUNWIND_HIDE_SYMBOLS is enabled, mark unw_getcontext as
hidden. This symbol is the only one defined using src/assembly.h's
WEAK_ALIAS macro. Other unw_* weak aliases are defined in C++ and are
already hidden.

Mach-O doesn't support weak aliases, so remove .weak_reference and
weak_import. When LIBUNWIND_HIDE_SYMBOLS is enabled, output
.private_extern for the unw_* aliases.

In assembly.h, add missing SYMBOL_NAME macro invocations, which are
used to prefix symbol names with '_' on some targets.

Fixes PR46709.

Reviewed By: #libunwind, phosek, compnerd, steven_wu

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

3 years ago[sparse][mlir] simplify lattice optimization logic
Aart Bik [Sun, 21 Feb 2021 02:34:07 +0000 (18:34 -0800)]
[sparse][mlir] simplify lattice optimization logic

Simplifies the way lattices are optimized with less, but more
powerful rules. This also fixes an inaccuracy where too many
lattices resulted (expecting a non-existing universal index).
Also puts no-side-effects on all proper getters and unifies
bufferization flags order in integration tests (for future,
more complex use cases).

Reviewed By: bixia

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

3 years ago[JITLink] Add a getFixupAddress convenience method to Block.
Lang Hames [Mon, 22 Feb 2021 23:35:54 +0000 (10:35 +1100)]
[JITLink] Add a getFixupAddress convenience method to Block.

3 years ago[JITLink] Don't allow creation of sections with duplicate names.
Lang Hames [Mon, 22 Feb 2021 06:16:19 +0000 (17:16 +1100)]
[JITLink] Don't allow creation of sections with duplicate names.

3 years ago[gn build] Port 8f48ddd19358
LLVM GN Syncbot [Mon, 22 Feb 2021 23:50:19 +0000 (23:50 +0000)]
[gn build] Port 8f48ddd19358

3 years ago[X86][AMX] Lower tile copy instruction.
Luo, Yuanke [Sat, 20 Feb 2021 07:05:07 +0000 (15:05 +0800)]
[X86][AMX] Lower tile copy instruction.

Since there is no tile copy instruction, we need to store tile
register to stack and load from stack to another tile register.
We need extra GR to hold the stride, and we need stack slot to
hold the tile data register. We would run this pass after copy
propagation, so that we don't miss copy optimization. And we
would run this pass before prolog/epilog insertion, so that we
can allocate stack slot.

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

3 years agoDebugInfo: Emit "LocalToUnit" flag on local member function decls.
James Y Knight [Mon, 22 Feb 2021 23:35:53 +0000 (18:35 -0500)]
DebugInfo: Emit "LocalToUnit" flag on local member function decls.

Follow-up to fe2dcd89acfd9301a230e38e9030734553baa8dc.

Update test per review comments, restoring the "D" type to its
original state, and adding new "L" type. (Sorry, this was intended to
be included in the prior commit)

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

3 years agoAdd auto-upgrade support for annotation intrinsics
Andy Kaylor [Thu, 4 Feb 2021 02:16:04 +0000 (18:16 -0800)]
Add auto-upgrade support for annotation intrinsics

The llvm.ptr.annotation and llvm.var.annotation intrinsics were changed
since the 11.0 release to add an additional parameter. This patch
auto-upgrades IR containing the four-parameter versions of these
intrinsics, adding a null pointer as the fifth argument.

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

3 years ago[AMDGPU] Move RPT::getLiveRegs() check under EXPENSIVE_CHECKS
Stanislav Mekhanoshin [Mon, 22 Feb 2021 23:02:37 +0000 (15:02 -0800)]
[AMDGPU] Move RPT::getLiveRegs() check under EXPENSIVE_CHECKS

This is too expensive even for debug builds. It doubles
scheduling time if enabled.

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

3 years ago[CMake] Don't optimize tests so much under ThinLTO
Arthur Eubanks [Fri, 12 Feb 2021 09:55:26 +0000 (01:55 -0800)]
[CMake] Don't optimize tests so much under ThinLTO

This drops check-llvm under -DLLVM_ENABLE_LTO=Thin from 13m to 10m20s on Windows and 20m to 15m35s on Linux.

Reviewed By: hans

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

3 years ago[RISCV] Have sexti32 also recognize AssertZExt from types smaller than i32.
Craig Topper [Mon, 22 Feb 2021 22:36:44 +0000 (14:36 -0800)]
[RISCV] Have sexti32 also recognize AssertZExt from types smaller than i32.

An i64 AssertZExt from a type smaller than i32 has at least 33
leading zeros which mean it has at least 33 sign bits.

Since we have a couple patterns that use two sexti32, I've
switched to a ComplexPattern so tablegen didn't have to generate
9 different permutations.

As noted in the FIXME, maybe we should just call computeNumSignBits,
but we don't have tests that benefit from that yet.

Reviewed By: luismarques

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

3 years agoDebugInfo: Emit "LocalToUnit" flag on local member function decls.
James Y Knight [Wed, 3 Feb 2021 20:56:52 +0000 (15:56 -0500)]
DebugInfo: Emit "LocalToUnit" flag on local member function decls.

Previously, the definition was so-marked, but the declaration was
not. This resulted in LLVM's dwarf emission treating the function as
being external, and incorrectly emitting DW_AT_external.

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

3 years ago[AArch64][GlobalISel] Match G_SHUFFLE_VECTOR -> insert elt + extract elt
Jessica Paquette [Fri, 19 Feb 2021 17:25:31 +0000 (09:25 -0800)]
[AArch64][GlobalISel] Match G_SHUFFLE_VECTOR -> insert elt + extract elt

Match a G_SHUFFLE_VECTOR with a mask that allows it to be represented as a
G_INSERT_VECTOR_ELT and a G_EXTRACT_VECTOR_ELT.

This ports `isINSMask` from AArch64ISelLowering and the portion of
`AArch64TargetLowering::LowerVECTOR_SHUFFLE` which handles the equivalent
transformation.

This provides more opportunities for matching DUP. We don't have all of the
necessary combines to actually make DUP out of these yet, but this is better for
size than the full TBL expansion for G_SHUFFLE_VECTOR.

This is a -0.1% code size improvement on CTMark/Bullet at -Os.

IR example: https://godbolt.org/z/sdcevT

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

3 years ago[ValueTracking] Improve ComputeNumSignBits for SRem.
Craig Topper [Mon, 22 Feb 2021 22:34:06 +0000 (14:34 -0800)]
[ValueTracking] Improve ComputeNumSignBits for SRem.

The result will have the same sign as the dividend unless the
result is 0. The magnitude of the result will always be less
than or equal to the dividend. So the result will have at least
as many sign bits as the dividend.

Previously we would do this if the divisor was a positive constant,
but that isn't required.

Reviewed By: RKSimon

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

3 years agoscudo: Support memory tagging in the secondary allocator.
Peter Collingbourne [Tue, 22 Dec 2020 02:39:03 +0000 (18:39 -0800)]
scudo: Support memory tagging in the secondary allocator.

This patch enhances the secondary allocator to be able to detect buffer
overflow, and (on hardware supporting memory tagging) use-after-free
and buffer underflow.

Use-after-free detection is implemented by setting memory page
protection to PROT_NONE on free. Because this must be done immediately
rather than after the memory has been quarantined, we no longer use the
combined allocator quarantine for secondary allocations. Instead, a
quarantine has been added to the secondary allocator cache.

Buffer overflow detection is implemented by aligning the allocation
to the right of the writable pages, so that any overflows will
spill into the guard page to the right of the allocation, which
will have PROT_NONE page protection. Because this would require the
secondary allocator to produce a header at the correct position,
the responsibility for ensuring chunk alignment has been moved to
the secondary allocator.

Buffer underflow detection has been implemented on hardware supporting
memory tagging by tagging the memory region between the start of the
mapping and the start of the allocation with a non-zero tag. Due to
the cost of pre-tagging secondary allocations and the memory bandwidth
cost of tagged accesses, the allocation itself uses a tag of 0 and
only the first four pages have memory tagging enabled.

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

3 years agoModify TypePrinter to differentiate between anonymous struct and unnamed struct
Shafik Yaghmour [Mon, 22 Feb 2021 17:58:26 +0000 (09:58 -0800)]
Modify TypePrinter to differentiate between anonymous struct and unnamed struct

Currently TypePrinter lumps anonymous classes and unnamed classes in one group "anonymous" this is not correct and can be confusing in some contexts.

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

3 years ago[clangd] Shutdown sequence for modules, and doc threading requirements
Sam McCall [Tue, 16 Feb 2021 08:16:10 +0000 (09:16 +0100)]
[clangd] Shutdown sequence for modules, and doc threading requirements

This allows modules to do work on non-TUScheduler background threads.

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

3 years ago[clangd] Narrow and document a loophole in blockUntilIdle
Sam McCall [Wed, 17 Feb 2021 11:59:25 +0000 (12:59 +0100)]
[clangd] Narrow and document a loophole in blockUntilIdle

blockUntilIdle of a parent can't always be correctly implemented as
  return ChildA.blockUntilIdle() && ChildB.blockUntilIdle()
The problem is that B can schedule work on A while we're waiting on it.

I believe this is theoretically possible today between CDB and background index.
Modules open more possibilities and it's hard to reason about all of them.

I don't have a perfect fix, and the abstraction is too good to lose. this patch:
 - calls out why we block on workscheduler first, and asserts correctness
 - documents the issue
 - reduces the practical possibility of spuriously returning true significantly

This function is ultimately only for testing, so we're driving down flake rate.

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

3 years ago[InstrProfiling] Use ELF section groups for counters, data and values
Petr Hosek [Sat, 13 Jul 2019 21:02:07 +0000 (14:02 -0700)]
[InstrProfiling] Use ELF section groups for counters, data and values

__start_/__stop_ references retain C identifier name sections such as
__llvm_prf_*. Putting these into a section group disables this logic.

The ELF section group semantics ensures that group members are retained
or discarded as a unit. When a function symbol is discarded, this allows
allows linker to discard counters, data and values associated with that
function symbol as well.

Note that `noduplicates` COMDAT is lowered to zero-flag section group in
ELF. We only set this for functions that aren't already in a COMDAT and
for those that don't have available_externally linkage since we already
use regular COMDAT groups for those.

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

3 years ago[GloblalISel] Support lowering <3 x i8> arguments in multiple parts.
Amara Emerson [Fri, 19 Feb 2021 20:50:59 +0000 (12:50 -0800)]
[GloblalISel] Support lowering <3 x i8> arguments in multiple parts.

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

3 years ago[AArch64][GlobalISel] Support lowering <1 x i8> arguments.
Amara Emerson [Fri, 19 Feb 2021 06:54:59 +0000 (22:54 -0800)]
[AArch64][GlobalISel] Support lowering <1 x i8> arguments.

We don't yet have working codegen for the resulting unmerges, and if
we did it would probably be horrible.

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

3 years ago[lld-link] Add /reproduce: support for several flags
Nico Weber [Mon, 22 Feb 2021 19:29:55 +0000 (14:29 -0500)]
[lld-link] Add /reproduce: support for several flags

/reproduce: now works correctly with:
- /call-graph-ordering-file:
- /def:
- /natvis:
- /order:
- /pdbstream:

I went through all instances of MemoryBuffer::getFile() and made sure
everything that didn't already do so called takeBuffer().

For natvis, that wasn't possible since DebugInfo/PDB wants to take
owernship of the natvis buffer. For that case, I'm manually adding the
tar file entry.

/natvis: and /pdbstream: is slightly awkward, since createResponseFile()
always adds these flags to the response file but createPDB() (which
ultimately adds the files referenced by the flags) is only called if
/debug is also passed. So when using /natvis: without /debug with
/reproduce:, lld won't warn, but when linking using the response
file from the archive, it won't find the natvis file since it's not
in the tar. This isn't a new issue though, and after this patch things
at least work with using /natvis: _with_ debug with /reproduce:.
(Same for /pdbstream:)

Differential Revison: https://reviews.llvm.org/D97212

3 years ago[WebAssembly] Remap branch dests after fixCatchUnwindMismatches
Heejin Ahn [Mon, 22 Feb 2021 05:12:37 +0000 (21:12 -0800)]
[WebAssembly] Remap branch dests after fixCatchUnwindMismatches

Fixing catch unwind mismatches can sometimes invalidate existing branch
destinations. This CL remaps those destinations after placing
try-delegates.

Fixes https://github.com/emscripten-core/emscripten/issues/13515.

Reviewed By: dschuff

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

3 years ago[WebAssembly] Support WasmEHFuncInfo serialization
Heejin Ahn [Sun, 21 Feb 2021 02:23:45 +0000 (18:23 -0800)]
[WebAssembly] Support WasmEHFuncInfo serialization

This adds support for serialization of `WasmEHFuncInfo`, in the form of
<Source BB Number, Unwind destination BB number>. To make YAML mapping
work, we needed to make a copy of the existing `SrcToUnwindDest` map
within `yaml::WebAssemblyMachineFunctionInfo`.

It was hard to add EH MIR tests for CFGStackify because `WasmEHFuncInfo`
could not be read from test MIR files. This adds the serialization
support for that to make EH MIR tests easier.

Reviewed By: dschuff

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

3 years agoFix typo introduced in https://reviews.llvm.org/D97006
Geoffrey Martin-Noble [Mon, 22 Feb 2021 21:10:30 +0000 (13:10 -0800)]
Fix typo introduced in https://reviews.llvm.org/D97006

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

3 years ago[Utils] Add an option to specify number of cores to use in creduce-clang-crash.py
Zequan Wu [Sat, 20 Feb 2021 00:16:28 +0000 (16:16 -0800)]
[Utils] Add an option to specify number of cores to use in creduce-clang-crash.py

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

3 years ago[gn build] Port e64fcdf8d53c
LLVM GN Syncbot [Mon, 22 Feb 2021 20:19:04 +0000 (20:19 +0000)]
[gn build] Port e64fcdf8d53c

3 years ago[WebAssembly] Rename methods in WasmEHFuncInfo (NFC)
Heejin Ahn [Sun, 21 Feb 2021 18:10:47 +0000 (10:10 -0800)]
[WebAssembly] Rename methods in WasmEHFuncInfo (NFC)

This renames variable and method names in `WasmEHFuncInfo` class to be
simpler and clearer. For example, unwind destinations are EH pads by
definition so it doesn't necessarily need to be included in every method
name. Also I am planning to add the reverse mapping in a later CL,
something like `UnwindDestToSrc`, so this renaming will make meanings
clearer.

Reviewed By: dschuff

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

3 years ago[clang][patch] Inclusive language, modify filename SanitizerBlacklist.h to NoSanitize...
Melanie Blower [Mon, 22 Feb 2021 19:47:29 +0000 (14:47 -0500)]
[clang][patch] Inclusive language, modify filename SanitizerBlacklist.h to NoSanitizeList.h

This patch responds to a comment from @vitalybuka in D96203: suggestion to
do the change incrementally, and start by modifying this file name. I modified
the file name and made the other changes that follow from that rename.

Reviewers: vitalybuka, echristo, MaskRay, jansvoboda11, aaron.ballman

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

3 years ago[RISCV] Add isel support for bitcasts between fixed vector types.
Craig Topper [Mon, 22 Feb 2021 19:27:51 +0000 (11:27 -0800)]
[RISCV] Add isel support for bitcasts between fixed vector types.

This should fix the issue reported in D96972.

I don't have a good test case for this without those changes.

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

3 years ago[WebAssembly] Split EH MIR tests into two files
Heejin Ahn [Mon, 22 Feb 2021 04:05:28 +0000 (20:05 -0800)]
[WebAssembly] Split EH MIR tests into two files

Currently exception.mir runs LateEHPrepare and CFGStackify, but some
tests I'm planning to add shouldn't be run with LateEHPrepare, because
it is convenient to only run CFGStackify when testing things like unwind
mismatches and it is easier to add tests that are in phase right before
CFGStackify. This splits existing exception.mir into two files;
cfg-stackify-eh.mir will only run CFGStackify. Note that
`eh_label_tests` tests both LateEHPrepare and CFGStackify, so it is
still in exception.mir. `rethrow_arg_tests` has been converted to the
post-LateEHPrepare form to be moved into cfg-stackify-eh.mir, like
removing `CATCHRET` and such, because it does not really test anything
in LateEHPrepare.

Reviewed By: dschuff

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

3 years ago[SLP]No need to mark scatter load pointer as scalar as it gets vectorized.
Alexey Bataev [Tue, 16 Feb 2021 22:31:18 +0000 (14:31 -0800)]
[SLP]No need to mark scatter load pointer as scalar as it gets vectorized.

Pointer operand of scatter loads does not remain scalar in the tree (it
gest vectorized) and thus must not be marked as the scalar that remains
scalar in vectorized form.

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

3 years agoAdd modern arc config for default "onto" branch
Geoffrey Martin-Noble [Mon, 22 Feb 2021 19:25:21 +0000 (11:25 -0800)]
Add modern arc config for default "onto" branch

The config option for this changed in
https://secure.phabricator.com/D21313 (or when that was rolled out).
I'm leaving the old config option, which may be in use by people with
older versions of arc.

Reviewed By: mehdi_amini

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

3 years ago[libc++] Fix tuple assignment from types derived from a tuple-like
Louis Dionne [Tue, 31 Jul 2018 15:56:20 +0000 (11:56 -0400)]
[libc++] Fix tuple assignment from types derived from a tuple-like

The implementation of tuple's constructors and assignment operators
currently diverges from the way the Standard specifies them, which leads
to subtle cases where the behavior is not as specified. In particular, a
class derived from a tuple-like type (e.g. pair) can't be assigned to a
tuple with corresponding members, when it should. This commit re-implements
the assignment operators (BUT NOT THE CONSTRUCTORS) in a way much closer
to the specification to get rid of this bug. Most of the tests have been
stolen from Eric's patch https://reviews.llvm.org/D27606.

As a fly-by improvement, tests for noexcept correctness have been added
to all overloads of operator=. We should tackle the same issue for the
tuple constructors in a future patch - I'm just trying to make progress
on fixing this long-standing bug.

PR17550
rdar://15837420

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

3 years ago[WebAssembly] Misc. fixes in cfg-stackify-eh.ll
Heejin Ahn [Mon, 22 Feb 2021 06:18:25 +0000 (22:18 -0800)]
[WebAssembly] Misc. fixes in cfg-stackify-eh.ll

- Fix `preds` comments
- Delete nonexistent attributes in instructions (They used to exist in
  clang-generated files, but I removed most of them to make the tests
  tidy. We have only `nounwind` and `noreturn` left here.)
- Add missing `Function Attrs` comments in function declarations

 None of these affect test function semantics or test results for now.

Reviewed By: tlively

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

3 years ago[lld-macho] Try to fix cross-platform test from D96565
Jez Ng [Mon, 22 Feb 2021 19:47:25 +0000 (14:47 -0500)]
[lld-macho] Try to fix cross-platform test from D96565

3 years ago[clang-tidy] Harden PreferMemberInitializerCheck
Nathan James [Mon, 22 Feb 2021 19:41:11 +0000 (19:41 +0000)]
[clang-tidy] Harden PreferMemberInitializerCheck

Prevent warning when the values are initialized using fields that will be initialized later or VarDecls defined in the constructors body.
Both of these cases can't be safely fixed.
Also improve logic of finding where to insert member initializers, previously it could be confused by in class member initializers.

Reviewed By: aaron.ballman

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

3 years agoAdd missing dep to fix shared libs build
Geoffrey Martin-Noble [Mon, 22 Feb 2021 19:35:32 +0000 (11:35 -0800)]
Add missing dep to fix shared libs build

Followup to https://reviews.llvm.org/D97006 which broke the shared libs
build because of a missing dependency.

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

3 years ago[OpenMP] Help static loop code avoid over/underflow
Peyton, Jonathan L [Fri, 29 Jan 2021 20:02:38 +0000 (14:02 -0600)]
[OpenMP] Help static loop code avoid over/underflow

This code alleviates some pathological loop parameters (lower,
upper, stride) within calculations involved in the static loop code.  It
bounds the chunk size to the trip count if it is greater than the trip
count and also minimizes problematic code for when trip count < nth.

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

3 years ago[MLIR] Fix tilePerfectlyNested utility for handling non-unit step size
Vivek [Mon, 22 Feb 2021 19:18:04 +0000 (00:48 +0530)]
[MLIR] Fix tilePerfectlyNested utility for handling non-unit step size

The current implementation of tilePerfectlyNested utility doesn't handle
the non-unit step size. We have added support to perform tiling
correctly even if the step size of the loop to be tiled is non-unit.
Fixes https://bugs.llvm.org/show_bug.cgi?id=49188.

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

3 years ago[OpenMP] Remove shutdown attempt on Windows process detach
Peyton, Jonathan L [Mon, 8 Feb 2021 20:31:27 +0000 (14:31 -0600)]
[OpenMP] Remove shutdown attempt on Windows process detach

Only attempt shutdown if lpReserved is NULL. The Windows documentation
states:
When handling DLL_PROCESS_DETACH, a DLL should free resources such as
heap memory only if the DLL is being unloaded dynamically (the
lpReserved parameter is NULL). If the process is terminating (the
lpReserved parameter is non-NULL), all threads in the process except the
current thread either have exited already or have been explicitly
terminated by a call to the ExitProcess function, which might leave some
process resources such as heaps in an inconsistent state. In this case,
it is not safe for the DLL to clean up the resources. Instead, the DLL
should allow the operating system to reclaim the memory.

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

3 years ago[OpenMP] Limit number of dispatch buffers
Peyton, Jonathan L [Mon, 8 Feb 2021 19:08:53 +0000 (13:08 -0600)]
[OpenMP] Limit number of dispatch buffers

This patch limits the number of dispatch buffers (used for
loop worksharing construct) to between 1 and 4096.

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

3 years agoRevert "[InstrProfiling] Use ELF section groups for counters, data and values"
Petr Hosek [Mon, 22 Feb 2021 19:10:35 +0000 (11:10 -0800)]
Revert "[InstrProfiling] Use ELF section groups for counters, data and values"

This reverts commits:
5ca21175e09fc7fb7dcaee9ebd6782d122a5688f
97184ab99c46e35ae94f828ee90f5d6af2c47e11

The instrprof-gc-sections.c is failing on AArch64 LLD bot.

3 years ago[MLIR] Add Linalg support for integer (generalized) matmuls
Geoffrey Martin-Noble [Thu, 18 Feb 2021 23:37:15 +0000 (15:37 -0800)]
[MLIR] Add Linalg support for integer (generalized) matmuls

This patch adds Linalg named ops for various types of integer matmuls.
Due to limitations in the tc spec/linalg-ods-gen ops cannot be type
polymorphic, so this instead creates new ops (improvements to the
methods for defining Linalg named ops are underway with a prototype at
https://github.com/stellaraccident/mlir-linalgpy).

To avoid the necessity of directly referencing these many new ops, this
adds additional methods to ContractionOpInterface to allow classifying
types of operations based on their indexing maps.

Reviewed By: nicolasvasilache, mravishankar

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

3 years ago[mlir][Shape] Fix a crash when folding nary broadcast ops
Benjamin Kramer [Mon, 22 Feb 2021 17:41:56 +0000 (18:41 +0100)]
[mlir][Shape] Fix a crash when folding nary broadcast ops

operands[2] can be nullptr here. I'm not able to build a lit test for
this because of the commutative reordering of operands. It's possible to
trigger this with a createOrFold<BroadcastOp> though.

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

3 years ago[OpenMP] Update HWLOC code for die level detection
Peyton, Jonathan L [Tue, 2 Feb 2021 22:22:40 +0000 (16:22 -0600)]
[OpenMP] Update HWLOC code for die level detection

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

3 years agoReland [lld-macho]Implement bundle_loader
Vy Nguyen [Mon, 22 Feb 2021 18:03:02 +0000 (13:03 -0500)]
Reland [lld-macho]Implement bundle_loader
  Reland 1a0afcf518717f61d45a1cdc6ad1a6436ec663b1
  https://reviews.llvm.org/D95913

New change: fix UB bug caused by copying empty path/name. (since the executable does not have a name)

3 years ago[KnownBits] Pull out repeated getMinValue() calls from shift analysis. NFCI.
Simon Pilgrim [Mon, 22 Feb 2021 18:40:43 +0000 (18:40 +0000)]
[KnownBits] Pull out repeated getMinValue() calls from shift analysis. NFCI.

3 years ago[llvm][Bitcode] Add bitcode reader/writer for DSOLocalEquivalent
Leonard Chan [Wed, 10 Feb 2021 18:48:22 +0000 (10:48 -0800)]
[llvm][Bitcode] Add bitcode reader/writer for DSOLocalEquivalent

This is necessary for compilation with [thin]lto.

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

3 years ago[AArch64][GlobalISel] Emit G_ASSERT_SEXT for SExt parameters in CallLowering
Jessica Paquette [Wed, 17 Feb 2021 19:43:09 +0000 (11:43 -0800)]
[AArch64][GlobalISel] Emit G_ASSERT_SEXT for SExt parameters in CallLowering

Similar to how we emit G_ASSERT_ZEXT when we have CCValAssign::LocInfo::ZExt.

This will allow us to combine away some redundant sign extends.

Example: https://godbolt.org/z/cTbKvr

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

3 years agoMaking FindCommonBlock a const member
Renaud-K [Fri, 19 Feb 2021 21:38:01 +0000 (13:38 -0800)]
Making FindCommonBlock a const member
https://reviews.llvm.org/D97093

3 years ago[ConstraintElimination] Use unsigned > 0 instead of != 0.
Florian Hahn [Mon, 22 Feb 2021 17:35:25 +0000 (17:35 +0000)]
[ConstraintElimination] Use unsigned > 0 instead of != 0.

ICMP_NE predicates cannot be directly represented as constraint. But we
can use ICMP_UGT instead ICMP_NE for %x != 0.

See https://alive2.llvm.org/ce/z/XlLCsW

3 years ago[RISCV] Custom isel the rest of the vector load/store intrinsics.
Craig Topper [Mon, 22 Feb 2021 17:39:56 +0000 (09:39 -0800)]
[RISCV] Custom isel the rest of the vector load/store intrinsics.

A previous patch moved the index versions. This moves the rest.
I also removed the custom lowering for VLEFF since we can now
do everything directly in the isel handling.

I had to update getLMUL to handle mask registers to index the
pseudo table correctly for VLE1/VSE1.

This is good for another 15K reduction in llc size.

Reviewed By: frasercrmck

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

3 years ago[MLIR][affine] Prevent fusion when ops with memory effect free are present between...
Vinayaka Bandishti [Mon, 22 Feb 2021 16:01:48 +0000 (21:31 +0530)]
[MLIR][affine] Prevent fusion when ops with memory effect free are present between producer and consumer

This commit fixes a bug in affine fusion pipeline where an
incorrect fusion is performed despite a dealloc op is present
between a producer and a consumer. This is done by creating a
node for dealloc op in the MDG.

Reviewed By: bondhugula, dcaballe

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

3 years ago[sanitizers] Pass CMAKE_C_FLAGS into TSan buildgo script
Joachim Protze [Mon, 22 Feb 2021 17:46:28 +0000 (18:46 +0100)]
[sanitizers] Pass CMAKE_C_FLAGS into TSan buildgo script

When compiling with ccache, compiler commands get split into smaller steps
and clang's default -Wunused-command-line-argument complains about unused
include directory arguments. In combination -Werror, compilation aborts.

If CMAKE_C_FLAGS contains -Wno-unused-command-line-argument or
-Wno-error=unused-command-line-argument, the latter flag is passed into the
build script.

This is a re-commit. The previous version was reverted because of failing
tests.

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

3 years ago[MemCpyOpt] Fix handling of readnone byval arguments
Nikita Popov [Mon, 22 Feb 2021 17:46:55 +0000 (18:46 +0100)]
[MemCpyOpt] Fix handling of readnone byval arguments

If the call is readnone, then there may not be any MemoryAccess
associated with the call. Bail out in that case.

This fixes the issue reported at
https://reviews.llvm.org/D94376#2578312.

3 years ago[clang] Tweaked fixit for static assert with no message
Nathan James [Mon, 22 Feb 2021 17:43:52 +0000 (17:43 +0000)]
[clang] Tweaked fixit for static assert with no message

If a static assert has a message as the right side of an and condition, suggest a fix it of replacing the '&&' to ','.

`static_assert(cond && "Failed Cond")` -> `static_assert(cond, "Failed cond")`

This use case comes up when lazily replacing asserts with static asserts.

Reviewed By: aaron.ballman

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

3 years ago[JumpThreading] Clone noalias.scope.decl when threading blocks
Nikita Popov [Sun, 21 Feb 2021 15:24:18 +0000 (16:24 +0100)]
[JumpThreading] Clone noalias.scope.decl when threading blocks

When cloning instructions during jump threading, also clone and
adapt any declared scopes. This is primarily important when
threading loop exits, because we'll end up with two dominating
scope declarations in that case (at least after additional loop
rotation). This addresses a loose thread from
https://reviews.llvm.org/rG2556b413a7b8#975012.

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

3 years agoImprove diagnostic for ignored GNU 'used' attribute
Fangrui Song [Mon, 22 Feb 2021 17:18:13 +0000 (09:18 -0800)]
Improve diagnostic for ignored GNU 'used' attribute

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

3 years ago[lld-macho] Clean up comments
Jez Ng [Mon, 22 Feb 2021 17:06:58 +0000 (12:06 -0500)]
[lld-macho] Clean up comments

3 years ago[lld-macho] Fix cpuSubtype for non-x86_64 archs
Jez Ng [Mon, 22 Feb 2021 17:12:39 +0000 (12:12 -0500)]
[lld-macho] Fix cpuSubtype for non-x86_64 archs

dyld on iOS will complain if the LIB64 bit is set.

Reviewed By: #lld-macho, thakis

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

3 years ago[ConstraintElimination] Add initial ICMP_NE test cases.
Florian Hahn [Mon, 22 Feb 2021 10:43:11 +0000 (10:43 +0000)]
[ConstraintElimination] Add initial ICMP_NE test cases.

3 years ago[flang] Add -J and -module-dir to f18 driver
Tim Keith [Mon, 22 Feb 2021 17:03:19 +0000 (09:03 -0800)]
[flang] Add -J and -module-dir to f18 driver

Add -J to the f18 driver for compatibility with gfortran.
Add -module-dir for compatibility with the new flang driver.

They both set the output directory for .mod files and add the
directory to the search list. -module still only does the former.

Clean up the new driver test to match.

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

3 years ago[InstSimplify] Cleanup out-of-range shift amount handling.
Simon Pilgrim [Mon, 22 Feb 2021 17:00:49 +0000 (17:00 +0000)]
[InstSimplify] Cleanup out-of-range shift amount handling.

Use APInt::uge() direct instead of getLimitedValue().

Use KnownBits::getMinValue() to make the bounds check more obvious.

3 years ago[LV] Directly use incoming value for single VPBlendRecipes.
Florian Hahn [Mon, 22 Feb 2021 15:05:45 +0000 (15:05 +0000)]
[LV] Directly use incoming value for single VPBlendRecipes.

VPBlendRecipes with single incoming (value, mask) pair are no-ops. Use
the incoming value directly.

3 years ago[Clang][OpenMP] Require CUDA 9.2+ for OpenMP offloading on NVPTX target
Shilei Tian [Mon, 22 Feb 2021 15:59:55 +0000 (10:59 -0500)]
[Clang][OpenMP] Require CUDA 9.2+ for OpenMP offloading on NVPTX target

In current implementation of `deviceRTLs`, we're using some functions
that are CUDA version dependent (if CUDA_VERSION < 9, it is one; otheriwse, it
is another one). As a result, we have to compile one bitcode library for each
CUDA version supported. A worse problem is forward compatibility. If a new CUDA
version is released, we have to update CMake file as well.

CUDA 9.2 has been released for three years. Instead of using various weird tricks
to make `deviceRTLs` work with different CUDA versions and still have forward
compatibility, we can simply drop support for CUDA 9.1 or lower version. It has at
least two benifits:
- We don't need to generate bitcode libraries for each CUDA version;
- Clang driver doesn't need to search for the bitcode lib based on CUDA version.

We can claim that starting from LLVM 12, OpenMP offloading on NVPTX target requires
CUDA 9.2+.

Reviewed By: jdoerfert, JonChesterfield

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

3 years ago[clang][NFC] Reorder CXXCtorInitializer members
Nathan James [Mon, 22 Feb 2021 15:25:33 +0000 (15:25 +0000)]
[clang][NFC] Reorder CXXCtorInitializer members

Swapping the order of Init and MemberOrEllipsisLocation removes 8 bytes (20%) of padding on 64bit builds.

Reviewed By: aaron.ballman

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

3 years ago[LangRef] fix typo in assume bundle description; NFC
Sanjay Patel [Mon, 22 Feb 2021 14:30:14 +0000 (09:30 -0500)]
[LangRef] fix typo in assume bundle description; NFC

3 years ago[pp-trace] Fix test for OpenCL pragmas.
Anastasia Stulova [Mon, 22 Feb 2021 14:22:02 +0000 (14:22 +0000)]
[pp-trace] Fix test for OpenCL pragmas.

After updating clang driver to include standard
OpenCL headers implicitly, the output being checked
in the test does not match because the implicit
header contains other pragmas. The test does not
aim to use the header and therefore it has to be
updated passing '-cl-no-stdinc' command-line flag.

This fixes failing bots.