platform/upstream/llvm.git
3 years ago[VE] Add veqv and vseq intrinsic instructions
Kazushi (Jam) Marukawa [Thu, 3 Dec 2020 01:18:10 +0000 (10:18 +0900)]
[VE] Add veqv and vseq intrinsic instructions

Add veqv and vseq intrinsic instructions and regression tests.

Reviewed By: simoll

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

3 years ago[libc++] [docs] Add C++2b (to be C++23) status page.
Marek Kurdej [Thu, 3 Dec 2020 08:17:14 +0000 (09:17 +0100)]
[libc++] [docs] Add C++2b (to be C++23) status page.

Also:
* Fix header line in all status tables.
* Use C++20 instead of C++2a.

Reviewed By: ldionne, #libc, miscco

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

3 years ago[mlir][gpu] Move gpu.wait ops from async.execute regions to its dependencies.
Christian Sigg [Wed, 2 Dec 2020 08:48:59 +0000 (09:48 +0100)]
[mlir][gpu] Move gpu.wait ops from async.execute regions to its dependencies.

This can prevent unnecessary host synchronization.

Reviewed By: herhut

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

3 years ago[NFC] Add proper triple for arc.ll test
Yuanfang Chen [Thu, 3 Dec 2020 07:31:06 +0000 (23:31 -0800)]
[NFC] Add proper triple for arc.ll test

3 years agoBPF: add a test for selectiondag alias analysis w.r.t. lifetime
Yonghong Song [Wed, 2 Dec 2020 03:26:39 +0000 (19:26 -0800)]
BPF: add a test for selectiondag alias analysis w.r.t. lifetime

This adds a test for the bug
  https://bugs.llvm.org/show_bug.cgi?id=47591

Previously, selection dag has a bug which may incorrectly
assume no alias when crossing a lifetime boundary and this
may generate incorrect code as demonstrated in the above bug.

It looks the bug is fixed by https://reviews.llvm.org/D91833.
Basically, when comparing two potential memory access dag nodes,
  a store and a lifetime.start,
with the same frame index.
Previously, it may be decided no alias. With the above fix,
these two will be considered aliasing which will prevent
incorrect code scheduling.

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

3 years ago[NFC] Fix typo
modimo [Thu, 3 Dec 2020 06:23:57 +0000 (22:23 -0800)]
[NFC] Fix typo

3 years agoSwitch from llvm::is_trivially_copyable to std::is_trivially_copyable
Fangrui Song [Thu, 3 Dec 2020 06:02:48 +0000 (22:02 -0800)]
Switch from llvm::is_trivially_copyable to std::is_trivially_copyable

GCC<5 did not support std::is_trivially_copyable. Now LLVM builds require 5.1
we can migrate to std::is_trivially_copyable.

The Optional.h change made MSVC choke
(https://buildkite.com/llvm-project/premerge-checks/builds/18587#cd1bb616-ffdc-4581-9795-b42c284196de)
so I leave it out for now.

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

3 years ago[dfsan] Rename ShadowTy/ZeroShadow with prefix Primitive
Jianzhou Zhao [Wed, 2 Dec 2020 05:58:09 +0000 (05:58 +0000)]
[dfsan] Rename ShadowTy/ZeroShadow with prefix Primitive

This is a child diff of D92261.

After supporting field/index-level shadow, the existing shadow with type
i16 works for only primitive types.

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

3 years ago[libomptarget][AMDGPU] Remove MaxParallelLevel
Pushpinder Singh [Wed, 2 Dec 2020 06:34:38 +0000 (01:34 -0500)]
[libomptarget][AMDGPU] Remove MaxParallelLevel

Removes MaxParallelLevel references from rtl.cpp and drops
resulting dead code.

Reviewed By: JonChesterfield

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

3 years ago[RISCV] Add additional half precision fnmadd/fnmsub tests with an fneg on the second...
Craig Topper [Thu, 3 Dec 2020 05:03:05 +0000 (21:03 -0800)]
[RISCV] Add additional half precision fnmadd/fnmsub tests with an fneg on the second operand instead of the first.

This matches the float/double tests added in defe11866a326491ee9767f84bb3f70cfc4f4bcb

3 years ago[RISCV] Add f16 to isFMAFasterThanFMulAndFAdd now that the Zfh extension is supported
Craig Topper [Thu, 3 Dec 2020 04:20:38 +0000 (20:20 -0800)]
[RISCV] Add f16 to isFMAFasterThanFMulAndFAdd now that the Zfh extension is supported

3 years ago[PowerPC] Add the hw sqrt test for vector type v4f32/v2f64
QingShan Zhang [Thu, 3 Dec 2020 03:09:25 +0000 (03:09 +0000)]
[PowerPC] Add the hw sqrt test for vector type v4f32/v2f64

PowerPC ISA support the input test for vector type v4f32 and v2f64.
Replace the software compare with hw test will improve the perf.

Reviewed By: ChenZheng

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

3 years ago[SelectionDAG] Use is_contained (NFC)
Kazu Hirata [Thu, 3 Dec 2020 03:09:45 +0000 (19:09 -0800)]
[SelectionDAG] Use is_contained (NFC)

3 years ago[NFC] [Clang] Move ppc64le f128 vaargs OpenMP test
Qiu Chaofan [Thu, 3 Dec 2020 02:50:42 +0000 (10:50 +0800)]
[NFC] [Clang] Move ppc64le f128 vaargs OpenMP test

This case for long-double semantics mismatch on OpenMP references
%clang, which should be located in Driver directory.

3 years ago[NFC][sanitizer] Another attempt to fix test on arm
Vitaly Buka [Thu, 3 Dec 2020 02:36:02 +0000 (18:36 -0800)]
[NFC][sanitizer] Another attempt to fix test on arm

3 years ago[RISCV] Initialize MergeBaseOffsetOptPass so it will work with print-before/after...
Craig Topper [Thu, 3 Dec 2020 01:28:20 +0000 (17:28 -0800)]
[RISCV] Initialize MergeBaseOffsetOptPass so it will work with print-before/after-all.

If its not in the PassRegistry it's not recognized as
a pass when we print before/after. Happened to notice while
I was working on a new pass.

3 years agoPR48339: Improve diagnostics for invalid dependent unqualified function calls.
Richard Smith [Thu, 3 Dec 2020 01:46:28 +0000 (17:46 -0800)]
PR48339: Improve diagnostics for invalid dependent unqualified function calls.

Fix bogus diagnostics that would get confused and think a "no viable
fuctions" case was an "undeclared identifiers" case, resulting in an
incorrect diagnostic preceding the correct one. Use overload resolution
to determine which function we should select when we can find call
candidates from a dependent base class. Make the diagnostics for a call
that could call a function from a dependent base class more specific,
and use a different diagnostic message for the case where the call
target is instead declared later in the same class. Plus some minor
diagnostic wording improvements.

3 years ago[MemorySSA] Remove unused declaration findDominatingDef (NFC)
Kazu Hirata [Thu, 3 Dec 2020 01:40:19 +0000 (17:40 -0800)]
[MemorySSA] Remove unused declaration findDominatingDef (NFC)

The function definition was removed on Feb 22, 2017 in commit
17e8d0eae24ffa41cf7641d984c05e00d59b93a4.  The declaration has
remained since.

3 years agoRevert "Frontend: Sink named pipe logic from CompilerInstance down to FileManager"
Duncan P. N. Exon Smith [Thu, 3 Dec 2020 01:34:38 +0000 (17:34 -0800)]
Revert "Frontend: Sink named pipe logic from CompilerInstance down to FileManager"

This reverts commit 3b18a594c7717a328c33b9c1eba675e9f4bd367c, since
apparently this doesn't work everywhere. E.g.,
clang-x86_64-debian-fast/3889
(http://lab.llvm.org:8011/#/builders/109/builds/3889) gives me:
```
+ : 'RUN: at line 8'
+ /b/1/clang-x86_64-debian-fast/llvm.obj/bin/clang -x c /dev/fd/0 -E
+ cat /b/1/clang-x86_64-debian-fast/llvm.src/clang/test/Misc/dev-fd-fs.c
fatal error: file '/dev/fd/0' modified since it was first processed
1 error generated.
```

3 years ago[llvm-link] use file magic when deciding if input should be loaded as archive
Sergey Dmitriev [Thu, 3 Dec 2020 00:19:31 +0000 (16:19 -0800)]
[llvm-link] use file magic when deciding if input should be loaded as archive

llvm-link should not rely on the '.a' file extension when deciding if input file
should be loaded as archive. Archives may have other extensions (f.e. .lib) or no
extensions at all. This patch changes llvm-link to use llvm::file_magic to check
if input file is an archive.

Reviewed By: RaviNarayanaswamy

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

3 years ago[RISCV] Handle zfh in the arch string.
Hsiangkai Wang [Thu, 12 Nov 2020 02:00:33 +0000 (10:00 +0800)]
[RISCV] Handle zfh in the arch string.

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

3 years ago[RISCV] Support Zfh half-precision floating-point extension.
Hsiangkai Wang [Fri, 3 Jul 2020 14:57:59 +0000 (22:57 +0800)]
[RISCV] Support Zfh half-precision floating-point extension.

Support "Zfh" extension according to
https://github.com/riscv/riscv-isa-manual/blob/zfh/src/zfh.tex

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

3 years agoFrontend: Sink named pipe logic from CompilerInstance down to FileManager
Duncan P. N. Exon Smith [Tue, 3 Nov 2020 13:33:06 +0000 (08:33 -0500)]
Frontend: Sink named pipe logic from CompilerInstance down to FileManager

Remove compilicated logic from CompilerInstance::InitializeSourceManager
to deal with named pipes, updating FileManager::getBufferForFile to
handle it in a more straightforward way. The existing test at
clang/test/Misc/dev-fd-fs.c covers the new behaviour (just like it did
the old behaviour).

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

3 years ago[lldb] Treat remote macOS debugging like any other remote darwin platform
Jonas Devlieghere [Thu, 3 Dec 2020 00:26:11 +0000 (16:26 -0800)]
[lldb] Treat remote macOS debugging like any other remote darwin platform

Extract remote debugging logic from PlatformMacOSX and move it into
PlatformRemoteMacOSX so it can benefit from all the logic necessary for
remote debugging.

Until now, remote macOS debugging was treated almost identical to local
macOS debugging. By moving in into its own class, we can have it inherit
from PlatformRemoteDarwinDevice and all the functionality it provides,
such as looking at the correct DeviceSupport directory.

rdar://68167374

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

3 years agoRevert "[llvm-link] use file magic when deciding if input should be loaded as archive"
Sergey Dmitriev [Thu, 3 Dec 2020 00:52:48 +0000 (16:52 -0800)]
Revert "[llvm-link] use file magic when deciding if input should be loaded as archive"

This reverts commit 55f8c2fdfbc5eda1be946e97ecffa2dea44a883e.

3 years agoSmall improvements to Intrinsic::getName
Xun Li [Thu, 3 Dec 2020 00:49:12 +0000 (16:49 -0800)]
Small improvements to Intrinsic::getName

While I was adding a new intrinsic instruction (not overloaded), I accidentally used CreateUnaryIntrinsic to create the intrinsics, which turns out to be passing the type list to getName, and ended up naming the intrinsics function with type suffix, which leads to wierd bugs latter on. It took me a long time to debug.
It seems a good idea to add an assertion in getName so that it fails if types are passed but it's not a overloaded function.
Also, the overloade version of getName is less efficient because it creates an std::string. We should avoid calling it if we know that there are no types provided.

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

3 years ago[llvm-link] use file magic when deciding if input should be loaded as archive
Sergey Dmitriev [Thu, 3 Dec 2020 00:19:31 +0000 (16:19 -0800)]
[llvm-link] use file magic when deciding if input should be loaded as archive

llvm-link should not rely on the '.a' file extension when deciding if input file
should be loaded as archive. Archives may have other extensions (f.e. .lib) or no
extensions at all. This patch changes llvm-link to use llvm::file_magic to check
if input file is an archive.

Reviewed By: RaviNarayanaswamy

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

3 years agoARCMigrate: Stop abusing PreprocessorOptions for passing back file remappings, NFC
Duncan P. N. Exon Smith [Wed, 4 Nov 2020 20:51:56 +0000 (15:51 -0500)]
ARCMigrate: Stop abusing PreprocessorOptions for passing back file remappings, NFC

As part of reducing use of PreprocessorOptions::RemappedFileBuffers,
stop abusing it to pass information around remapped files in
`ARCMigrate`.  This simplifies an eventual follow-up to switch to using
an `InMemoryFileSystem` for this.

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

3 years ago [scudo][standalone] Add missing va_end() in ScopedString::append
Kostya Kortchinsky [Wed, 2 Dec 2020 23:19:42 +0000 (15:19 -0800)]
 [scudo][standalone] Add missing va_end() in ScopedString::append

In ScopedString::append va_list ArgsCopy is created but never cleanuped
which can lead to undefined behaviour, like stack corruption.

Reviewed By: cryptoad

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

3 years agoFix assertion in tryEmitAsConstant
Yaxun (Sam) Liu [Wed, 2 Dec 2020 23:35:52 +0000 (18:35 -0500)]
Fix assertion in tryEmitAsConstant

due to cd95338ee3022bffd658e52cd3eb9419b4c218ca

Need to check if result is LValue before getLValueBase.

3 years ago[lldb] Return the original path when tilde expansion fails.
Jonas Devlieghere [Thu, 3 Dec 2020 00:00:21 +0000 (16:00 -0800)]
[lldb] Return the original path when tilde expansion fails.

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

3 years agoRevert "[mac/lld] Implement -why_load"
Nico Weber [Wed, 2 Dec 2020 23:57:46 +0000 (18:57 -0500)]
Revert "[mac/lld] Implement -why_load"

This reverts commit 542d3b609dbe99a30759942271398890fc7770dc.
Seems to break check-lld. Reverting while I take a look.

3 years agoADT: Rely on std::aligned_union_t for math in AlignedCharArrayUnion, NFC
Duncan P. N. Exon Smith [Wed, 2 Dec 2020 19:43:15 +0000 (11:43 -0800)]
ADT: Rely on std::aligned_union_t for math in AlignedCharArrayUnion, NFC

Instead of computing the alignment and size of the `char` buffer in
`AlignedCharArrayUnion`, rely on the math in `std::aligned_union_t`.
Because some users of this rely on the `buffer` field existing with a
type convertible to `char *`, we can't change the field type, but we can
still avoid duplicating the logic.

A potential follow up would be to delete `AlignedCharArrayUnion` after
updating its users to use `std::aligned_union_t` directly; or if we like
our template parameters better, could update users to stop peeking
inside and then replace the definition with:
```
template <class T, class... Ts>
using AlignedCharArrayUnion = std::aligned_union_t<1, T, Ts...>;
```

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

3 years ago[NFC][MC] TargetRegisterInfo::getSubReg is a MCRegister.
Mircea Trofin [Thu, 19 Nov 2020 15:43:56 +0000 (07:43 -0800)]
[NFC][MC] TargetRegisterInfo::getSubReg is a MCRegister.

Typing the API appropriately.

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

3 years ago[lldb] X-FAIL class template parameter pack tests on Windows
Raphael Isemann [Wed, 2 Dec 2020 23:37:19 +0000 (00:37 +0100)]
[lldb] X-FAIL class template parameter pack tests on Windows

Both seem to fail to read values from the non-running target.

3 years ago[mac/lld] Implement -why_load
Nico Weber [Wed, 2 Dec 2020 18:17:55 +0000 (13:17 -0500)]
[mac/lld] Implement -why_load

This is useful for debugging why lld loads .o files it shouldn't load.
It's also useful for users of lld -- I've used ld64's version of this a
few times.

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

3 years ago[flang] Fix bugs related to merging generics during USE
Tim Keith [Wed, 2 Dec 2020 23:13:49 +0000 (15:13 -0800)]
[flang] Fix bugs related to merging generics during USE

When the same generic name is use-associated from two modules, the
generics are merged into a single one in the current scope. This change
fixes some bugs in that process.

When a generic is merged, it can have two specific procedures with the
same name as the generic (c.f. module m7c in modfile07.f90). We were
disallowing that by checking for duplicate names in the generic rather
than duplicate symbols. Changing `namesSeen` to `symbolsSeen` in
`ResolveSpecificsInGeneric` fixes that.

We weren't including each USE of those generics in the .mod file so in
some cases they were incorrect. Extend GenericDetails to specify all
use-associated symbols that are merged into the generic. This is used to
write out .mod files correctly.

The distinguishability check for specific procedures of a generic
sometimes have to refer to procedures from a use-associated generic in
error messages. In that case we don't have the source location of the
procedure so adapt the message to say where is was use-associated from.
This requires passing the scope through the checks to make that
determination.

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

3 years ago[lldb][NFC] Make DeclOrigin::Valid() const
Raphael Isemann [Wed, 2 Dec 2020 23:08:19 +0000 (00:08 +0100)]
[lldb][NFC] Make DeclOrigin::Valid() const

3 years agoADT: Remove redundant `alignas` from IntervalMap, NFC
Duncan P. N. Exon Smith [Wed, 2 Dec 2020 21:48:40 +0000 (13:48 -0800)]
ADT: Remove redundant `alignas` from IntervalMap, NFC

`AlignedArrayCharUnion` is now using `alignas`, which is properly
supported now by all the host toolchains we support. As a result, the
extra `alignas` on `IntervalMap` isn't needed anymore.

This is effectively a revert of 379daa29744cd96b0a87ed0d4a010fa4bc47ce73.

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

3 years agoRevert "Use std::is_trivially_copyable", breaks MSVC build
Reid Kleckner [Wed, 2 Dec 2020 21:48:05 +0000 (13:48 -0800)]
Revert "Use std::is_trivially_copyable", breaks MSVC build

Revert "Delete llvm::is_trivially_copyable and CMake variable HAVE_STD_IS_TRIVIALLY_COPYABLE"

This reverts commit 4d4bd40b578d77b8c5bc349ded405fb58c333c78.

This reverts commit 557b00e0afb2dc1776f50948094ca8cc62d97be4.

3 years ago[ConstraintElimination] Make sure arguments of std:pow match.
Florian Hahn [Wed, 2 Dec 2020 22:22:17 +0000 (22:22 +0000)]
[ConstraintElimination] Make sure arguments of std:pow match.

This should fix a build failure on some systems, e.g. solaris11-sparcv9
http://lab.llvm.org:8014/#/builders/22

3 years ago[X86] Add TLS_(base_)addrX32 for X32 mode
Harald van Dijk [Wed, 2 Dec 2020 22:20:36 +0000 (22:20 +0000)]
[X86] Add TLS_(base_)addrX32 for X32 mode

LLVM has TLS_(base_)addr32 for 32-bit TLS addresses in 32-bit mode, and
TLS_(base_)addr64 for 64-bit TLS addresses in 64-bit mode. x32 mode wants 32-bit
TLS addresses in 64-bit mode, which were not yet handled. This adds
TLS_(base_)addrX32 as copies of TLS_(base_)addr64, except that they use
tls32(base)addr rather than tls64(base)addr, and then restricts
TLS_(base_)addr64 to 64-bit LP64 mode, TLS_(base_)addrX32 to 64-bit ILP32 mode.

Reviewed By: RKSimon

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

3 years agoUse PC-relative address for x32 TLS address
H.J. Lu [Tue, 3 Jun 2014 20:22:28 +0000 (13:22 -0700)]
Use PC-relative address for x32 TLS address

Since x32 supports PC-relative address, it shouldn't use EBX for TLS
address.  Instead of checking N.getValueType(), we should check
Subtarget->is32Bit().  This fixes PR 22676.

Reviewed By: RKSimon

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

3 years agoModule: Use FileEntryRef and DirectoryEntryRef in Umbrella, Header, and DirectoryName...
Duncan P. N. Exon Smith [Fri, 30 Oct 2020 20:10:10 +0000 (16:10 -0400)]
Module: Use FileEntryRef and DirectoryEntryRef in Umbrella, Header, and DirectoryName, NFC

Push `FileEntryRef` and `DirectoryEntryRef` further, using it them
`Module::Umbrella`, `Module::Header::Entry`, and
`Module::DirectoryName::Entry`.

- Add `DirectoryEntryRef::operator const DirectoryEntry *` and
  `OptionalDirectoryEntryRefDegradesToDirectoryEntryPtr`, to get the
  same "degrades to `DirectoryEntry*` behaviour `FileEntryRef` enjoys
  (this avoids a bunch of churn in various clang tools).
- Fix the `DirectoryEntryRef` constructor from `MapEntry` to take it by
  `const&`.

Note that we cannot get rid of the `...AsWritten` names leveraging the
new classes, since these need to be as written in the `ModuleMap` file
and the module directory path is preprended for the lookup in the
`FileManager`.

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

3 years ago[gn build] Port 24d4291ca70
LLVM GN Syncbot [Wed, 2 Dec 2020 21:52:41 +0000 (21:52 +0000)]
[gn build] Port 24d4291ca70

3 years ago[libc++] Install missing packages to cross-compile to 32 bits during CI
Louis Dionne [Wed, 2 Dec 2020 21:35:08 +0000 (16:35 -0500)]
[libc++] Install missing packages to cross-compile to 32 bits during CI

3 years ago[CSSPGO] Pseudo probes for function calls.
Hongtao Yu [Wed, 2 Dec 2020 05:44:06 +0000 (21:44 -0800)]
[CSSPGO] Pseudo probes for function calls.

An indirect call site needs to be probed for its potential call targets. With CSSPGO a direct call also needs a probe so that a calling context can be represented by a stack of callsite probes. Unlike pseudo probes for basic blocks that are in form of standalone intrinsic call instructions, pseudo probes for callsites have to be attached to the call instruction, thus a separate instruction would not work.

One possible way of attaching a probe to a call instruction is to use a special metadata that carries information about the probe. The special metadata will have to make its way through the optimization pipeline down to object emission. This requires additional efforts to maintain the metadata in various places. Given that the `!dbg` metadata is a first-class metadata and has all essential support in place , leveraging the `!dbg` metadata as a channel to encode pseudo probe information is probably the easiest solution.

With the requirement of not inflating `!dbg` metadata that is allocated for almost every instruction, we found that the 32-bit DWARF discriminator field which mainly serves AutoFDO can be reused for pseudo probes. DWARF discriminators distinguish identical source locations between instructions and with pseudo probes such support is not required. In this change we are using the discriminator field to encode the ID and type of a callsite probe and the encoded value will be unpacked and consumed right before object emission. When a callsite is inlined, the callsite discriminator field will go with the inlined instructions. The `!dbg` metadata of an inlined instruction is in form of a scope stack. The top of the stack is the instruction's original `!dbg` metadata and the bottom of the stack is for the original callsite of the top-level inliner. Except for the top of the stack, all other elements of the stack actually refer to the nested inlined callsites whose discriminator field (which actually represents a calliste probe) can be used together to represent the inline context of an inlined PseudoProbeInst or CallInst.

To avoid collision with the baseline AutoFDO in various places that handles dwarf discriminators where a check against  the `-pseudo-probe-for-profiling` switch is not available, a special encoding scheme is used to tell apart a pseudo probe discriminator from a regular discriminator. For the regular discriminator, if all lowest 3 bits are non-zero, it means the discriminator is basically empty and all higher 29 bits can be reversed for pseudo probe use.

Callsite pseudo probes are inserted in `SampleProfileProbePass` and a target-independent MIR pass `PseudoProbeInserter` is added to unpack the probe ID/type from `!dbg`.

Note that with this work the switch -debug-info-for-profiling will not work with -pseudo-probe-for-profiling anymore. They cannot be used at the same time.

Reviewed By: wmi

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

3 years ago[dfsan] Rename CachedCombinedShadow to be CachedShadow
Jianzhou Zhao [Wed, 2 Dec 2020 05:48:16 +0000 (05:48 +0000)]
[dfsan] Rename CachedCombinedShadow to be CachedShadow

At D92261, this type will be used to cache both combined shadow and
converted shadow values.

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

3 years ago[dfsan] Test loading global ptrs
Jianzhou Zhao [Wed, 2 Dec 2020 06:03:12 +0000 (06:03 +0000)]
[dfsan] Test loading global ptrs

This covers a branch in the loadShadow method.

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

3 years ago[CUDA][HIP] Fix overloading resolution
Yaxun (Sam) Liu [Wed, 25 Nov 2020 15:33:18 +0000 (10:33 -0500)]
[CUDA][HIP] Fix overloading resolution

This patch implements correct hostness based overloading resolution
in isBetterOverloadCandidate.

Based on hostness, if one candidate is emittable whereas the other
candidate is not emittable, the emittable candidate is better.

If both candidates are emittable, or neither is emittable based on hostness, then
other rules should be used to determine which is better. This is because
hostness based overloading resolution is mostly for determining
viability of a function. If two functions are both viable, other factors
should take precedence in preference.

If other rules cannot determine which is better, CUDA preference will be
used again to determine which is better.

However, correct hostness based overloading resolution
requires overloading resolution diagnostics to be deferred,
which is not on by default. The rationale is that deferring
overloading resolution diagnostics may hide overloading reslolutions
issues in header files.

An option -fgpu-exclude-wrong-side-overloads is added, which is off by
default.

When -fgpu-exclude-wrong-side-overloads is off, keep the original behavior,
that is, exclude wrong side overloads only if there are same side overloads.
This may result in incorrect overloading resolution when there are no
same side candates, but is sufficient for most CUDA/HIP applications.

When -fgpu-exclude-wrong-side-overloads is on, enable deferring
overloading resolution diagnostics and enable correct hostness
based overloading resolution, i.e., always exclude wrong side overloads.

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

3 years ago[dfsan] Add a test case for phi
Jianzhou Zhao [Wed, 2 Dec 2020 06:08:59 +0000 (06:08 +0000)]
[dfsan] Add a test case for phi

3 years agoAdd a less ambiguous macro for Android version.
Dan Albert [Tue, 17 Nov 2020 23:17:17 +0000 (15:17 -0800)]
Add a less ambiguous macro for Android version.

Android has a handful of API levels relevant to developers described
here: https://developer.android.com/studio/build#module-level.
`__ANDROID_API__` is too vague and confuses a lot of people. Introduce
a new macro name that is explicit about which one it represents. Keep
the old name around because code has been using it for a decade.

3 years ago[dfsan] Add test cases for struct/pair
Jianzhou Zhao [Wed, 2 Dec 2020 05:44:03 +0000 (05:44 +0000)]
[dfsan] Add test cases for struct/pair

This is a child diff of D92261.

This locks down the behavior before the change.

3 years ago[ThinLTO][test] Fix X86/nossp.ll after D91816
Fangrui Song [Wed, 2 Dec 2020 21:13:58 +0000 (13:13 -0800)]
[ThinLTO][test] Fix X86/nossp.ll after D91816

3 years ago[MLIR][NFC] Fix mix up between dialect attribute values and names
Uday Bondhugula [Wed, 2 Dec 2020 20:42:01 +0000 (02:12 +0530)]
[MLIR][NFC] Fix mix up between dialect attribute values and names

Clear up documentation on dialect attribute values. Fix/improve
ModuleOp verifier error message on dialect prefixed attribute names.
Additional discussion is here:
https://llvm.discourse.group/t/moduleop-attributes/2325

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

3 years agoUpdate MS ABI mangling for union constants based on new information from
Richard Smith [Wed, 2 Dec 2020 19:36:11 +0000 (11:36 -0800)]
Update MS ABI mangling for union constants based on new information from
Jon Caves.

3 years ago[AArch64] Compiler-rt interface for out-of-line atomics.
Pavel Iliin [Fri, 20 Nov 2020 15:02:57 +0000 (15:02 +0000)]
[AArch64] Compiler-rt interface for out-of-line atomics.

Out-of-line helper functions to support LSE deployment added.
This is a port of libgcc implementation:
https://gcc.gnu.org/git/?p=gcc.git;h=33befddcb849235353dc263db1c7d07dc15c9faa

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

3 years ago[XCOFF][AIX] Alternative path in EHStreamer for platforms do not have uleb128 support
jasonliu [Wed, 2 Dec 2020 18:46:58 +0000 (18:46 +0000)]
[XCOFF][AIX] Alternative path in EHStreamer for platforms do not have uleb128 support

Summary:
Not all system assembler supports `.uleb128 label2 - label1` form.
When the target do not support this form, we have to take
alternative manual calculation to get the offsets from them.

Reviewed By: hubert.reinterpretcast

Diffierential Revision: https://reviews.llvm.org/D92058

3 years ago[CMake][Fuchsia] Install llvm-elfabi
Roland McGrath [Wed, 2 Dec 2020 02:41:56 +0000 (18:41 -0800)]
[CMake][Fuchsia] Install llvm-elfabi

The canonical Fuchsia toolchain configuration installs llvm-elfabi.

Reviewed By: haowei

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

3 years ago[lsan] Use final on Fuchsia ThreadContext declaration
Roland McGrath [Wed, 2 Dec 2020 02:28:10 +0000 (18:28 -0800)]
[lsan] Use final on Fuchsia ThreadContext declaration

This is consistent with other platforms' versions and
eliminates a compiler warning.

Reviewed By: leonardchan

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

3 years ago[libc] Fix couple of corner cases in remquo.
Siva Chandra Reddy [Thu, 19 Nov 2020 05:30:47 +0000 (21:30 -0800)]
[libc] Fix couple of corner cases in remquo.

These two cases are fixed:
1. If numerator is not zero and denominator is infinity, then the
numerator is returned as the remainder.
2. If numerator and denominator are equal in magnitude, then quotient
with the right sign is returned.

The differet tests of remquo, remquof and remquol have been unified
into a single file to avoid duplication.

Reviewed By: lntue

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

3 years ago[Inline] prevent inlining on stack protector mismatch
Nick Desaulniers [Wed, 2 Dec 2020 18:44:35 +0000 (10:44 -0800)]
[Inline] prevent inlining on stack protector mismatch

It's common for code that manipulates the stack via inline assembly or
that has to set up its own stack canary (such as the Linux kernel) would
like to avoid stack protectors in certain functions. In this case, we've
been bitten by numerous bugs where a callee with a stack protector is
inlined into an attribute((no_stack_protector)) caller, which
generally breaks the caller's assumptions about not having a stack
protector. LTO exacerbates the issue.

While developers can avoid this by putting all no_stack_protector
functions in one translation unit together and compiling those with
-fno-stack-protector, it's generally not very ergonomic or as
ergonomic as a function attribute, and still doesn't work for LTO. See also:
https://lore.kernel.org/linux-pm/20200915172658.1432732-1-rkir@google.com/
https://lore.kernel.org/lkml/20200918201436.2932360-30-samitolvanen@google.com/T/#u

SSP attributes can be ordered by strength. Weakest to strongest, they
are: ssp, sspstrong, sspreq.  Callees with differing SSP attributes may be
inlined into each other, and the strongest attribute will be applied to the
caller. (No change)

After this change:
* A callee with no SSP attributes will no longer be inlined into a
  caller with SSP attributes.
* The reverse is also true: a callee with an SSP attribute will not be
  inlined into a caller with no SSP attributes.
* The alwaysinline attribute overrides these rules.

Functions that get synthesized by the compiler may not get inlined as a
result if they are not created with the same stack protector function
attribute as their callers.

Alternative approach to https://reviews.llvm.org/D87956.

Fixes pr/47479.

Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed By: rnk, MaskRay

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

3 years ago[gn build] Port a65d8c5d720
LLVM GN Syncbot [Wed, 2 Dec 2020 18:50:30 +0000 (18:50 +0000)]
[gn build] Port a65d8c5d720

3 years ago[libc++] Add slice_array operator= valarray overload.
zoecarver [Wed, 2 Dec 2020 18:49:20 +0000 (10:49 -0800)]
[libc++] Add slice_array operator= valarray overload.

Add the slice_array::operator=(const std::valarray<T>& val_arr) overload.

Fixes https://llvm.org/PR40792.

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

3 years ago[mlir][PDL] Use explicit loop over llvm::find to fix MSVC breakage
River Riddle [Wed, 2 Dec 2020 18:42:40 +0000 (10:42 -0800)]
[mlir][PDL] Use explicit loop over llvm::find to fix MSVC breakage

3 years ago[XCOFF][AIX] Generate LSDA data and compact unwind section on AIX
jasonliu [Wed, 2 Dec 2020 14:48:52 +0000 (14:48 +0000)]
[XCOFF][AIX] Generate LSDA data and compact unwind section on AIX

Summary:
AIX uses the existing EH infrastructure in clang and llvm.
The major differences would be
1. AIX do not have CFI instructions.
2. AIX uses a new personality routine, named __xlcxx_personality_v1.
   It doesn't use the GCC personality rountine, because the
   interoperability is not there yet on AIX.
3. AIX do not use eh_frame sections. Instead, it would use a eh_info
section (compat unwind section) to store the information about
personality routine and LSDA data address.

Reviewed By: daltenty, hubert.reinterpretcast

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

3 years ago[JumpThreading][VectorUtils] avoid infinite loop on unreachable IR
Sanjay Patel [Wed, 2 Dec 2020 18:35:05 +0000 (13:35 -0500)]
[JumpThreading][VectorUtils] avoid infinite loop on unreachable IR

https://llvm.org/PR48362

It's possible that we could stub this out sooner somewhere
within JumpThreading, but I'm not sure how to do that, and
then we would still have potential danger in other callers.

I can't find a way to trigger this using 'instsimplify',
however, because that already has a bailout on unreachable
blocks.

3 years ago[flang][NFC] Add GetTopLevelUnitContaining functions
Tim Keith [Wed, 2 Dec 2020 18:28:48 +0000 (10:28 -0800)]
[flang][NFC] Add GetTopLevelUnitContaining functions

`GetTopLevelUnitContaining` returns the Scope nested in the global scope
that contains the given Scope or Symbol.

Use "Get" rather than "Find" in the name because "Find" implies it might
not be found, which can't happen. Following that logic, rename
`FindProgramUnitContaining` to `GetProgramUnitContaining` and have it
also return a reference rather that a pointer.

Note that the use of "ProgramUnit" is slightly confusing. In the Fortran
standard, "program-unit" refers to what is called a "TopLevelUnit" here.
What we are calling a "ProgramUnit" (here and in `ProgramTree`) includes
internal subprograms while "TopLevelUnit" does not.

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

3 years ago[lldb][NFC] Give class template pack test files unique class names
Raphael Isemann [Wed, 2 Dec 2020 18:19:35 +0000 (19:19 +0100)]
[lldb][NFC] Give class template pack test files unique class names

3 years ago[LoopVectorize] Fix optimal-epilog-vectorization-limitations.ll test on non-debug...
Simon Pilgrim [Wed, 2 Dec 2020 18:00:24 +0000 (18:00 +0000)]
[LoopVectorize] Fix optimal-epilog-vectorization-limitations.ll test on non-debug build bots

Add "REQUIRES: asserts" as the test uses the "--debug-only" switch

Should fix the clang-with-thin-lto-ubuntu buildbot failure

3 years ago[Thumb2] Regenerate predicated-liveout-unknown-lanes.ll test
Simon Pilgrim [Wed, 2 Dec 2020 17:52:04 +0000 (17:52 +0000)]
[Thumb2] Regenerate predicated-liveout-unknown-lanes.ll test

Helps to reduce diff in D90113

3 years ago[PowerPC] Regenerate cmpb tests
Simon Pilgrim [Wed, 2 Dec 2020 17:49:00 +0000 (17:49 +0000)]
[PowerPC] Regenerate cmpb tests

Helps to reduce diff in D90113

3 years agoDelete llvm::is_trivially_copyable and CMake variable HAVE_STD_IS_TRIVIALLY_COPYABLE
Fangrui Song [Wed, 2 Dec 2020 17:58:08 +0000 (09:58 -0800)]
Delete llvm::is_trivially_copyable and CMake variable HAVE_STD_IS_TRIVIALLY_COPYABLE

GCC<5 did not support std::is_trivially_copyable. Now LLVM builds
require 5.1 we can delete llvm::is_trivially_copyable after the users
have been migrated to std::is_trivially_copyable.

3 years agoUse std::is_trivially_copyable
Fangrui Song [Wed, 2 Dec 2020 07:40:38 +0000 (23:40 -0800)]
Use std::is_trivially_copyable

GCC<5 did not support std::is_trivially_copyable. Now LLVM builds require 5.1
we can migrate to std::is_trivially_copyable.

3 years ago[test] Make verify-invalid.ll work with legacy and new PMs
Arthur Eubanks [Tue, 1 Dec 2020 22:34:41 +0000 (14:34 -0800)]
[test] Make verify-invalid.ll work with legacy and new PMs

3 years ago[X86] EltsFromConsecutiveLoads - remove old FIXME comment. NFC.
Simon Pilgrim [Wed, 2 Dec 2020 17:21:41 +0000 (17:21 +0000)]
[X86] EltsFromConsecutiveLoads - remove old FIXME comment. NFC.

Its unlikely an undef element in a zero vector will be any use.

3 years ago[LSR][X86] Replace -march with -mtriples
Simon Pilgrim [Wed, 2 Dec 2020 16:57:35 +0000 (16:57 +0000)]
[LSR][X86] Replace -march with -mtriples

Fixes build on gnux32 hosts

3 years ago[GWP-ASan] Fix flaky test on Fuchsia
Kostya Kortchinsky [Tue, 1 Dec 2020 19:46:23 +0000 (11:46 -0800)]
[GWP-ASan] Fix flaky test on Fuchsia

The LateInit test might be reusing some already initialized thread
specific data if run within the main thread. This means that there
is a chance that the current value will not be enough for the 100
iterations, hence the test flaking.

Fix this by making the test run in its own thread.

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

3 years ago[analyzer][StdLibraryFunctionsChecker] Add return value constraint to functions with...
Gabor Marton [Wed, 2 Dec 2020 11:40:05 +0000 (12:40 +0100)]
[analyzer][StdLibraryFunctionsChecker] Add return value constraint to functions with BufferSize

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

3 years ago[X86] combineX86ShufflesRecursively - remove old FIXME comment. NFC.
Simon Pilgrim [Wed, 2 Dec 2020 16:25:06 +0000 (16:25 +0000)]
[X86] combineX86ShufflesRecursively - remove old FIXME comment. NFC.

Its unlikely an undef element in a zero vector will be any use, and SimplifyDemandedVectorElts now calls combineX86ShufflesRecursively so its unlikely we actually have a dependency on these specific elements.

3 years ago[X86] Regenerate 32-bit merge-consecutive-loads tests
Simon Pilgrim [Wed, 2 Dec 2020 16:10:50 +0000 (16:10 +0000)]
[X86] Regenerate 32-bit merge-consecutive-loads tests

Avoid use of X32 check prefix - we try to only use that for gnux32 triple tests

3 years ago[X86] EltsFromConsecutiveLoads - pull out repeated NumLoadedElts. NFCI.
Simon Pilgrim [Wed, 2 Dec 2020 12:34:57 +0000 (12:34 +0000)]
[X86] EltsFromConsecutiveLoads - pull out repeated NumLoadedElts. NFCI.

3 years agoRemove `-Wunused-result` and `-Wpedantic` warnings from GCC. NFC.
Michael Liao [Wed, 2 Dec 2020 15:51:45 +0000 (10:51 -0500)]
Remove `-Wunused-result` and `-Wpedantic` warnings from GCC. NFC.

3 years ago[hip] Fix host object creation from fatbin
Michael Liao [Tue, 1 Dec 2020 19:59:58 +0000 (14:59 -0500)]
[hip] Fix host object creation from fatbin

- `__hip_fatbin` should a symbol in `.hip_fatbin` section.

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

3 years ago[NFC][sanitizer] Fix test on 32bit platform
Vitaly Buka [Wed, 2 Dec 2020 15:28:45 +0000 (07:28 -0800)]
[NFC][sanitizer] Fix test on 32bit platform

3 years ago[CUDA][HIP] Diagnose reference of host variable
Yaxun (Sam) Liu [Wed, 11 Nov 2020 13:39:00 +0000 (08:39 -0500)]
[CUDA][HIP] Diagnose reference of host variable

This patch diagnoses invalid references of global host variables in device,
global, or host device functions.

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

3 years ago[CUDA][HIP] Fix capturing reference to host variable
Yaxun (Sam) Liu [Tue, 3 Nov 2020 20:24:41 +0000 (15:24 -0500)]
[CUDA][HIP] Fix capturing reference to host variable

In C++ when a reference variable is captured by copy, the lambda
is supposed to make a copy of the referenced variable in the captures
and refer to the copy in the lambda. Therefore, it is valid to capture
a reference to a host global variable in a device lambda since the
device lambda will refer to the copy of the host global variable instead
of access the host global variable directly.

However, clang tries to avoid capturing of reference to a host global variable
if it determines the use of the reference variable in the lambda function is
not odr-use. Clang also tries to emit load of the reference to a global variable
as load of the global variable if it determines that the reference variable is
a compile-time constant.

For a device lambda to capture a reference variable to host global variable
and use the captured value, clang needs to be taught that in such cases the use of the reference
variable is odr-use and the reference variable is not compile-time constant.

This patch fixes that.

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

3 years ago[LV] Epilogue Vectorization with Optimal Control Flow (Recommit)
Bardia Mahjour [Wed, 2 Dec 2020 15:07:41 +0000 (10:07 -0500)]
[LV] Epilogue Vectorization with Optimal Control Flow (Recommit)

This is yet another attempt at providing support for epilogue
vectorization following discussions raised in RFC http://llvm.1065342.n5.nabble.com/llvm-dev-Proposal-RFC-Epilog-loop-vectorization-tt106322.html#none
and reviews D30247 and D88819.

Similar to D88819, this patch achieve epilogue vectorization by
executing a single vplan twice: once on the main loop and a second
time on the epilogue loop (using a different VF). However it's able
to handle more loops, and generates more optimal control flow for
cases where the trip count is too small to execute any code in vector
form.

Reviewed By: SjoerdMeijer

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

3 years ago[PowerPC] Mark sanitizer test case unsupported for powerpc64
Ahsan Saghir [Wed, 2 Dec 2020 15:03:18 +0000 (09:03 -0600)]
[PowerPC] Mark sanitizer test case unsupported for powerpc64

The author of "https://reviews.llvm.org/D92428" marked
'resize_tls_dynamic.cpp' with XFAIL for powerpc64 since
it fails on a bunch of PowerPC buildbots. However, the
original test case passes on clang-ppc64le-rhel bot. So
marking this as XFAIL makes this bot to fail as the test
case passes unexpectedly. We are marking this unsupported
on all PowerPC64 for now until it is fixed for all the
PowerPC buildbots.

3 years ago[mac/lld] Make --reproduce work with thin archives
Nico Weber [Wed, 2 Dec 2020 04:31:57 +0000 (23:31 -0500)]
[mac/lld] Make --reproduce work with thin archives

See http://reviews.llvm.org/rL268229 and
http://reviews.llvm.org/rL313832 which did the same for the ELF port.

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

3 years agoAdd `Operation* OpState::operator->()` to provide more convenient access to members...
Christian Sigg [Sat, 28 Nov 2020 12:35:55 +0000 (13:35 +0100)]
Add `Operation* OpState::operator->()` to provide more convenient access to members of Operation.

Given that OpState already implicit converts to Operator*, this seems reasonable.

The alternative would be to add more functions to OpState which forward to Operation.

Reviewed By: rriddle, ftynse

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

3 years ago[SLP] use 'match' for binop/select; NFC
Sanjay Patel [Wed, 2 Dec 2020 14:00:49 +0000 (09:00 -0500)]
[SLP] use 'match' for binop/select; NFC

This might be a small improvement in readability, but the
real motivation is to make it easier to adapt the code to
deal with intrinsics like 'maxnum' and/or integer min/max.

There is potentially help in doing that with D92086, but
we might also just add specialized wrappers here to deal
with the expected patterns.

3 years ago[OpenMPIRBuilder] forward arguments as pointers to outlined function
Alex Zinenko [Thu, 26 Nov 2020 17:32:30 +0000 (18:32 +0100)]
[OpenMPIRBuilder] forward arguments as pointers to outlined function

OpenMPIRBuilder::createParallel outlines the body region of the parallel
construct into a new function that accepts any value previously defined outside
the region as a function argument. This function is called back by OpenMP
runtime function __kmpc_fork_call, which expects trailing arguments to be
pointers. If the region uses a value that is not of a pointer type, e.g. a
struct, the produced code would be invalid. In such cases, make createParallel
emit IR that stores the value on stack and pass the pointer to the outlined
function instead. The outlined function then loads the value back and uses as
normal.

Reviewed By: jdoerfert, llitchev

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

3 years ago[ThinLTO] Import symver directives for imported symbols (PR48214)
Hans Wennborg [Mon, 30 Nov 2020 15:21:54 +0000 (16:21 +0100)]
[ThinLTO] Import symver directives for imported symbols (PR48214)

When importing symbols from another module, also import any
corresponding symver directives.

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

3 years agoSimplify append to module inline asm string in IRLinker::run()
Hans Wennborg [Wed, 2 Dec 2020 13:45:49 +0000 (14:45 +0100)]
Simplify append to module inline asm string in IRLinker::run()

This also removes the empty extra "module asm" that would be created,
and updates the test to reflect that while making it more explicit.

Broken out from https://reviews.llvm.org/D92335

3 years ago[VE] Add vand, vor, and vxor intrinsic instructions
Kazushi (Jam) Marukawa [Wed, 2 Dec 2020 04:23:02 +0000 (13:23 +0900)]
[VE] Add vand, vor, and vxor intrinsic instructions

Add vand, vor, and vxor intrinsic instructions and regression tests.

Reviewed By: simoll

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

3 years ago[SystemZ] Adding extra extended mnemonics for SystemZ target
Anirudh Prasad [Wed, 2 Dec 2020 12:24:13 +0000 (07:24 -0500)]
[SystemZ] Adding extra extended mnemonics for SystemZ target

This patch consists of the addition of some common additional
extended mnemonics to the SystemZ target.

- These are jnop, jct, jctg, jas, jasl, jxh, jxhg, jxle,
  jxleg, bru, brul, br*, br*l.
- These mnemonics and the instructions they map to are
  defined here, Chapter 4 - Branching with extended
  mnemonic codes.
- Except for jnop (which is a variant of brc 0, label), every
  other mnemonic is marked as a MnemonicAlias since there is
  already a "defined" instruction with the same encoding
  and/or condition mask values.
- brc 0, label doesn't have a defined extended mnemonic, thus
  jnop is defined using as an InstAlias. Furthermore, the
  applyMnemonicAliases function is called in the overridden
  parseInstruction function in SystemZAsmParser.cpp to ensure
  any mnemonic aliases are applied before any further
  processing on the instruction is done.

Reviewed By: uweigand

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

3 years ago[SVE] Add support for scalable vectors with vectorize.scalable.enable loop attribute
David Sherwood [Wed, 7 Oct 2020 08:21:39 +0000 (09:21 +0100)]
[SVE] Add support for scalable vectors with vectorize.scalable.enable loop attribute

In this patch I have added support for a new loop hint called
vectorize.scalable.enable that says whether we should enable scalable
vectorization or not. If a user wants to instruct the compiler to
vectorize a loop with scalable vectors they can now do this as
follows:

  br i1 %exitcond, label %for.end, label %for.body, !llvm.loop !2
  ...
  !2 = !{!2, !3, !4}
  !3 = !{!"llvm.loop.vectorize.width", i32 8}
  !4 = !{!"llvm.loop.vectorize.scalable.enable", i1 true}

Setting the hint to false simply reverts the behaviour back to the
default, using fixed width vectors.

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

3 years ago[SystemZ][NFC]Move all SystemZ tests to init-s390x.c
Abhina Sreeskantharajan [Wed, 2 Dec 2020 13:22:40 +0000 (08:22 -0500)]
[SystemZ][NFC]Move all SystemZ tests to init-s390x.c

This patch moves all s390x tests in init.c and init-zos.c to init-s390x.c.

Reviewed By: muiez

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

3 years ago[libc] Add strncpy implementation.
Cheng Wang [Thu, 12 Nov 2020 03:42:04 +0000 (11:42 +0800)]
[libc] Add strncpy implementation.

Add libc strncpy implementation.

Reviewed By: sivachandra, gchatelet

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