platform/upstream/llvm.git
3 years agoReland "[LoopUnswitch] Fix incorrect Modified status"
David Stenberg [Thu, 20 Aug 2020 06:28:24 +0000 (08:28 +0200)]
Reland "[LoopUnswitch] Fix incorrect Modified status"

Relanded since the buildbot issue was unrelated to this commit.

When hoisting simple values out from a loop, and an optsize attribute, a
convergent call, or an invoke instruction hindered the pass from
unswitching the loop, the pass would return an incorrect Modified
status.

This was caught using the check introduced by D80916.

Reviewed By: asbirlea

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

3 years ago[DebugInfo] Fix DwarfExpression::addConstantFP for float on big-endian
Bjorn Pettersson [Thu, 20 Aug 2020 09:41:05 +0000 (11:41 +0200)]
[DebugInfo] Fix DwarfExpression::addConstantFP for float on big-endian

The byte swapping, when dealing with 4 byte (float) FP constants
in DwarfExpression::addConstantFP, added in commit ef8992b9f0189005
was not correct. It always performed byte swapping using an
uint64_t value. When dealing with 4 byte values the 4 interesting
bytes ended up in the big end of the uint64_t, but later we emitted
the 4 bytes at the little end. So we ended up with zeroes being
emitted and faulty debug information.

This patch simplifies things a bit, IMHO. Using the APInt
representation throughout the function, instead of looking at
the internal representation using getRawBytes and without using
reinterpret_cast etc. And using API.byteSwap() should result in
correct byte swapping independent of APInt being 4 or 8 bytes.

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

3 years ago[llvm-readobj/elf] - Refine the code for broken PT_DYNAMIC segment diagnostic.
Georgii Rymar [Wed, 19 Aug 2020 11:14:38 +0000 (14:14 +0300)]
[llvm-readobj/elf] - Refine the code for broken PT_DYNAMIC segment diagnostic.

The code that reports "PT_DYNAMIC segment offset + size exceeds the size of the file"
has an issue: it is possible to bypass the validation by overflowing the size + offset result.

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

3 years agoRevert "[LoopUnswitch] Fix incorrect Modified status"
David Stenberg [Thu, 20 Aug 2020 09:11:48 +0000 (11:11 +0200)]
Revert "[LoopUnswitch] Fix incorrect Modified status"

This reverts commit dfd447c22043b0a64bf1d146735ca33f926bd22d.

After I pushed this commit, llvm-sphinx-docs started failing, due to:

  Warning, treated as error:
  extension 'recommonmark' has no setup() function;
  is it really a Sphinx extension module?

I don't see how this commit may have caused that, but I'm still
reverting it since I don't know how to proceed with that
troubleshooting.

3 years ago[ThinLTO] Import globals recursively
Evgeny Leviant [Thu, 20 Aug 2020 09:13:43 +0000 (12:13 +0300)]
[ThinLTO] Import globals recursively

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

3 years ago[AMDGPU] Add A16/G16 to InstCombine
Sebastian Neubauer [Thu, 4 Jun 2020 10:22:36 +0000 (12:22 +0200)]
[AMDGPU] Add A16/G16 to InstCombine

When sampling from images with coordinates that only have 16 bit
accuracy, convert the image intrinsic call to use a16 or g16.
This does only happen if the target hardware supports it.

An alternative would be to always apply this combination, independent of
the target hardware and extend 16 bit arguments to 32 bit arguments
during legalization. To me, this sounds like an unnecessary roundtrip
that could prevent some further InstCombine optimizations.

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

3 years ago[GlobalISel][IRTranslator] Support PHI instructions in landingpad blocks
Konstantin Schwarz [Tue, 18 Aug 2020 08:32:44 +0000 (10:32 +0200)]
[GlobalISel][IRTranslator] Support PHI instructions in landingpad blocks

The check for the landingpad instructions was overly restrictive. In optimimized builds PHI nodes can appear
before the landingpad instructions, resulting in a fallback to SelectionDAG.

This change relaxes the check to allow PHI nodes.

Reviewed By: arsenm

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

3 years ago[yaml2obj] - Make the 'Machine' key optional.
Georgii Rymar [Tue, 18 Aug 2020 12:24:26 +0000 (15:24 +0300)]
[yaml2obj] - Make the 'Machine' key optional.

Currently we have to set 'Machine' to something in our
YAML descriptions. Usually we use 'EM_X86_64' for 64-bit targets
and 'EM_386' for 32-bit targets. At the same time, in fact, in most
cases our tests do not need a machine type and we can use
'EM_NONE'.

This is cleaner, because avoids the need of using a particular machine.

In this patch I've made the 'Machine' key optional (the default value,
when it is not specified is `EM_NONE`) and removed it (where possible)
from yaml2obj, obj2yaml and llvm-readobj tests.

There are few tests left where I decided not to remove it, because
I didn't want to touch CHECK lines or doing anything more complex
than a removing a "Machine: *" line and formatting lines around.

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

3 years agoRefactor most of the fixed-point tests.
Bevin Hansson [Thu, 20 Aug 2020 08:24:03 +0000 (10:24 +0200)]
Refactor most of the fixed-point tests.

The tests were not written with update_cc_test_checks
in mind, which make them difficult to update. Fix this.

Also, some of the consteval tests were outright broken,
since the CHECK lines were wrong.

Other than this, the semantics of the tests are preserved.

3 years ago[IR] Add FixedPointBuilder.
Bevin Hansson [Wed, 5 Aug 2020 14:40:05 +0000 (16:40 +0200)]
[IR] Add FixedPointBuilder.

This patch adds a convenience class for using FixedPointSemantics
to build fixed-point operations in IR.

RFC: http://lists.llvm.org/pipermail/llvm-dev/2020-August/144025.html

Reviewed By: rjmccall

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

3 years ago[ADT] Move FixedPoint.h from Clang to LLVM.
Bevin Hansson [Thu, 16 Jul 2020 11:56:07 +0000 (13:56 +0200)]
[ADT] Move FixedPoint.h from Clang to LLVM.

This patch moves FixedPointSemantics and APFixedPoint
from Clang to LLVM ADT.

This will make it easier to use the fixed-point
classes in LLVM for constructing an IR builder for
fixed-point and for reusing the APFixedPoint class
for constant evaluation purposes.

RFC: http://lists.llvm.org/pipermail/llvm-dev/2020-August/144025.html

Reviewed By: leonardchan, rjmccall

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

3 years ago[AST] Get field size in chars rather than bits in RecordLayoutBuilder.
Bevin Hansson [Tue, 4 Aug 2020 10:55:38 +0000 (12:55 +0200)]
[AST] Get field size in chars rather than bits in RecordLayoutBuilder.

In D79719, LayoutField was refactored to fetch the size of field
types in bits and then convert to chars, rather than fetching
them in chars directly. This is not ideal, since it makes the
calculations char size dependent, and breaks for sizes that
are not a multiple of the char size.

This patch changes it to use getTypeInfoInChars instead of
getTypeInfo.

Reviewed By: efriedma

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

3 years ago[MLIR] Redundancy detection for FlatAffineConstraints using Simplex
Arjun P [Thu, 20 Aug 2020 08:07:44 +0000 (13:37 +0530)]
[MLIR] Redundancy detection for FlatAffineConstraints using Simplex

This patch adds the capability to perform constraint redundancy checks for `FlatAffineConstraints` using `Simplex`, via a new member function `FlatAffineConstraints::removeRedundantConstraints`. The pre-existing redundancy detection algorithm runs a full rational emptiness check for each inequality separately for checking redundancy. Leveraging the existing `Simplex` infrastructure, in this patch we have an algorithm for redundancy checks that can check each constraint by performing pivots on the tableau, which provides an alternative to running Fourier-Motzkin elimination for each constraint separately.

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

3 years ago[AMDGPU][LoopUnroll] Increase BB size to analyze for complete unroll.
dfukalov [Wed, 19 Aug 2020 21:14:14 +0000 (00:14 +0300)]
[AMDGPU][LoopUnroll] Increase BB size to analyze for complete unroll.

The `UnrollMaxBlockToAnalyze` parameter is used at the stage when we have no
information about a loop body BB cost. In some cases, e.g. for simple loop
```
for(int i=0; i<32; ++i){
  D = Arr2[i*8 + C1];
  Arr1[i*64 + C2] += C3 * D;
  Arr1[i*64 + C2 + 2048] += C4 * D;
}

```
current default parameter value is not enough to run deeper cost analyze so the
loop is not completely unrolled.

Reviewed By: rampitec

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

3 years ago[compiler-rt] Compile assembly files as ASM not C
Petr Hosek [Thu, 20 Aug 2020 07:03:45 +0000 (00:03 -0700)]
[compiler-rt] Compile assembly files as ASM not C

It isn't very wise to pass an assembly file to the compiler and tell it to compile as a C file and hope that the compiler recognizes it as assembly instead.
Instead enable the ASM language and mark the files as being ASM.

[525/634] Building C object lib/tsan/CMakeFiles/clang_rt.tsan-aarch64.dir/rtl/tsan_rtl_aarch64.S.o
FAILED: lib/tsan/CMakeFiles/clang_rt.tsan-aarch64.dir/rtl/tsan_rtl_aarch64.S.o
/opt/tooling/drive/host/bin/clang --target=aarch64-linux-gnu -I/opt/tooling/drive/llvm/compiler-rt/lib/tsan/.. -isystem /opt/tooling/drive/toolchain/opt/drive/toolchain/include -x c -Wall -Wno-unused-parameter -fno-lto -fPIC -fno-builtin -fno-exceptions -fomit-frame-pointer -funwind-tables -fno-stack-protector -fno-sanitize=safe-stack -fvisibility=hidden -fno-lto -O3 -gline-tables-only -Wno-gnu -Wno-variadic-macros -Wno-c99-extensions -Wno-non-virtual-dtor -fPIE -fno-rtti -Wframe-larger-than=530 -Wglobal-constructors --sysroot=. -MD -MT lib/tsan/CMakeFiles/clang_rt.tsan-aarch64.dir/rtl/tsan_rtl_aarch64.S.o -MF lib/tsan/CMakeFiles/clang_rt.tsan-aarch64.dir/rtl/tsan_rtl_aarch64.S.o.d -o lib/tsan/CMakeFiles/clang_rt.tsan-aarch64.dir/rtl/tsan_rtl_aarch64.S.o -c /opt/tooling/drive/llvm/compiler-rt/lib/tsan/rtl/tsan_rtl_aarch64.S
/opt/tooling/drive/llvm/compiler-rt/lib/tsan/rtl/tsan_rtl_aarch64.S:29:1: error: expected identifier or '('
.section .text
^
1 error generated.

Fixed Clang not being passed as the assembly compiler for compiler-rt runtime build.

Patch By: tambre

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

3 years ago[ARM][MachineOutliner] Add default mode.
Yvan Roux [Thu, 20 Aug 2020 07:25:33 +0000 (09:25 +0200)]
[ARM][MachineOutliner] Add default mode.

Use the stack to save and restore the link register when there is no
available register to do it.

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

3 years ago[LoopUnswitch] Fix incorrect Modified status
David Stenberg [Thu, 20 Aug 2020 06:28:24 +0000 (08:28 +0200)]
[LoopUnswitch] Fix incorrect Modified status

When hoisting simple values out from a loop, and an optsize attribute, a
convergent call, or an invoke instruction hindered the pass from
unswitching the loop, the pass would return an incorrect Modified
status.

This was caught using the check introduced by D80916.

Reviewed By: asbirlea

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

3 years ago[Attributor][FIX] Update the call graph properly when internalizing functions
Johannes Doerfert [Tue, 18 Aug 2020 20:54:05 +0000 (15:54 -0500)]
[Attributor][FIX] Update the call graph properly when internalizing functions

The internal version is now part of the SCC, make sure to perform this
update.

3 years ago[Attributor] Simplify comparison against constant null pointer
Johannes Doerfert [Tue, 18 Aug 2020 15:03:25 +0000 (10:03 -0500)]
[Attributor] Simplify comparison against constant null pointer

Comparison against null is a common pattern that usually is followed by
error handling code and the likes. We now use AANonNull to simplify
these comparisons optimistically in order to make more code dead early
on.

Reviewed By: uenoku

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

3 years ago[Attributor][FIX] Do not use cyclic arguments for `nonnull`
Johannes Doerfert [Tue, 18 Aug 2020 15:01:37 +0000 (10:01 -0500)]
[Attributor][FIX] Do not use cyclic arguments for `nonnull`

`AADereferenceable::getAssumedDereferenceableBytes()` is actually
deducing `dereferenceable_or_null`. We should not use that information
to deduce `nonnull`, since it doesn't imply `nonnull`.

3 years ago[Attributor][AAIsDead][NFC] Skip uninteresting instructions early
Johannes Doerfert [Sun, 2 Aug 2020 06:54:05 +0000 (01:54 -0500)]
[Attributor][AAIsDead][NFC] Skip uninteresting instructions early

3 years ago[Attributor][NFC] Improve the depgraph test to make differences clear
Johannes Doerfert [Sun, 2 Aug 2020 07:03:11 +0000 (02:03 -0500)]
[Attributor][NFC] Improve the depgraph test to make differences clear

3 years ago[Attributor][NFC] Extract functionality into own member
Johannes Doerfert [Sun, 2 Aug 2020 05:36:52 +0000 (00:36 -0500)]
[Attributor][NFC] Extract functionality into own member

3 years ago[ELF][test] Fix some llvm-objdump RUN lines which don't actually test anything
Fangrui Song [Thu, 20 Aug 2020 05:48:28 +0000 (22:48 -0700)]
[ELF][test] Fix some llvm-objdump RUN lines which don't actually test anything

3 years ago[PowerPC] Support constrained scalar fptosi/fptoui
Qiu Chaofan [Thu, 20 Aug 2020 05:29:43 +0000 (13:29 +0800)]
[PowerPC] Support constrained scalar fptosi/fptoui

This patch adds support for constrained scalar fp to int operations on
PowerPC. Besides, this fixes the FP exception bit of quad-precision
convert & truncate instructions.

Reviewed By: steven.zhang, uweigand

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

3 years agoRevert "[IR] Intrinsics default attributes and opt-out flag"
Johannes Doerfert [Thu, 20 Aug 2020 05:25:13 +0000 (00:25 -0500)]
Revert "[IR] Intrinsics default attributes and opt-out flag"

This commit introduced a non-trivial compile time regression that needs
to be addressed: https://reviews.llvm.org/D70365#2227627
Given that it is unclear how long that will take, I'll revert it for
now.

This reverts commit eedf18fc1f5fc71bb896204abf41fc5a2dbf25f7.

3 years agoRevert "[OpenMPOpt] ICV tracking for calls"
Johannes Doerfert [Thu, 20 Aug 2020 05:00:35 +0000 (00:00 -0500)]
Revert "[OpenMPOpt] ICV tracking for calls"

This commits breaks certain OpenMP codes (on power) because it expanded
the Attributor scope without telling the Attributor about the SCC
extend. See: https://reviews.llvm.org/D85544#2227611

This reverts commit b0b32e649011d9a60165b9b53eb2764b7da9c8ca.

3 years ago[OpenMP] Introduce target memory manager
Shilei Tian [Thu, 20 Aug 2020 03:12:02 +0000 (23:12 -0400)]
[OpenMP] Introduce target memory manager

Target memory manager is introduced in this patch which aims to manage target
memory such that they will not be freed immediately when they are not used
because the overhead of memory allocation and free is very large. For CUDA
device, cuMemFree even blocks the context switch on device which affects
concurrent kernel execution.

The memory manager can be taken as a memory pool. It divides the pool into
multiple buckets according to the size such that memory allocation/free
distributed to different buckets will not affect each other.

In this version, we use the exact-equality policy to find a free buffer. This
is an open question: will best-fit work better here? IMO, best-fit is not good
for target memory management because computation on GPU usually requires GBs of
data. Best-fit might lead to a serious waste. For example, there is a free
buffer of size 1960MB, and now we need a buffer of size 1200MB. If best-fit,
the free buffer will be returned, leading to a 760MB waste.

The allocation will happen when there is no free memory left, and the memory
free on device will take place in the following two cases:
1. The program ends. Obviously. However, there is a little problem that plugin
library is destroyed before the memory manager is destroyed, leading to a fact
that the call to target plugin will not succeed.
2. Device is out of memory when we request a new memory. The manager will walk
through all free buffers from the bucket with largest base size, pick up one
buffer, free it, and try to allocate immediately. If it succeeds, it will
return right away rather than freeing all buffers in free list.

Update:
A threshold (8KB by default) is set such that users could control what size of memory
will be managed by the manager. It can also be configured by an environment variable
`LIBOMPTARGET_MEMORY_MANAGER_THRESHOLD`.

Reviewed By: jdoerfert, ye-luo, JonChesterfield

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

3 years ago[NFC] It's a test commit, which updates CREDITS.TXT
Zi Xuan Wu (Zeson) [Thu, 20 Aug 2020 02:58:37 +0000 (10:58 +0800)]
[NFC] It's a test commit, which updates CREDITS.TXT

3 years ago[AMDGPU] Correct DWARF register defintions
Tony [Thu, 20 Aug 2020 01:09:12 +0000 (01:09 +0000)]
[AMDGPU] Correct DWARF register defintions

- Rename AMDGPU SCC DWARF register to STATUS since the scalar
  condition code is a bit within the STATUS register.

- Correct bit size of the VCC_64 register to 64 which is the size in
  wave64 mode.

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

3 years ago[lldb] Return empty string from getExtraMakeArgs when not implemented
Jonas Devlieghere [Thu, 20 Aug 2020 00:51:50 +0000 (17:51 -0700)]
[lldb] Return empty string from getExtraMakeArgs when not implemented

No return statement means the method returns None which breaks a list
comprehension down the line that expects a str instance.

3 years ago[X86][AutoUpgrade] Simplify string management in UpgradeDataLayoutString a bit. NFCI
Craig Topper [Thu, 20 Aug 2020 00:44:21 +0000 (17:44 -0700)]
[X86][AutoUpgrade] Simplify string management in UpgradeDataLayoutString a bit. NFCI

We don't need a std::string for a literal string, we can use a
StringRef.

The addition of StringRefs produces a Twine that we can just call
str() without converting to a SmallString ourselves. Twine will
do that internally.

3 years ago[MLIR] Add PatternRewriter::mergeBlockBefore() to merge a block in the middle of...
Rahul Joshi [Wed, 19 Aug 2020 23:07:42 +0000 (16:07 -0700)]
[MLIR] Add PatternRewriter::mergeBlockBefore() to merge a block in the middle of another block.

- This utility to merge a block anywhere into another one can help inline single
  block regions into other blocks.
- Modified patterns test to use the new function.

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

3 years ago[X86] Add support 'tune' in target attribute
Craig Topper [Wed, 19 Aug 2020 22:58:16 +0000 (15:58 -0700)]
[X86] Add support 'tune' in target attribute

This adds parsing and codegen support for tune in target attribute.

I've implemented this so that arch in the target attribute implicitly disables tune from the command line. I'm not sure what gcc does here. But since -march implies -mtune. I assume 'arch' in the target attribute implies tune in the target attribute.

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

3 years ago[X86] Add mtune command line test cases that should have gone with 4cbceb74bb5676d018...
Craig Topper [Wed, 19 Aug 2020 22:58:06 +0000 (15:58 -0700)]
[X86] Add mtune command line test cases that should have gone with 4cbceb74bb5676d0181d4d0cab5194d90a42c2ec

3 years agoGlobalISel: Implement fewerElementsVector for G_CONCAT_VECTORS sources
Matt Arsenault [Mon, 3 Aug 2020 18:13:38 +0000 (14:13 -0400)]
GlobalISel: Implement fewerElementsVector for G_CONCAT_VECTORS sources

This fixes <6 x s16> = G_CONCAT_VECTORS from <3 x s16> handling.

3 years ago[c++14] Implement missed piece of N3323: use "converted constant" rules
Richard Smith [Wed, 19 Aug 2020 19:46:52 +0000 (12:46 -0700)]
[c++14] Implement missed piece of N3323: use "converted constant" rules
for array bounds, not "integer constant" rules.

For an array bound of class type, this causes us to perform an implicit
conversion to size_t, instead of looking for a unique conversion to
integral or unscoped enumeration type. This affects which cases are
valid when a class has multiple implicit conversion functions to
different types.

3 years agoExplain why the array bound is non-constant in VLA diagnostics.
Richard Smith [Wed, 19 Aug 2020 19:46:22 +0000 (12:46 -0700)]
Explain why the array bound is non-constant in VLA diagnostics.

In passing, also use a more precise diagnostic to explain why an
expression is not an ICE if it's not of integral type.

3 years ago[lldb] Update TestSimulatorPlatform.py to set ARCH_CFLAGS instead of TRIPLE
Jonas Devlieghere [Wed, 19 Aug 2020 22:35:29 +0000 (15:35 -0700)]
[lldb] Update TestSimulatorPlatform.py to set ARCH_CFLAGS instead of TRIPLE

I move the triple (de)composition logic into the builder in e5d08fcbac72
but this test is relying on Make to construct the set the ARCH,
ARCH_CFLAGS and SDKROOT based on the given TRIPLE. This patch updates
the test to pass these variables directly.

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

3 years ago[lldb/interpreter] Add REPL-specific init file
Med Ismail Bennani [Wed, 19 Aug 2020 20:04:35 +0000 (22:04 +0200)]
[lldb/interpreter] Add REPL-specific init file

This patch adds the infrastructure to have language specific REPL init
files. It's the foundation work to a following patch that will introduce
Swift REPL init file.

When lldb is launched with the `--repl` option, it will look for a REPL
init file in the home directory and source it. This overrides the
default `~/.lldbinit`, which content might make the REPL behave
unexpectedly. If the REPL init file doesn't exists, lldb will fall back
to the default init file.

rdar://65836048

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
3 years ago[libFuzzer] Fix value-profile-load test.
Dokyung Song [Wed, 19 Aug 2020 20:21:05 +0000 (20:21 +0000)]
[libFuzzer] Fix value-profile-load test.

The behavior of the CrossOver mutator has changed with
bb54bcf84970c04c9748004f3a4cf59b0c1832a7. This seems to affect the
value-profile-load test on Darwin. This patch provides a wider margin for
determining success of the value-profile-load test, by testing the targeted
functionality (i.e., GEP index value profile) more directly and faster. To this
end, LoadTest.cpp now uses a narrower condition (Size != 8) for initial pruning
of inputs, effectively preventing libFuzzer from generating inputs longer than
necessary and spending time on mutating such long inputs in the corpus - a
functionality not meant to be tested by this specific test.

Previously, on x86/Linux, it required 6,597,751 execs with -use_value_profile=1
and 19,605,575 execs with -use_value_profile=0 to hit the crash. With this
patch, the test passes with 174,493 execs, providing a wider margin from the
given trials of 10,000,000. Note that, without the value profile (i.e.,
-use_value_profile=0), the test wouldn't pass as it still requires 19,605,575
execs to hit the crash.

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

3 years ago[DFSan] Handle mmap() calls before interceptors are installed.
Matt Morehouse [Wed, 19 Aug 2020 22:07:17 +0000 (15:07 -0700)]
[DFSan] Handle mmap() calls before interceptors are installed.

InitializeInterceptors() calls dlsym(), which calls calloc().  Depending
on the allocator implementation, calloc() may invoke mmap(), which
results in a segfault since REAL(mmap) is still being resolved.

We fix this by doing a direct syscall if interceptors haven't been fully
resolved yet.

Reviewed By: vitalybuka

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

3 years ago[libc][obvious] Fix x86 long double conversion to integer.
Siva Chandra Reddy [Wed, 19 Aug 2020 21:44:23 +0000 (14:44 -0700)]
[libc][obvious] Fix x86 long double conversion to integer.

Fixes incorrectly constructed ceill tests.

3 years ago[llvm] Add default constructor of `llvm::ElementCount`.
Francesco Petrogalli [Wed, 19 Aug 2020 19:50:24 +0000 (19:50 +0000)]
[llvm] Add default constructor of `llvm::ElementCount`.

This patch prevents failures like those reported in
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/34173.

We have enabled the default constructor for
`llvm::ElementCount` to make sure the code compiles on Windows.

Reviewed By: ormris

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

3 years ago[CMake] Fix an issue where get_system_libname creates an empty regex capture on windows
Petr Hosek [Wed, 19 Aug 2020 21:33:52 +0000 (14:33 -0700)]
[CMake] Fix an issue where get_system_libname creates an empty regex capture on windows

Fixes https://bugs.chromium.org/p/chromium/issues/detail?id=1119478

Patch By: haampie

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

3 years agoForce Remove Attribute
Kyungwoo Lee [Wed, 19 Aug 2020 21:28:06 +0000 (17:28 -0400)]
Force Remove Attribute

-force-attribute adds an attribute to function via command-line.
However, there was no counter-part to remove an attribute.  This patch
adds -force-remove-attribute that removes an attribute from function.

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

3 years ago[ValueTracking] define/use max recursion depth in header
Sanjay Patel [Wed, 19 Aug 2020 20:32:24 +0000 (16:32 -0400)]
[ValueTracking] define/use max recursion depth in header

There's a potential motivating case to increase this limit in PR47191:
http://bugs.llvm.org/PR47191

But first we should make it less hacky. The limit in InstCombine is directly tied
to this value because an increase there can cause asserts in the underlying value
tracking calls if not changed together. The usage in VectorUtils is independent,
but the comment suggests that we should use the same value unless there's a known
reason to diverge. There are similar limits in codegen analysis, but I think we
should leave those independent in case we intentionally want the optimization
power/cost to be different there.

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

3 years agoImplement FPToUI and UIToFP ops in standard dialect
Mars Saxman [Wed, 19 Aug 2020 20:45:18 +0000 (22:45 +0200)]
Implement FPToUI and UIToFP ops in standard dialect

Add the unsigned complements to the existing FPToSI and SIToFP operations in the
standard dialect, with one-to-one lowerings to the corresponding LLVM operations.

Reviewed By: ftynse

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

3 years ago[X86] Add feature for Fast Short REP MOV (FSRM) for Icelake or newer.
Hiroshi Yamauchi [Fri, 14 Aug 2020 19:20:08 +0000 (12:20 -0700)]
[X86] Add feature for Fast Short REP MOV (FSRM) for Icelake or newer.

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

3 years ago[lldb] Move Xcode SDK helper functions into lldbutil
Jonas Devlieghere [Wed, 19 Aug 2020 20:25:57 +0000 (13:25 -0700)]
[lldb] Move Xcode SDK helper functions into lldbutil

This allows the logic to be reused by both the builders and the tests.

3 years ago[X89] Ignore -mtune=generic to fix failures some users are seeing after D85384
Craig Topper [Wed, 19 Aug 2020 20:12:46 +0000 (13:12 -0700)]
[X89] Ignore -mtune=generic to fix failures some users are seeing after D85384

Some code bases out there pass -mtune=generic to clang. This would have
been ignored prior to D85384. Now it results in an error
because "generic" isn't recognized by isValidCPUName.

And if we let it go through to the backend as a tune
setting it would get the tune flags closer to i386 rather
than a modern CPU.

I plan to change what tune=generic does in the backend in
a future patch. And allow this in the frontend.
But this should be a quick fix for the error some users
are seeing.

3 years ago[OPENMP]Fix PR47158, case 2: do not report host-only functions in unused function...
Alexey Bataev [Tue, 18 Aug 2020 18:51:51 +0000 (14:51 -0400)]
[OPENMP]Fix PR47158, case 2: do not report host-only functions in unused function in device mode.

If the function is not marked exlicitly as declare target and it calls
function(s), marked as declare target device_type(host), these host-only
functions should not be dignosed as used in device mode, if the caller
function is not used in device mode too.

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

3 years ago[mlir] Add a new "Pattern Descriptor Language" (PDL) dialect.
River Riddle [Wed, 19 Aug 2020 19:57:45 +0000 (12:57 -0700)]
[mlir] Add a new "Pattern Descriptor Language" (PDL) dialect.

PDL presents a high level abstraction for the rewrite pattern infrastructure available in MLIR. This abstraction allows for representing patterns transforming MLIR, as MLIR. This allows for applying all of the benefits that the general MLIR infrastructure provides, to the infrastructure itself. This means that pattern matching can be more easily verified for correctness, targeted by frontends, and optimized.

PDL abstracts over various different aspects of patterns and core MLIR data structures. Patterns are specified via a `pdl.pattern` operation. These operations contain a region body for the "matcher" code, and terminate with a `pdl.rewrite` that either dispatches to an external rewriter or contains a region for the rewrite specified via `pdl`. The types of values in `pdl` are handle types to MLIR C++ types, with `!pdl.attribute`, `!pdl.operation`, and `!pdl.type` directly mapping to `mlir::Attribute`, `mlir::Operation*`, and `mlir::Value` respectively.

An example pattern is shown below:

```mlir
// pdl.pattern contains metadata similarly to a `RewritePattern`.
pdl.pattern : benefit(1) {
  // External input operand values are specified via `pdl.input` operations.
  // Result types are constrainted via `pdl.type` operations.

  %resultType = pdl.type
  %inputOperand = pdl.input
  %root, %results = pdl.operation "foo.op"(%inputOperand) -> %resultType
  pdl.rewrite(%root) {
    pdl.replace %root with (%inputOperand)
  }
}
```

This is a culmination of the work originally discussed here: https://groups.google.com/a/tensorflow.org/g/mlir/c/j_bn74ByxlQ

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

3 years agoRe-apply "[DebugInfo] Emit DW_OP_implicit_value for Floating point constants"
Sourabh Singh Tomar [Wed, 19 Aug 2020 20:00:31 +0000 (01:30 +0530)]
Re-apply "[DebugInfo] Emit DW_OP_implicit_value for Floating point constants"

This patch was reverted in 7c182663a857fc87 due to some failures
observed on PCC based machines. Failures were due to Endianness issue and
long double representation issues.

Patch is revised to address Endianness issue. Furthermore, support
for emission of `DW_OP_implicit_value` for `long double` has been removed
(since it was unclean at the moment). Planning to handle this in
a clean way soon!

For more context, please refer to following review link.

Reviewed By: aprantl

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

3 years ago[OpenMP] Refactored the function `DeviceTy::data_exchange`
Shilei Tian [Wed, 19 Aug 2020 20:07:58 +0000 (16:07 -0400)]
[OpenMP] Refactored the function `DeviceTy::data_exchange`

This patch contains the following changes:
1. Renamed the function `DeviceTy::data_exchange` to `DeviceTy::dataExchange`;
2. Changed the second argument `DeviceTy DstDev` to `DeviceTy &DstDev`;
3. Renamed the last argument.

Reviewed By: ye-luo

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

3 years agoRevert "[DebugInfo] Emit DW_OP_implicit_value for Floating point constants"
Sourabh Singh Tomar [Wed, 19 Aug 2020 19:58:03 +0000 (01:28 +0530)]
Revert "[DebugInfo] Emit DW_OP_implicit_value for Floating point constants"

This reverts commit 15801f16194a3d.
arc's land messed up! It removed the new commit message and took it
from revision.

3 years ago[AArch64][GlobalISel] Handle rtcGPR64RegClassID in AArch64RegisterBankInfo::getRegBan...
Raul Tambre [Wed, 19 Aug 2020 19:50:35 +0000 (12:50 -0700)]
[AArch64][GlobalISel] Handle rtcGPR64RegClassID in AArch64RegisterBankInfo::getRegBankFromRegClass()

TargetRegisterInfo::getMinimalPhysRegClass() returns rtcGPR64RegClassID for X16
and X17, as it's the last matching class. This in turn gets passed to
AArch64RegisterBankInfo::getRegBankFromRegClass(), which hits an unreachable.

It seems sensible to handle this case, so copies from X16 and X17 work.
Copying from X17 is used in inline assembly in libunwind for pointer
authentication.

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

3 years ago[DebugInfo] Emit DW_OP_implicit_value for Floating point constants
Sourabh Singh Tomar [Thu, 23 Jul 2020 01:51:06 +0000 (07:21 +0530)]
[DebugInfo] Emit DW_OP_implicit_value for Floating point constants

llvm is missing support for DW_OP_implicit_value operation.
DW_OP_implicit_value op is indispensable for cases such as
optimized out long double variables.

For intro refer: DWARFv5 Spec Pg: 40 2.6.1.1.4 Implicit Location Descriptions

Consider the following example:
```
int main() {
        long double ld = 3.14;
        printf("dummy\n");
        ld *= ld;
        return 0;
}
```
when compiled with tunk `clang` as
`clang test.c -g -O1` produces following location description
of variable `ld`:
```
DW_AT_location        (0x00000000:
                     [0x0000000000201691, 0x000000000020169b): DW_OP_constu 0xc8f5c28f5c28f800, DW_OP_stack_value, DW_OP_piece 0x8, DW_OP_constu 0x4000, DW_OP_stack_value, DW_OP_bit_piece 0x10 0x40, DW_OP_stack_value)
                  DW_AT_name    ("ld")
```
Here one may notice that this representation is incorrect(DWARF4
stack could only hold integers(and only up to the size of address)).
Here the variable size itself is `128` bit.
GDB and LLDB confirms this:
```
(gdb) p ld
$1 = <invalid float value>
(lldb) frame variable ld
(long double) ld = <extracting data from value failed>
```

GCC represents/uses DW_OP_implicit_value in these sort of situations.
Based on the discussion with Jakub Jelinek regarding GCC's motivation
for using this, I concluded that DW_OP_implicit_value is most appropriate
in this case.

Link: https://gcc.gnu.org/pipermail/gcc/2020-July/233057.html
GDB seems happy after this patch:(LLDB doesn't have support
for DW_OP_implicit_value)
```
(gdb) p ld
p ld
$1 = 3.14000000000000012434
```

Reviewed By: aprantl

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

3 years ago[lldb] Print the load command that wasn't found in TestSimulatorPlatform
Jonas Devlieghere [Wed, 19 Aug 2020 19:40:53 +0000 (12:40 -0700)]
[lldb] Print the load command that wasn't found in TestSimulatorPlatform

Print which load command we were looking for when the sanity check
fails:

  AssertionError: 0 != 1 : wrong number of load commands for
  LC_VERSION_MIN_MACOSX

3 years ago[PGO][PGSO][LV] Fix loop not vectorized issue under profile guided size opts.
Hiroshi Yamauchi [Tue, 11 Aug 2020 21:10:30 +0000 (14:10 -0700)]
[PGO][PGSO][LV] Fix loop not vectorized issue under profile guided size opts.

D81345 appears to accidentally disables vectorization when explicitly
enabled. As PGSO isn't currently accessible from LoopAccessInfo, revert back to
the vectorization with versioning-for-unit-stride for PGSO.

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

3 years ago[lldb] Code sign binaries with entitlements
Jonas Devlieghere [Wed, 19 Aug 2020 17:19:03 +0000 (10:19 -0700)]
[lldb] Code sign binaries with entitlements

Binaries need to be code signed with entitlements to run on device.

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

3 years ago[CMake] Always mark terminfo as unavailable on Windows
Petr Hosek [Wed, 19 Aug 2020 18:06:19 +0000 (11:06 -0700)]
[CMake] Always mark terminfo as unavailable on Windows

This addresses the issue introduced by D86134.

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

3 years agoGlobalISel: Add TargetLowering member to LegalizerHelper
Matt Arsenault [Fri, 31 Jul 2020 15:41:05 +0000 (11:41 -0400)]
GlobalISel: Add TargetLowering member to LegalizerHelper

3 years ago[lldb] Extend Darwin builder to pass the ARCH_CFLAGS spec to Make.
Jonas Devlieghere [Wed, 19 Aug 2020 01:48:18 +0000 (18:48 -0700)]
[lldb] Extend Darwin builder to pass the ARCH_CFLAGS spec to Make.

Construct the ARCH_CFLAGS in Python rather than in Make by disassembling
the TRIPLE.

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

3 years ago[DSE] Remove dead argument from removePartiallyOverlappedStores (NFC).
Florian Hahn [Wed, 19 Aug 2020 18:32:49 +0000 (19:32 +0100)]
[DSE] Remove dead argument from removePartiallyOverlappedStores (NFC).

The argument is unused and can be removed.

3 years agoAMDGPU: Fix wrong type mangling in intrinsic test
Matt Arsenault [Mon, 17 Aug 2020 12:50:11 +0000 (08:50 -0400)]
AMDGPU: Fix wrong type mangling in intrinsic test

The generic address space used to be 4, but the string here seems to
not matter.

3 years ago[index-while-building] PathIndexer
Jan Korous [Tue, 14 Jul 2020 02:38:58 +0000 (19:38 -0700)]
[index-while-building] PathIndexer

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

3 years agoGlobalISel: Don't check for verifier enforced constraint
Matt Arsenault [Wed, 19 Aug 2020 18:06:17 +0000 (14:06 -0400)]
GlobalISel: Don't check for verifier enforced constraint

Loads are always required to have a single memory operand.

3 years agoAMDGPU/GlobalISel: Remove hack for combines forming illegal extloads
Matt Arsenault [Wed, 19 Aug 2020 17:59:11 +0000 (13:59 -0400)]
AMDGPU/GlobalISel: Remove hack for combines forming illegal extloads

Previously we weren't adding the LegalizerInfo to the post-legalizer
combiner. Since that's fixed, we don't need to try to filter out the
one case that was breaking.

3 years agosanitizer_common: Use void* for madvise first argument on Solaris.
Peter Collingbourne [Tue, 18 Aug 2020 20:06:41 +0000 (13:06 -0700)]
sanitizer_common: Use void* for madvise first argument on Solaris.

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

3 years ago[InstCombine] add tests for shifted xor; NFC
Sanjay Patel [Wed, 19 Aug 2020 16:46:53 +0000 (12:46 -0400)]
[InstCombine] add tests for shifted xor; NFC

3 years agoGlobalISel: Use Register
Matt Arsenault [Wed, 19 Aug 2020 16:10:32 +0000 (12:10 -0400)]
GlobalISel: Use Register

3 years ago[CMake] Fix OCaml build failure because of absolute path in system libs
Petr Hosek [Wed, 19 Aug 2020 17:33:03 +0000 (10:33 -0700)]
[CMake] Fix OCaml build failure because of absolute path in system libs

D85820 introduced a full path in the LLVM_SYSTEM_LIBS property of the
LLVMSupport target, which made the OCaml bindings fail to build, since
they use -l [system_lib] flags for every lib in LLVM_SYSTEM_LIBS, which
cannot work with absolute paths.

This patch solves the issue in a similar vain as ZLIB does it: it adds
the full library path to imported_libs, and adds a stripped down version
without directories, lib prefix and lib suffix to system_libs

In the future we should probably make some changes to LLVM_SYSTEM_LIBS,
since both zlib and ncurses do not necessarily have to be system libs
anymore due to the find_package / find_library bits introduced in
D85820 and D79219.

Patch By: haampie

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

3 years ago[CMake] Don't look for terminfo libs when LLVM_ENABLE_TERMINFO=OFF
Petr Hosek [Wed, 19 Aug 2020 17:30:32 +0000 (10:30 -0700)]
[CMake] Don't look for terminfo libs when LLVM_ENABLE_TERMINFO=OFF

D85820 introduced a bug where LLVM_ENABLE_TERMINFO was set to true when
the library was found, even when the user had set
-DLLVM_ENABLE_TERMINFO=OFF.

Patch By: haampie

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

3 years ago[mlir][VectorToSCF] Fix of broken build - missing link to MLIRLinalgUtils
Jakub Lichman [Wed, 19 Aug 2020 17:28:22 +0000 (17:28 +0000)]
[mlir][VectorToSCF] Fix of broken build - missing link to MLIRLinalgUtils

3 years agoRevert "Revert "[NFC][llvm] Make the contructors of `ElementCount` private.""
Mehdi Amini [Wed, 19 Aug 2020 17:26:36 +0000 (17:26 +0000)]
Revert "Revert "[NFC][llvm] Make the contructors of `ElementCount` private.""

Was reverted because MLIR/Flang builds were broken, these APIs have been
fixed in the meantime.

3 years agoFix flang test after MLIR API changes
Mehdi Amini [Wed, 19 Aug 2020 17:19:49 +0000 (17:19 +0000)]
Fix flang test after MLIR API changes

3 years agoRevert "[NFC][llvm] Make the contructors of `ElementCount` private."
Mehdi Amini [Wed, 19 Aug 2020 17:13:28 +0000 (17:13 +0000)]
Revert "[NFC][llvm] Make the contructors of `ElementCount` private."

This reverts commit 264afb9e6aebc98c353644dd0700bec808501cab.
(and dependent 6b742cc48 and fc53bd610f)

MLIR/Flang are broken.

3 years ago[GlobalISel] Add combine for (x & mask) -> x when (x & mask) == x
Jessica Paquette [Thu, 6 Aug 2020 17:40:46 +0000 (10:40 -0700)]
[GlobalISel] Add combine for (x & mask) -> x when (x & mask) == x

If we have a mask, and a value x, where (x & mask) == x, we can drop the AND
and just use x.

This is about a 0.4% geomean code size improvement on CTMark at -O3 for AArch64.

In AArch64, this is most useful post-legalization. Patterns like this often
show up when legalizing s1s, which must be extended to larger types.

e.g.

```
%cmp:_(s32) = G_ICMP ...
%and:_(s32) = G_AND %cmp, 1
```

Since G_ICMP only produces a single bit, there's no reason to mask it with the
G_AND.

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

3 years ago[Clang] Fix BZ47169, loader_uninitialized on incomplete types
Jon Chesterfield [Wed, 19 Aug 2020 17:11:34 +0000 (18:11 +0100)]
[Clang] Fix BZ47169, loader_uninitialized on incomplete types

[Clang] Fix BZ47169, loader_uninitialized on incomplete types

Reported by @erichkeane. Fix proposed by @erichkeane works, tests included.
Bug introduced in D74361. Crash was on querying a CXXRecordDecl for
hasTrivialDefaultConstructor on an incomplete type. Fixed by calling
RequireCompleteType in the right place.

Reviewed By: erichkeane

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

3 years ago[clang][driver]Add quotation mark in test/fortran.f95 to avoid false positive
Caroline Concatto [Wed, 19 Aug 2020 16:53:29 +0000 (17:53 +0100)]
[clang][driver]Add quotation mark in test/fortran.f95  to avoid false positive

If a folder's name, where the test fortran.f95 is running, has cc1 the test
fails because of  CHECK-ASM-NOT: cc1.
The solution used in this patch is to add quotation mark around cc1 and cc1as
because the driver returns these flags with quotation marks ("")

Reviewed By: DavidTruby, echristo

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

3 years ago[mlir] expose standard attributes to C API
Alex Zinenko [Wed, 19 Aug 2020 16:38:56 +0000 (18:38 +0200)]
[mlir] expose standard attributes to C API

Provide C API for MLIR standard attributes. Since standard attributes live
under lib/IR in core MLIR, place the C APIs in the IR library as well (standard
ops will go in a separate library).

Affine map and integer set attributes are only exposed as placeholder types
with IsA support due to the lack of C APIs for the corresponding types.

Integer and floating point attribute APIs expecting APInt and APFloat are not
exposed pending decision on how to support APInt and APFloat.

Reviewed By: stellaraccident

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

3 years ago[mlir] fix build after llvm made ElementCount constructor private
Alex Zinenko [Wed, 19 Aug 2020 16:46:53 +0000 (18:46 +0200)]
[mlir] fix build after llvm made ElementCount constructor private

The original patch (264afb9e6aebc98c353644dd0700bec808501cab) did not
update subprojects.

3 years ago[lldb] Add getExtraMakeArgs to Builder (NFC)
Jonas Devlieghere [Wed, 19 Aug 2020 16:25:41 +0000 (09:25 -0700)]
[lldb] Add getExtraMakeArgs to Builder (NFC)

Instead of a new method for each variable any subclass might want to
set, have a method getExtraMakeArgs that each subclass can use to return
whatever extra Make arguments it wants.

As per Pavel's suggestion in D85539.

3 years ago[lldb] Fix buildDsym signature in Builder base class
Jonas Devlieghere [Wed, 19 Aug 2020 16:08:40 +0000 (09:08 -0700)]
[lldb] Fix buildDsym signature in Builder base class

The method was missing the optional argument `testname`.

3 years ago[OpenMPOpt][HideMemTransfersLatency] Moving the 'wait' counterpart of __tgt_target_da...
Hamilton Tobon Mosquera [Wed, 19 Aug 2020 16:03:23 +0000 (11:03 -0500)]
[OpenMPOpt][HideMemTransfersLatency] Moving the 'wait' counterpart of __tgt_target_data_begin_mapper

canBeMovedDownwards checks if the "wait" counterpart of __tgt_target_data_begin_mapper can be moved downwards, returning a pointer to the instruction that might require/modify the data transferred, and returning null it the movement is not possible or not worth it. The function splitTargetDataBeginRTC receives that returned instruction and instead of moving the "wait" it creates it at that point.

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

3 years ago[clang] Replace call to private ctor with ElementCount::getScalable (2/2)
Jonas Devlieghere [Wed, 19 Aug 2020 16:39:44 +0000 (09:39 -0700)]
[clang] Replace call to private ctor with ElementCount::getScalable (2/2)

Update the code for D86120 which made the constructors of `ElementCount`
private. Apparently I missed another instance in the macro just below.

3 years ago[docs] Clarify ENABLE_MODULES uses Clang Header Modules.
Florian Hahn [Wed, 19 Aug 2020 16:37:20 +0000 (17:37 +0100)]
[docs] Clarify ENABLE_MODULES uses Clang Header Modules.

Suggested post-commit by @dblaikie, thanks!

3 years ago[clang] Replace call to private ctor with ElementCount::getScalable
Jonas Devlieghere [Wed, 19 Aug 2020 16:34:57 +0000 (09:34 -0700)]
[clang] Replace call to private ctor with ElementCount::getScalable

Update the code for D86120 which made the constructors of `ElementCount`
private.

3 years ago[NFC][llvm] Make the contructors of `ElementCount` private.
Francesco Petrogalli [Mon, 17 Aug 2020 22:48:15 +0000 (22:48 +0000)]
[NFC][llvm] Make the contructors of `ElementCount` private.

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

3 years agoAdd python bindings for Type and IntegerType.
Stella Laurenzo [Wed, 19 Aug 2020 00:23:46 +0000 (17:23 -0700)]
Add python bindings for Type and IntegerType.

* The binding for Type is trivial and should be non-controversial.
* The way that I define the IntegerType should serve as a pattern for what I want to do next.
* I propose defining the rest of the standard types in this fashion and then generalizing for dialect types as necessary.
* Essentially, creating/accessing a concrete Type (vs interacting with the string form) is done by "casting" to the concrete type (i.e. IntegerType can be constructed with a Type and will throw if the cast is illegal).
* This deviates from some of our previous discussions about global objects but I think produces a usable API and we should go this way.

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

3 years ago[InstCombine] avoid 'tmp' names in tests; NFC
Sanjay Patel [Wed, 19 Aug 2020 16:07:28 +0000 (12:07 -0400)]
[InstCombine] avoid 'tmp' names in tests; NFC

They may conflict with update_test_checks.py regexes.

3 years ago[lldb] Move builders under lldbsuite.test as they import lldbtest (NFC)
Jonas Devlieghere [Wed, 19 Aug 2020 16:05:11 +0000 (09:05 -0700)]
[lldb] Move builders under lldbsuite.test as they import lldbtest (NFC)

3 years ago[InstCombine] reduce code duplication; NFC
Sanjay Patel [Wed, 19 Aug 2020 16:04:53 +0000 (12:04 -0400)]
[InstCombine] reduce code duplication; NFC

3 years ago[lldb] Convert builders to use inheritance (NFC)
Jonas Devlieghere [Wed, 19 Aug 2020 15:27:54 +0000 (08:27 -0700)]
[lldb] Convert builders to use inheritance (NFC)

Rather than have different modules for different platforms, use
inheritance so we can have a Builer base class and optional child
classes that override platform specific methods.

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

3 years ago[mlir][VectorToSCF] Bug in TransferRead lowering fixed
Jakub Lichman [Wed, 19 Aug 2020 15:13:19 +0000 (15:13 +0000)]
[mlir][VectorToSCF] Bug in TransferRead lowering fixed

If Memref has rank > 1 this pass emits N-1 loops around
TransferRead op and transforms the op itself to 1D read. Since vectors
must have static shape while memrefs don't the pass emits if condition
to prevent out of bounds accesses in case some memref dimension is smaller
than the corresponding dimension of targeted vector. This logic is fine
but authors forgot to apply `permutation_map` on loops upper bounds and
thus if condition compares induction variable to incorrect loop upper bound
(dimension of the memref) in case `permutation_map` is not identity map.
This commit aims to fix that.

3 years ago[libomptarget][amdgpu] Support building with static rocm libraries
Jon Chesterfield [Wed, 19 Aug 2020 14:44:30 +0000 (15:44 +0100)]
[libomptarget][amdgpu] Support building with static rocm libraries

3 years agoAMDGPU/GlobalISel: Add some bitcast tests
Matt Arsenault [Wed, 19 Aug 2020 14:07:57 +0000 (10:07 -0400)]
AMDGPU/GlobalISel: Add some bitcast tests

3 years ago[NFC] Fix typo in AMDGPU doc
madhur13490 [Wed, 19 Aug 2020 11:18:52 +0000 (11:18 +0000)]
[NFC] Fix typo in AMDGPU doc

Reviewed By: t-tye, arsenm

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

3 years agoAMDGPU/GlobalISel: Add selection tests for pointer constants
Matt Arsenault [Tue, 18 Aug 2020 18:45:05 +0000 (14:45 -0400)]
AMDGPU/GlobalISel: Add selection tests for pointer constants