platform/upstream/llvm.git
6 years agoUpdate test to work on Windows
Paul Robinson [Tue, 10 Jul 2018 15:23:10 +0000 (15:23 +0000)]
Update test to work on Windows

llvm-svn: 336687

6 years agoSimplify. NFC.
Rui Ueyama [Tue, 10 Jul 2018 15:15:56 +0000 (15:15 +0000)]
Simplify. NFC.

llvm-svn: 336686

6 years agoSupport -fdebug-prefix-map for assembler source (pass to cc1as). This
Paul Robinson [Tue, 10 Jul 2018 15:15:24 +0000 (15:15 +0000)]
Support -fdebug-prefix-map for assembler source (pass to cc1as).  This
is useful to omit the debug compilation dir when compiling assembly
files with -g.  Part of PR38050.

Patch by Siddhartha Bagaria!

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

llvm-svn: 336685

6 years ago[InstCombine] safely allow non-commutative binop identity constant folds
Sanjay Patel [Tue, 10 Jul 2018 15:12:31 +0000 (15:12 +0000)]
[InstCombine] safely allow non-commutative binop identity constant folds

This was originally intended with D48893, but as discussed there, we
have to make the folds safe from producing extra poison. This should
give the single binop folds the same capabilities as the existing
folds for 2-binops+shuffle.

LLVM binary opcode review: there are a total of 18 binops. There are 7
commutative binops (add, mul, and, or, xor, fadd, fmul) which we already
fold. We're able to fold 6 more opcodes with this patch (shl, lshr, ashr,
fdiv, udiv, sdiv). There are no folds for srem/urem/frem AFAIK. We don't
bother with sub/fsub with constant operand 1 because those are
canonicalized to add/fadd. 7 + 6 + 3 + 2 = 18.

llvm-svn: 336684

6 years agoAdd CachedHashStringRef::data().
Rui Ueyama [Tue, 10 Jul 2018 15:10:49 +0000 (15:10 +0000)]
Add CachedHashStringRef::data().

This accessor is useful and could be slightly more efficient than
Str.val().data() because you can avoid StringRef instantiation.

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

llvm-svn: 336683

6 years ago[Hexagon] Change .mir testcase to make sure function is not in SSA form
Krzysztof Parzyszek [Tue, 10 Jul 2018 14:49:54 +0000 (14:49 +0000)]
[Hexagon] Change .mir testcase to make sure function is not in SSA form

If a machine function satisfies SSA, the IsSSA property is assumed even
if the pass to be executed runs after existing from SSA. If the pass
output then does not conform to SSA, a verifier error will be flagged
(with expensive checks enabled).

llvm-svn: 336682

6 years agoAMDGPU: Try to fix test again
Matt Arsenault [Tue, 10 Jul 2018 14:47:31 +0000 (14:47 +0000)]
AMDGPU: Try to fix test again

llvm-svn: 336681

6 years agoSupport -fdebug-prefix-map in llvm-mc. This is useful to omit the
Paul Robinson [Tue, 10 Jul 2018 14:41:54 +0000 (14:41 +0000)]
Support -fdebug-prefix-map in llvm-mc.  This is useful to omit the
debug compilation dir when compiling assembly files with -g.
Part of PR38050.

Patch by Siddhartha Bagaria!

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

llvm-svn: 336680

6 years ago[InstCombine] drop poison flags when shuffle mask undef propagates to constant
Sanjay Patel [Tue, 10 Jul 2018 14:27:55 +0000 (14:27 +0000)]
[InstCombine] drop poison flags when shuffle mask undef propagates to constant

llvm-svn: 336679

6 years agoReapply "Make __gcov_flush flush counters for all shared libraries"
Marco Castelluccio [Tue, 10 Jul 2018 14:12:03 +0000 (14:12 +0000)]
Reapply "Make __gcov_flush flush counters for all shared libraries"

This reapplies r336365, after marking tests as failing on various
configurations.

llvm-svn: 336678

6 years ago[AArch64][SVE] Asm: Support for predicated unary operations.
Sander de Smalen [Tue, 10 Jul 2018 14:05:55 +0000 (14:05 +0000)]
[AArch64][SVE] Asm: Support for predicated unary operations.

This patch adds support for the following instructions:
  CLS  (Count Leading Sign bits)
  CLZ  (Count Leading Zeros)
  CNT  (Count non-zero bits)
  CNOT (Logically invert boolean condition in vector)
  NOT  (Bitwise invert vector)
  FABS (Floating-point absolute value)
  FNEG (Floating-point negate)

All operations are predicated and unary, e.g.
  clz  z0.s, p0/m, z1.s

- CLS, CLZ, CNT, CNOT and NOT have variants for 8, 16, 32
  and 64 bit elements.

- FABS and FNEG have variants for 16, 32 and 64 bit elements.

llvm-svn: 336677

6 years agoUpdate test for backend error message change
Matt Arsenault [Tue, 10 Jul 2018 14:03:50 +0000 (14:03 +0000)]
Update test for backend error message change

llvm-svn: 336676

6 years agoReapply "AMDGPU: Force inlining if LDS global address is used"
Matt Arsenault [Tue, 10 Jul 2018 14:03:41 +0000 (14:03 +0000)]
Reapply "AMDGPU: Force inlining if LDS global address is used"

This reverts commit r336623

llvm-svn: 336675

6 years agoRename a variable for consistency. NFC.
Rui Ueyama [Tue, 10 Jul 2018 14:03:39 +0000 (14:03 +0000)]
Rename a variable for consistency. NFC.

llvm-svn: 336674

6 years ago[scudo] Use mkdir -p when creating directories for a test
Filipe Cabecinhas [Tue, 10 Jul 2018 13:59:59 +0000 (13:59 +0000)]
[scudo] Use mkdir -p when creating directories for a test

llvm-svn: 336673

6 years agoReduce memory usage when creating .gdb_index. NFC.
Rui Ueyama [Tue, 10 Jul 2018 13:49:13 +0000 (13:49 +0000)]
Reduce memory usage when creating .gdb_index. NFC.

.gdb_index sections can be very large. When you are compiling
multi-gibibyte executables, they can be larger than 1 GiB. The previous
implementation of .gdb_index seems to consume too much memory.

This patch reduces memory consumption by eliminating temporary objects.
In one experiment, memory consumption of GdbIndexSection class is
reduced from 962 MiB to 228 MiB when creating a .gdb_index of 1350 GiB.

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

llvm-svn: 336672

6 years ago[analyzer] Add option to set maximum symbol complexity threshold
Mikhail R. Gadelha [Tue, 10 Jul 2018 13:46:05 +0000 (13:46 +0000)]
[analyzer] Add option to set maximum symbol complexity threshold

Summary:
This adds an option, max-symbol-complexity, so an user can set the maximum symbol complexity threshold.

Note that the current behaviour is equivalent to max complexity = 0, when taint analysis is not enabled and tests show that in a number of tests, having complexity = 25 yields the same results as complexity = 10000.

This patch was extracted and modified from Dominic Chen's patch, D35450.

Reviewers: george.karpenkov, NoQ, ddcc

Reviewed By: george.karpenkov

Subscribers: xazax.hun, szepet, a.sidorin

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

llvm-svn: 336671

6 years ago[ELF] - Add a test for readCallGraph() code.
George Rimar [Tue, 10 Jul 2018 13:42:21 +0000 (13:42 +0000)]
[ELF] - Add a test for readCallGraph() code.

This is to test the following untested line:
https://github.com/llvm-mirror/lld/blob/master/ELF/Driver.cpp#L643

llvm-svn: 336670

6 years ago[LibFuzzer] Disable MSan test on Darwin which was added by r336619. The MemorySanitiz...
Dan Liew [Tue, 10 Jul 2018 13:35:35 +0000 (13:35 +0000)]
[LibFuzzer] Disable MSan test on Darwin which was added by r336619. The MemorySanitizer is
not supported on Darwin currently and so Clang refuses to compile with
`-fsanitize=memory`.

llvm-svn: 336669

6 years ago[InstCombine] allow more shuffle-binop folds with safe constants
Sanjay Patel [Tue, 10 Jul 2018 13:33:26 +0000 (13:33 +0000)]
[InstCombine] allow more shuffle-binop folds with safe constants

The case with 2 variables is more complicated than the case where
we eliminate the shuffle entirely because a shuffle with an undef
mask element creates an undef result.

I'm not aware of any current analysis/transform that recognizes that
undef propagating to a div/rem/shift, but we have to guard against
the possibility.

llvm-svn: 336668

6 years ago[DebugInfo][LoopVectorize] Preserve DL in induction PHI and Add
Anastasis Grammenos [Tue, 10 Jul 2018 13:29:50 +0000 (13:29 +0000)]
[DebugInfo][LoopVectorize] Preserve DL in induction PHI and Add

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

llvm-svn: 336667

6 years agoRemove BUILD file from google-benchmark
Eric Fiselier [Tue, 10 Jul 2018 13:25:26 +0000 (13:25 +0000)]
Remove BUILD file from google-benchmark

llvm-svn: 336666

6 years ago[libc++] Declare <compare> operators with the proper visibility attribute
Louis Dionne [Tue, 10 Jul 2018 13:21:03 +0000 (13:21 +0000)]
[libc++] Declare <compare> operators with the proper visibility attribute

Summary:
Many operators in <compare> were _defined_ with the proper visibility attribute,
but they were _declared_ without any. This is not a problem until we change the
definition of _LIBCPP_INLINE_VISIBILITY to something that requires the
declaration to be decorated.

I also marked `strong_equality::operator weak_equality()` as
`_LIBCPP_INLINE_VISIBILITY`, since it seems like it had been forgotten.

This came up while trying to get rid of `__attribute__((__always_inline__))`
in favor of `__attribute__((internal_linkage))`.

Reviewers: EricWF, mclow.lists

Subscribers: christof, dexonsmith, llvm-commits

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

llvm-svn: 336665

6 years ago[DAGCombiner] visitREM - call visitSDIVLike/visitUDIVLike directly to avoid recursive...
Simon Pilgrim [Tue, 10 Jul 2018 13:18:16 +0000 (13:18 +0000)]
[DAGCombiner] visitREM - call visitSDIVLike/visitUDIVLike directly to avoid recursive combining.

As suggested by @efriedma on D48975 use the visitSDIVLike/visitUDIVLike functions introduced at rL336656.

llvm-svn: 336664

6 years ago[CMake] Add compiler-rt header files to the list of sources for targets
Dan Liew [Tue, 10 Jul 2018 13:00:17 +0000 (13:00 +0000)]
[CMake] Add compiler-rt header files to the list of sources for targets
when building with an IDE so that header files show up in the UI.
This massively improves the development workflow in IDEs.

To implement this a new function `compiler_rt_process_sources(...)` has
been added that adds header files to the list of sources when the
generator is an IDE. For non-IDE generators (e.g. Ninja/Makefile) no
changes are made to the list of source files.

The function can be passed a list of headers via the
`ADDITIONAL_HEADERS` argument. For each runtime library a list of
explicit header files has been added and passed via
`ADDITIONAL_HEADERS`. For `tsan` and `sanitizer_common` a list of
headers was already present but it was stale and has been updated
to reflect the current state of the source tree.

The original version of this patch used file globbing (`*.{h,inc,def}`)
to find the headers but the approach was changed due to this being a
CMake anti-pattern (if the list of headers changes CMake won't
automatically re-generate if globbing is used).

The LLVM repo contains a similar function named `llvm_process_sources()`
but we don't use it here for several reasons:

* It depends on the `LLVM_ENABLE_OPTION` cache variable which is
  not set in standalone compiler-rt builds.
* We would have to `include(LLVMProcessSources)` which I'd like to
  avoid because it would include a bunch of stuff we don't need.

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

llvm-svn: 336663

6 years ago[Hexagon] Add implicit uses even when untied explicit uses are present
Krzysztof Parzyszek [Tue, 10 Jul 2018 12:57:49 +0000 (12:57 +0000)]
[Hexagon] Add implicit uses even when untied explicit uses are present

An explicit untied use is not sufficient to maintain liveness of a
register redefined in a predicated instruction. For example
  %1 = COPY %0
  ...
  %1 = A2_paddif %2, %1, 1
could become
  $r1 = COPY $r0
  ...
  $r1 = A2_paddif $p0, $r1, 1
and later
  $r1 = COPY $r0                ;; this is not really dead!
  ...
  $r1 = A2_paddif $p0, $r0, 1

llvm-svn: 336662

6 years ago[compiler-rt] Get rid of "%T" expansions
Filipe Cabecinhas [Tue, 10 Jul 2018 12:53:46 +0000 (12:53 +0000)]
[compiler-rt] Get rid of "%T" expansions

Summary:
Original patch by Kuba Mracek

The %T lit expansion expands to a common directory shared between all
the tests in the same directory, which is unexpected and unintuitive,
and more importantly, it's been a source of subtle race conditions and
flaky tests. In https://reviews.llvm.org/D35396, it was agreed that it
would be best to simply ban %T and only keep %t, which is unique to each
test. When a test needs a temporary directory, it can just create one
using mkdir %t.

This patch removes %T in compiler-rt.

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

llvm-svn: 336661

6 years ago[modules] Fix 37878; Autoload subdirectory modulemaps with specific LangOpts
Yuka Takahashi [Tue, 10 Jul 2018 12:17:34 +0000 (12:17 +0000)]
[modules] Fix 37878; Autoload subdirectory modulemaps with specific LangOpts

Summary:
Reproducer and errors:
https://bugs.llvm.org/show_bug.cgi?id=37878

lookupModule was falling back to loadSubdirectoryModuleMaps when it couldn't
find ModuleName in (proper) search paths. This was causing iteration over all
files in the search path subdirectories for example "/usr/include/foobar" in
bugzilla case.

Users don't expect Clang to load modulemaps in subdirectories implicitly, and
also the disk access is not cheap.

if (AllowExtraModuleMapSearch) true with ObjC with @import ModuleName.

Reviewers: rsmith, aprantl, bruno

Subscribers: cfe-commits, teemperor, v.g.vassilev

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

llvm-svn: 336660

6 years ago[LowerSwitch] Fixed faulty PHI nodes
Karl-Johan Karlsson [Tue, 10 Jul 2018 12:06:16 +0000 (12:06 +0000)]
[LowerSwitch] Fixed faulty PHI nodes

Summary:
Fixed two cases of where PHI nodes need to be updated by lowerswitch.

When lowerswitch find out that the switch default branch is not
reachable it remove the old default and replace it with the most
popular block from the cases, but it forget to update the PHI
nodes in the default block.

The PHI nodes also need to be updated when the switch is replaced
with a single branch.

Reviewers: hans, reames, arsenm

Reviewed By: arsenm

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

llvm-svn: 336659

6 years agoFixing builtin __atomic_fetch_min declaration
Omer Paparo Bivas [Tue, 10 Jul 2018 12:04:04 +0000 (12:04 +0000)]
Fixing builtin __atomic_fetch_min declaration

Differential Revision: http://reviews.llvm.org/D49068

llvm-svn: 336658

6 years ago[Support] Harded JSON against invalid UTF-8.
Sam McCall [Tue, 10 Jul 2018 11:51:26 +0000 (11:51 +0000)]
[Support] Harded JSON against invalid UTF-8.

Parsing invalid UTF-8 input is now a parse error.
Creating JSON values from invalid UTF-8 now triggers an assertion, and
(in no-assert builds) substitutes the unicode replacement character.
Strings retrieved from json::Value are always valid UTF-8.

llvm-svn: 336657

6 years ago[DAGCombiner] Split SDIV/UDIV optimization expansions from the rest of the combines...
Simon Pilgrim [Tue, 10 Jul 2018 11:38:00 +0000 (11:38 +0000)]
[DAGCombiner] Split SDIV/UDIV optimization expansions from the rest of the combines. NFCI.

As suggested by @efriedma on D48975, this patch separates the BuildDiv/Pow2 style optimizations from the rest of the visitSDIV/visitUDIV to make it easier to reuse the combines and will allow us to avoid some rather nasty node recursive combining in visitREM.

llvm-svn: 336656

6 years ago[MinGW] Skip adding default win32 api libraries if -lwindowsapp is specified
Martin Storsjo [Tue, 10 Jul 2018 10:46:51 +0000 (10:46 +0000)]
[MinGW] Skip adding default win32 api libraries if -lwindowsapp is specified

In this setup, skip adding all the default windows import libraries,
if linking to windowsapp (which replaces them, when targeting the
windows store/UWP api subset).

With GCC, the same is achieved by using a custom spec file, but
since clang doesn't use spec files, we have to allow other means of
overriding what default libraries to use (without going all the
way to using -nostdlib, which would exclude everything). The same
approach, in detecting certain user specified libraries and omitting
others from the defaults, was already used in SVN r314138.

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

llvm-svn: 336655

6 years ago[MinGW] Treat any -lucrt* as replacing -lmsvcrt
Martin Storsjo [Tue, 10 Jul 2018 10:46:45 +0000 (10:46 +0000)]
[MinGW] Treat any -lucrt* as replacing -lmsvcrt

Since SVN r314138, we check if the user has specified any particular
alternative msvcrt/ucrt version, and skip the default -lmsvcrt
in those cases.

In addition to the existing names checked, we should also treat
a plain -lucrt in the same way, mingw-w64 has now added a separate
import library named libucrt.a, in addition to libucrtbase.a.

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

llvm-svn: 336654

6 years ago[VPlan] Add VPlanTestBase.h with helper class to build VPlan for tests.
Florian Hahn [Tue, 10 Jul 2018 10:45:46 +0000 (10:45 +0000)]
[VPlan] Add VPlanTestBase.h with helper class to build VPlan for tests.

Reviewers: dcaballe, hsaito, rengolin

Reviewed By: dcaballe

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

llvm-svn: 336653

6 years ago[COFF] Store import symbol pointers as pointers to the base class
Martin Storsjo [Tue, 10 Jul 2018 10:40:11 +0000 (10:40 +0000)]
[COFF] Store import symbol pointers as pointers to the base class

Future symbol insertions can potentially change the type of these
symbols - keep pointers to the base class to reflect this, and
use dynamic casts to inspect them before using as the subclass
type.

This fixes crashes that were possible before, by touching these
symbols that now are populated as e.g. a DefinedRegular, via
the old pointers with DefinedImportThunk type.

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

llvm-svn: 336652

6 years ago[ELF] - Improve call graph pasing error reporting.
George Rimar [Tue, 10 Jul 2018 10:28:55 +0000 (10:28 +0000)]
[ELF] - Improve call graph pasing error reporting.

This adds a file name to the error message,
adds a missing test case and refactors code a bit.

llvm-svn: 336651

6 years ago[ELF] - Report call graph profile file names in error messages.
George Rimar [Tue, 10 Jul 2018 10:16:48 +0000 (10:16 +0000)]
[ELF] - Report call graph profile file names in error messages.

We did not report file names for some reason.

llvm-svn: 336650

6 years agoFix MSVC "signed/unsigned mismatch" warning. NFCI.
Simon Pilgrim [Tue, 10 Jul 2018 09:46:57 +0000 (09:46 +0000)]
Fix MSVC "signed/unsigned mismatch" warning. NFCI.

llvm-svn: 336649

6 years ago[XRay][compiler-rt] Fixup build breakage
Dean Michael Berris [Tue, 10 Jul 2018 08:58:12 +0000 (08:58 +0000)]
[XRay][compiler-rt] Fixup build breakage

Changes:

- Remove static assertion on size of a structure, fails on systems where
  pointers aren't 8 bytes.

- Use size_t instead of deducing type of arguments to
  `nearest_boundary`.

Follow-up to D48653.

llvm-svn: 336648

6 years ago[PM/Unswitch] Fix unused variable in r336646.
Chandler Carruth [Tue, 10 Jul 2018 08:57:04 +0000 (08:57 +0000)]
[PM/Unswitch] Fix unused variable in r336646.

llvm-svn: 336647

6 years ago[PM/Unswitch] Fix a collection of closely related issues with trivial
Chandler Carruth [Tue, 10 Jul 2018 08:36:05 +0000 (08:36 +0000)]
[PM/Unswitch] Fix a collection of closely related issues with trivial
switch unswitching.

The core problem was that the way we handled unswitching trivial exit
edges through the default successor of a switch. For some reason
I thought the right way to do this was to add a block containing
unreachable and point the default successor at this block. In
retrospect, this has an amazing number of problems.

The first issue is the one that this pass has always worked around -- we
have to *detect* such edges and avoid unswitching them again. This
seemed pretty easy really. You juts look for an edge to a block
containing unreachable. However, this pattern is woefully unsound. So
many things can break it. The amazing thing is that I found a test case
where *simple-loop-unswitch itself* breaks this! When we do
a *non-trivial* unswitch of a switch we will end up splitting this exit
edge. The result will be a default successor that is an exit and
terminates in ... a perfectly normal branch. So the first test case that
I started trying to fix is added to the nontrivial test cases. This is
a ridiculous example that did just amazing things previously. With just
unswitch, it would create 10+ copies of this stuff stamped out. But if
you combine it *just right* with a bunch of other passes (like
simplify-cfg, loop rotate, and some LICM) you can get it to do this
infinitely. Or at least, I never got it to finish. =[

This, in turn, uncovered another related issue. When we are manipulating
these switches after doing a trivial unswitch we never correctly updated
PHI nodes to reflect our edits. As soon as I started changing how these
edges were managed, it became obvious there were more issues that
I couldn't realistically leave unaddressed, so I wrote more test cases
around PHI updates here and ensured all of that works now.

And this, in turn, required some adjustment to how we collect and manage
the exit successor when it is the default successor. That showed a clear
bug where we failed to include it in our search for the outer-most loop
reached by an unswitched exit edge. This was actually already tested and
the test case didn't work. I (wrongly) thought that was due to SCEV
failing to analyze the switch. In fact, it was just a simple bug in the
code that skipped the default successor. While changing this, I handled
it correctly and have updated the test to reflect that we now get
precise SCEV analysis of trip counts for the outer loop in one of these
cases.

llvm-svn: 336646

6 years ago[X86] Fast-isel tests for lowered truncation intrinsics
Mikhail Dvoretckii [Tue, 10 Jul 2018 08:26:54 +0000 (08:26 +0000)]
[X86] Fast-isel tests for lowered truncation intrinsics

This patch adds fast-isel tests for the IR patterns produced for truncation
intrinsics in rC336643.

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

llvm-svn: 336645

6 years ago[XRay][compiler-rt] xray::Array Freelist and Iterator Updates
Dean Michael Berris [Tue, 10 Jul 2018 08:25:44 +0000 (08:25 +0000)]
[XRay][compiler-rt] xray::Array Freelist and Iterator Updates

Summary:
We found a bug while working on a benchmark for the profiling mode which
manifests as a segmentation fault in the profiling handler's
implementation. This change adds unit tests which replicate the
issues in isolation.

We've tracked this down as a bug in the implementation of the Freelist
in the `xray::Array` type. This happens when we trim the array by a
number of elements, where we've been incorrectly assigning pointers for
the links in the freelist of chunk nodes. We've taken the chance to add
more debug-only assertions to the code path and allow us to verify these
assumptions in debug builds.

In the process, we also took the opportunity to use iterators to
implement both `front()` and `back()` which exposes a bug in the
iterator decrement operation.  In particular, when we decrement past a
chunk size boundary, we end up moving too far back and reaching the
`SentinelChunk` prematurely.

This change unblocks us to allow for contributing the non-crashing
version of the benchmarks in the test-suite as well.

Reviewers: kpw

Subscribers: mgorny, llvm-commits

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

llvm-svn: 336644

6 years ago[X86] Lowering integer truncation intrinsics to native IR
Mikhail Dvoretckii [Tue, 10 Jul 2018 08:22:44 +0000 (08:22 +0000)]
[X86] Lowering integer truncation intrinsics to native IR

This patch lowers the _mm[256|512]_cvtepi{64|32|16}_epi{32|16|8} intrinsics to
native IR in cases where the result's length is less than 128 bits.

The resulting IR for 256-bit inputs is folded into VPMOV instructions, while for
128-bit inputs the vpshufb (or, in the 64-to-32-bit case, vinsertps)
instructions are generated instead

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

llvm-svn: 336643

6 years ago[X86][SSE] Prefer BLEND(SHL(v,c1),SHL(v,c2)) over MUL(v, c3)
Simon Pilgrim [Tue, 10 Jul 2018 07:58:33 +0000 (07:58 +0000)]
[X86][SSE] Prefer BLEND(SHL(v,c1),SHL(v,c2)) over MUL(v, c3)

Now that rL336250 has landed, we should prefer 2 immediate shifts + a shuffle blend over performing a multiply. Despite the increase in instructions, this is quicker (especially for slow v4i32 multiplies), avoid loads and constant pool usage. It does mean however that we increase register pressure. The code size will go up a little but by less than what we save on the constant pool data.

This patch also adds support for v16i16 to the BLEND(SHIFT(v,c1),SHIFT(v,c2)) combine, and also prevents blending on pre-SSE41 shifts if it would introduce extra blend masks/constant pool usage.

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

llvm-svn: 336642

6 years ago[X86] Regenerate vector-shuffle-512-v8.ll so the script will merge the 32 and 64...
Craig Topper [Tue, 10 Jul 2018 07:17:41 +0000 (07:17 +0000)]
[X86] Regenerate vector-shuffle-512-v8.ll so the script will merge the 32 and 64 bit checks together. NFC

llvm-svn: 336641

6 years agoTest commit
Stephen Kelly [Tue, 10 Jul 2018 06:55:12 +0000 (06:55 +0000)]
Test commit

Add redundant doc.

llvm-svn: 336640

6 years ago[X86] Use IsProfitableToFold to block vinsertf128rm in favor of insert_subreg instead...
Craig Topper [Tue, 10 Jul 2018 06:19:54 +0000 (06:19 +0000)]
[X86] Use IsProfitableToFold to block vinsertf128rm in favor of insert_subreg instead of artifically increasing pattern complexity to give priority.

This is a much more direct way to solve the issue than just giving extra priority.

llvm-svn: 336639

6 years ago[X86] Remove some seemingly unnecessary patterns.
Craig Topper [Tue, 10 Jul 2018 05:31:42 +0000 (05:31 +0000)]
[X86] Remove some seemingly unnecessary patterns.

We're missing the EVEX equivalents of these patterns and seem to get along fine.

I think we end up with X86vzload for the obvious IR cases that would produce this DAG.

llvm-svn: 336638

6 years ago[X86] Use masked the masked scalar fma builtins to implement the default rounding...
Craig Topper [Tue, 10 Jul 2018 04:38:29 +0000 (04:38 +0000)]
[X86] Use masked the masked scalar fma builtins to implement the default rounding version of the fma intrinsics.

The rounding mode is checked in CGBuiltin.cpp to generate the correct intrinsic call.

Making this switch switchs the masking to use the i8 bitcast to <8 x i1> and extract i1 version of the IR for the mask. Previously we ended up with a scalar 'and' plus an icmp.

llvm-svn: 336637

6 years agoAdd new string benchmarks
Eric Fiselier [Tue, 10 Jul 2018 04:11:22 +0000 (04:11 +0000)]
Add new string benchmarks

llvm-svn: 336636

6 years agoUpdate google-benchark to trunk
Eric Fiselier [Tue, 10 Jul 2018 04:02:00 +0000 (04:02 +0000)]
Update google-benchark to trunk

llvm-svn: 336635

6 years ago[Sema] Fix a structured binding typo correction bug
Erik Pilkington [Tue, 10 Jul 2018 02:15:07 +0000 (02:15 +0000)]
[Sema] Fix a structured binding typo correction bug

BindingDecls have null type until their initializer is processed, so we can't
assume that a correction candidate has non-null type.

rdar://41559582

llvm-svn: 336634

6 years agoAdd lowercase OS name feature
Vlad Tsyrklevich [Tue, 10 Jul 2018 02:02:21 +0000 (02:02 +0000)]
Add lowercase OS name feature

Summary:
Some tests already make use of OS feature names, e.g. 'linux' and 'freebsd',
but they are not actually currently set by lit.

Reviewers: pcc, eugenis

Reviewed By: eugenis

Subscribers: emaste, krytarowski, delcypher, llvm-commits, #sanitizers

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

llvm-svn: 336633

6 years ago[ODRHash] Merge the two function hashes into one.
Richard Trieu [Tue, 10 Jul 2018 01:40:50 +0000 (01:40 +0000)]
[ODRHash] Merge the two function hashes into one.

Functions that are a sub-Decl of a record were hashed differently than other
functions.  This change keeps the AddFunctionDecl function and the hash of
records now calls this function.  In addition, AddFunctionDecl has an option
to perform a hash as if the body was absent, which is required for some
checks after loading modules.  Additional logic prevents multiple error
message from being printed.

llvm-svn: 336632

6 years agoReport an error for an extremely large .gdb_index section.
Rui Ueyama [Tue, 10 Jul 2018 01:22:25 +0000 (01:22 +0000)]
Report an error for an extremely large .gdb_index section.

I believe the only way to test this functionality is to create extremely
large object files and attempt to create a .gdb_index that is greater
than 4 GiB. But I think that's too much for most environments and buildbots,
so I'm commiting this without a test that actually triggers the new
error condition.

llvm-svn: 336631

6 years agoUpdate crash diagnostics test to avoid attempting to write into various
Eric Christopher [Tue, 10 Jul 2018 01:01:38 +0000 (01:01 +0000)]
Update crash diagnostics test to avoid attempting to write into various
directories if possible and to not require %t to have "Output" in the name.

llvm-svn: 336630

6 years agoFix parsing of privacy annotations in os_log format strings.
Akira Hatanaka [Tue, 10 Jul 2018 00:50:25 +0000 (00:50 +0000)]
Fix parsing of privacy annotations in os_log format strings.

Privacy annotations shouldn't have to appear in the first
comma-delimited string in order to be recognized. Also, they should be
ignored if they are preceded or followed by non-whitespace characters.

rdar://problem/40706280

llvm-svn: 336629

6 years ago[X86] Remove custom handling for __builtin_ia32_divss_round_mask and __builtin_ia32_d...
Craig Topper [Tue, 10 Jul 2018 00:50:03 +0000 (00:50 +0000)]
[X86] Remove custom handling for __builtin_ia32_divss_round_mask and __builtin_ia32_divsd_round_mask.

llvm-svn: 336628

6 years ago[X86] Add back GCCBuiltin on mask_div_ss/sd_round.
Craig Topper [Tue, 10 Jul 2018 00:49:50 +0000 (00:49 +0000)]
[X86] Add back GCCBuiltin on mask_div_ss/sd_round.

We no longer need custom handling in clang.

llvm-svn: 336627

6 years ago[X86] Correct vfixupimm load patterns to look for an integer load, not a floating...
Craig Topper [Tue, 10 Jul 2018 00:49:49 +0000 (00:49 +0000)]
[X86] Correct vfixupimm load patterns to look for an integer load, not a floating point load bitcasted to integer.

DAG combine wouldn't let a floating point load bitcasted to integer exist. It would just be an integer load.

llvm-svn: 336626

6 years ago[X86] Add test cases that show failure to fold load into vfixupimm instructions due...
Craig Topper [Tue, 10 Jul 2018 00:49:47 +0000 (00:49 +0000)]
[X86] Add test cases that show failure to fold load into vfixupimm instructions due to bad isel pattern.

llvm-svn: 336625

6 years ago[X86] Remove FloatVT from X86VectorVTInfo in X86InstrAVX512.td
Craig Topper [Tue, 10 Jul 2018 00:49:45 +0000 (00:49 +0000)]
[X86] Remove FloatVT from X86VectorVTInfo in X86InstrAVX512.td

The only places it was used where places where VT was the same as FloatVT. So switch those uses to VT and drop it.

llvm-svn: 336624

6 years agoRevert "AMDGPU: Force inlining if LDS global address is used"
Vlad Tsyrklevich [Tue, 10 Jul 2018 00:46:07 +0000 (00:46 +0000)]
Revert "AMDGPU: Force inlining if LDS global address is used"

This reverts commit r336587, it was causing test failures on the
sanitizer bots.

llvm-svn: 336623

6 years ago[X86] Add __builtin_ia32_selectss_128 and __builtin_ia32_selectsd_128 that is suitabl...
Craig Topper [Tue, 10 Jul 2018 00:37:25 +0000 (00:37 +0000)]
[X86] Add __builtin_ia32_selectss_128 and __builtin_ia32_selectsd_128 that is suitable for use in scalar mask intrinsics.

This will convert the i8 mask argument to <8 x i1> and extract an i1 and then emit a select instruction. This replaces the '(__U & 1)" and ternary operator used in some of intrinsics. The old sequence was lowered to a scalar and and compare. The new sequence uses an i1 vector that will interoperate better with other mask intrinsics.

This removes the need to handle div_ss/sd specially in CGBuiltin.cpp. A follow up patch will add the GCCBuiltin name back in llvm and remove the custom handling.

I made some adjustments to legacy move_ss/sd intrinsics which we reused here to do a simpler extract and insert instead of 2 extracts and two inserts or a shuffle.

llvm-svn: 336622

6 years ago[DWARF][NFC] Refactor range list emission to use a static helper
Wolfgang Pieb [Tue, 10 Jul 2018 00:10:11 +0000 (00:10 +0000)]
[DWARF][NFC] Refactor range list emission to use a static helper

This is prep for DWARF v5 range list emission. Emission of a single range list is moved
to a static helper function.

Reviewer: jdevlieghere

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

llvm-svn: 336621

6 years agoFix a bug for packed relocations.
Rui Ueyama [Mon, 9 Jul 2018 23:54:24 +0000 (23:54 +0000)]
Fix a bug for packed relocations.

Previously, we didn't create multiple consecutive bitmaps.
Added a test to catch this bug too.

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

llvm-svn: 336620

6 years ago[libFuzzer] Make -fsanitize=memory,fuzzer work.
Matt Morehouse [Mon, 9 Jul 2018 23:51:08 +0000 (23:51 +0000)]
[libFuzzer] Make -fsanitize=memory,fuzzer work.

This patch allows libFuzzer to fuzz applications instrumented with MSan
without recompiling libFuzzer with MSan instrumentation.

Fixes https://github.com/google/sanitizers/issues/958.

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

llvm-svn: 336619

6 years ago[test] two small cleanups:
Casey Carter [Mon, 9 Jul 2018 23:45:09 +0000 (23:45 +0000)]
[test] two small cleanups:

* Remove unused type from is_assignable.pass.cpp

* Don't specialize `common_type<::X<float>>` in common_type.pass.cpp, which violates the requirements of [meta.trans.other]/5

llvm-svn: 336618

6 years ago[InstCombine] allow more shuffle folds using safe constants
Sanjay Patel [Mon, 9 Jul 2018 23:22:47 +0000 (23:22 +0000)]
[InstCombine] allow more shuffle folds using safe constants

getSafeVectorConstantForBinop() was calling getBinOpIdentity() assuming
that the constant we wanted was operand 1 (RHS). That's wrong, but I
don't think we could expose a bug or even a suboptimal fold from that
because the callers have other guards for any binop that would have
been affected.

llvm-svn: 336617

6 years agoRevert "[libFuzzer] Mutation tracking and logging implemented"
Matt Morehouse [Mon, 9 Jul 2018 22:31:26 +0000 (22:31 +0000)]
Revert "[libFuzzer] Mutation tracking and logging implemented"

This reverts r336597 due to bot breakage.

llvm-svn: 336616

6 years ago[WebAssembly] Support for binary atomic RMW instructions
Heejin Ahn [Mon, 9 Jul 2018 22:30:51 +0000 (22:30 +0000)]
[WebAssembly] Support for binary atomic RMW instructions

Summary:
This adds support for binary atomic read-modify-write instructions:
add, sub, and, or, xor, and xchg.

This does not yet support translations of some of LLVM IR atomicrmw
instructions (nand, max, min, umax, and umin) that do not have a direct
counterpart in wasm instructions.

Reviewers: dschuff

Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits

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

llvm-svn: 336615

6 years agoSimplify RelrSection<ELFT>::updateAllocSize.
Rui Ueyama [Mon, 9 Jul 2018 22:29:57 +0000 (22:29 +0000)]
Simplify RelrSection<ELFT>::updateAllocSize.

This patch also speeds it up by making some constants compile-time
constants. Other than that, NFC.

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

llvm-svn: 336614

6 years agollvm: Add support for "-fno-delete-null-pointer-checks"
Manoj Gupta [Mon, 9 Jul 2018 22:27:23 +0000 (22:27 +0000)]
llvm: Add support for "-fno-delete-null-pointer-checks"

Summary:
Support for this option is needed for building Linux kernel.
This is a very frequently requested feature by kernel developers.

More details : https://lkml.org/lkml/2018/4/4/601

GCC option description for -fdelete-null-pointer-checks:
This Assume that programs cannot safely dereference null pointers,
and that no code or data element resides at address zero.

-fno-delete-null-pointer-checks is the inverse of this implying that
null pointer dereferencing is not undefined.

This feature is implemented in LLVM IR in this CL as the function attribute
"null-pointer-is-valid"="true" in IR (Under review at D47894).
The CL updates several passes that assumed null pointer dereferencing is
undefined to not optimize when the "null-pointer-is-valid"="true"
attribute is present.

Reviewers: t.p.northover, efriedma, jyknight, chandlerc, rnk, srhines, void, george.burgess.iv

Reviewed By: efriedma, george.burgess.iv

Subscribers: eraman, haicheng, george.burgess.iv, drinkcat, theraven, reames, sanjoy, xbolva00, llvm-commits

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

llvm-svn: 336613

6 years agoUse StringRef instead of `const char *`.
Rui Ueyama [Mon, 9 Jul 2018 22:26:49 +0000 (22:26 +0000)]
Use StringRef instead of `const char *`.

I don't think there's a need to use `const char *`. In most (probably all?)
cases, we need a length of a name later, so discarding a length will
lead to a wasted effort.

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

llvm-svn: 336612

6 years agoMake llvm.objectsize more conservative with null
George Burgess IV [Mon, 9 Jul 2018 22:21:16 +0000 (22:21 +0000)]
Make llvm.objectsize more conservative with null

In non-zero address spaces, we were reporting that an object at `null`
always occupies zero bytes. This is incorrect in many cases, so just
return `unknown` in those cases for now.

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

llvm-svn: 336611

6 years agoRename function calls missed in r336605
Richard Trieu [Mon, 9 Jul 2018 22:09:33 +0000 (22:09 +0000)]
Rename function calls missed in r336605

NextIsLatest -> isFirst

llvm-svn: 336610

6 years agoFix direct calls to __wrap_sym when it is relocated.
Rui Ueyama [Mon, 9 Jul 2018 22:03:05 +0000 (22:03 +0000)]
Fix direct calls to __wrap_sym when it is relocated.

Patch by Matthew Koontz!

Before, direct calls to __wrap_sym would not map to valid PLT entries,
so they would crash at runtime. This change maps such calls to the same
PLT entry as calls to sym that are then wrapped.

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

llvm-svn: 336609

6 years agoRollback [test-suite] Add a decorator for the lack of libstdcxx on the system.
Davide Italiano [Mon, 9 Jul 2018 21:56:28 +0000 (21:56 +0000)]
Rollback [test-suite] Add a decorator for the lack of libstdcxx on the system.

Pavel suggested an alternative approach that I'll try to implement.

llvm-svn: 336608

6 years ago[ObjCRuntime] Add support for obfuscation in tagged pointers.
Davide Italiano [Mon, 9 Jul 2018 21:53:43 +0000 (21:53 +0000)]
[ObjCRuntime] Add support for obfuscation in tagged pointers.

This is the default in MacOS Mojave. No testcases, as basically
we have a lot of coverage (and the testsuite fails quite a bit
without this change in Beta 3).

Thanks to Fred Riss for helping me with this patch (fixing
bugs/nondeterminism).

<rdar://problem/38305553>

llvm-svn: 336607

6 years ago[Index] Add index::IndexingOptions::IndexImplicitInstantiation
Fangrui Song [Mon, 9 Jul 2018 21:49:06 +0000 (21:49 +0000)]
[Index] Add index::IndexingOptions::IndexImplicitInstantiation

Summary:
With IndexImplicitInstantiation=true, the following case records an occurrence of B::bar in A::foo, which will benefit cross reference tools.

template <class T> struct B { void bar() {}};
template <class T> struct A { void foo(B<T> *x) { x->bar(); }};
int main() { A<int> a; a.foo(0); }

Reviewers: akyrtzi, arphaman, rsmith

Subscribers: cfe-commits

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

llvm-svn: 336606

6 years ago[AST] Rename some Redeclarable functions to reduce confusion
Fangrui Song [Mon, 9 Jul 2018 21:31:20 +0000 (21:31 +0000)]
[AST] Rename some Redeclarable functions to reduce confusion

Reviewers: rsmith, akyrtzi

Subscribers: cfe-commits

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

llvm-svn: 336605

6 years agoAdded -fcrash-diagnostics-dir flag
Bob Haarman [Mon, 9 Jul 2018 21:07:20 +0000 (21:07 +0000)]
Added -fcrash-diagnostics-dir flag

Summary:
New flag causes crash reports to be written in the specified directory
rather than the temp directory.

Patch by Chijioke Kamanu.

Reviewers: hans, inglorion, rnk

Reviewed By: hans

Subscribers: zturner, hiraditya, llvm-commits, cfe-commits

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

llvm-svn: 336604

6 years ago[ORC] Rename MaterializationResponsibility::delegate to replace and add a new
Lang Hames [Mon, 9 Jul 2018 20:54:36 +0000 (20:54 +0000)]
[ORC] Rename MaterializationResponsibility::delegate to replace and add a new
delegate method (and unit test).

The name 'replace' better captures what the old delegate method did: it
returned materialization responsibility for a set of symbols to the VSO.

The new delegate method delegates responsibility for a set of symbols to a new
MaterializationResponsibility instance. This can be used to split responsibility
between multiple threads, or multiple materialization methods.

llvm-svn: 336603

6 years agoFix line endings. NFCI.
Simon Pilgrim [Mon, 9 Jul 2018 20:52:07 +0000 (20:52 +0000)]
Fix line endings. NFCI.

llvm-svn: 336602

6 years ago[Power9] Add __float128 builtins for Rounding Operations
Stefan Pintilie [Mon, 9 Jul 2018 20:38:40 +0000 (20:38 +0000)]
[Power9] Add __float128 builtins for Rounding Operations

Added __float128 support for a number of rounding operations:

trunc
rint
nearbyint
round
floor
ceil

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

llvm-svn: 336601

6 years ago[Docs] Fix generation of manpages.
Michael Kruse [Mon, 9 Jul 2018 20:26:11 +0000 (20:26 +0000)]
[Docs] Fix generation of manpages.

Fix the following error when Sphinx generates the Polly manpage:

    Warning, treated as error:
    docs/Performance.rst:: WARNING: "table cell spanning" not supported

llvm-svn: 336600

6 years agoFactor out code to parse -pack-dyn-relocs. NFC.
Rui Ueyama [Mon, 9 Jul 2018 20:22:28 +0000 (20:22 +0000)]
Factor out code to parse -pack-dyn-relocs. NFC.

llvm-svn: 336599

6 years ago[WebAssembly] Improve readability of load/stores and tests. NFC.
Heejin Ahn [Mon, 9 Jul 2018 20:18:21 +0000 (20:18 +0000)]
[WebAssembly] Improve readability of load/stores and tests. NFC.

Summary:
- Changed variable/function names to be more consistent
- Improved comments in test files
- Added more tests
- Fixed a few typos
- Misc. cosmetic changes

Reviewers: dschuff

Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits

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

llvm-svn: 336598

6 years ago[libFuzzer] Mutation tracking and logging implemented
Matt Morehouse [Mon, 9 Jul 2018 20:17:52 +0000 (20:17 +0000)]
[libFuzzer] Mutation tracking and logging implemented

Code now exists to track number of mutations that are used in fuzzing in
total and ones that produce new coverage. The stats are currently being
dumped to the command line.

Patch By: Kode Williams

Differntial Revision: https://reviews.llvm.org/D48054

llvm-svn: 336597

6 years ago[Power9] [CLANG] Add __float128 support for trunc to double round to odd
Stefan Pintilie [Mon, 9 Jul 2018 20:09:52 +0000 (20:09 +0000)]
[Power9] [CLANG] Add __float128 support for trunc to double round to odd

Add support for this builtin:
double builtin_truncf128_round_to_odd(float128)

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

llvm-svn: 336596

6 years ago[Power9] [LLVM] Add __float128 support for trunc to double round to odd
Stefan Pintilie [Mon, 9 Jul 2018 20:09:22 +0000 (20:09 +0000)]
[Power9] [LLVM] Add __float128 support for trunc to double round to odd

Add support for this builtin:
double builtin_truncf128_round_to_odd(float128)

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

llvm-svn: 336595

6 years agolld: add experimental support for SHT_RELR sections.
Rui Ueyama [Mon, 9 Jul 2018 20:08:55 +0000 (20:08 +0000)]
lld: add experimental support for SHT_RELR sections.

Patch by Rahul Chaudhry!

This change adds experimental support for SHT_RELR sections, proposed
here: https://groups.google.com/forum/#!topic/generic-abi/bX460iggiKg

Pass '--pack-dyn-relocs=relr' to enable generation of SHT_RELR section
and DT_RELR, DT_RELRSZ, and DT_RELRENT dynamic tags.

Definitions for the new ELF section type and dynamic array tags, as well
as the encoding used in the new section are all under discussion and are
subject to change. Use with caution!

Pass '--use-android-relr-tags' with '--pack-dyn-relocs=relr' to use
SHT_ANDROID_RELR section type instead of SHT_RELR, as well as
DT_ANDROID_RELR* dynamic tags instead of DT_RELR*. The generated
section contents are identical.

'--pack-dyn-relocs=android+relr --use-android-relr-tags' enables both
'--pack-dyn-relocs=android' and '--pack-dyn-relocs=relr': lld will
encode the relative relocations in a SHT_ANDROID_RELR section, and pack
the rest of the dynamic relocations in a SHT_ANDROID_REL(A) section.

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

llvm-svn: 336594

6 years agoRenameIndependentSubregs: Fix handling of undef tied operands
Mark Searles [Mon, 9 Jul 2018 20:07:03 +0000 (20:07 +0000)]
RenameIndependentSubregs: Fix handling of undef tied operands

Ensure that, if updating a tied operand pair, to only update
that pair.

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

llvm-svn: 336593

6 years ago[OPENMP] Do not mark local variables as declare target.
Alexey Bataev [Mon, 9 Jul 2018 19:58:08 +0000 (19:58 +0000)]
[OPENMP] Do not mark local variables as declare target.

When the parsing of the functions happens inside of the declare target
region, we may erroneously mark local variables as declare target
thought they are not. This attribute can be applied only to global
variables.

llvm-svn: 336592

6 years ago[libclang] NFC, simplify clang_Cursor_Evaluate
Alex Lorenz [Mon, 9 Jul 2018 19:56:45 +0000 (19:56 +0000)]
[libclang] NFC, simplify clang_Cursor_Evaluate

Take advantage of early returns as suggested by Duncan in
https://reviews.llvm.org/D49051

llvm-svn: 336591

6 years ago[libclang] evalute compound statement cursors before trying to evaluate
Alex Lorenz [Mon, 9 Jul 2018 19:41:28 +0000 (19:41 +0000)]
[libclang] evalute compound statement cursors before trying to evaluate
the cursor like a declaration

This change fixes a bug in libclang in which it tries to evaluate a statement
cursor as a declaration cursor, because that statement still has a pointer to
the declaration parent.

rdar://38888477

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

llvm-svn: 336590

6 years ago[globalisel][irtranslator] Add support for atomicrmw and (strong) cmpxchg
Daniel Sanders [Mon, 9 Jul 2018 19:33:40 +0000 (19:33 +0000)]
[globalisel][irtranslator] Add support for atomicrmw and (strong) cmpxchg

Summary:
This patch adds support for the atomicrmw instructions and the strong
cmpxchg instruction to the IRTranslator.

I've left out weak cmpxchg because LangRef.rst isn't entirely clear on what
difference it makes to the backend. As far as I can tell from the code, it
only matters to AtomicExpandPass which is run at the LLVM-IR level.

Reviewers: ab, t.p.northover, qcolombet, rovka, aditya_nandakumar, volkan, javed.absar

Reviewed By: qcolombet

Subscribers: kristof.beyls, javed.absar, igorb, llvm-commits

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

llvm-svn: 336589

6 years ago[AMDGPU][Waitcnt] fix "comparison of integers of different signs" build error
Mark Searles [Mon, 9 Jul 2018 19:28:14 +0000 (19:28 +0000)]
[AMDGPU][Waitcnt] fix "comparison of integers of different signs" build error

Build error on Android; reported by and fix provided by (thanks) by Mauro Rossi <issor.oruam@gmail.com>

Fixes the following building error:

external/llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp:1903:61:
error: comparison of integers of different signs:
'typename iterator_traits<__wrap_iter<MachineBasicBlock **> >::difference_type'
(aka 'int') and 'unsigned int' [-Werror,-Wsign-compare]
                      BlockWaitcntProcessedSet.end(), &MBB) < Count)) {
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~
1 error generated.

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

llvm-svn: 336588