platform/upstream/llvm.git
5 years ago[OpenMP] Fix for nested proc_bind affinity bug
Jonathan Peyton [Tue, 15 Jan 2019 19:39:32 +0000 (19:39 +0000)]
[OpenMP] Fix for nested proc_bind affinity bug

Using proc_bind clause on a nested #pragma omp parallel region
with KMP_AFFINITY set causes an assertion error. This assertion occurs because
the place-partition-var is not properly initialized in the nested master threads.
Trying to get an intuitive result with KMP_AFFINITY + proc_bind is difficult
because of how the KMP_AFFINITY gtid-to-place mapping occurs. This
patch creates an initial place list no matter what affinity mechanism is used.
For KMP_AFFINITY, the place-partition-var is initialized to all the places.

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

llvm-svn: 351227

5 years agoFix size_t/off_t mixup in std::filesystem.
Dan Albert [Tue, 15 Jan 2019 19:16:25 +0000 (19:16 +0000)]
Fix size_t/off_t mixup in std::filesystem.

Summary: ftruncate takes an off_t, not a size_t.

Reviewers: EricWF, mclow.lists

Reviewed By: EricWF

Subscribers: christof, ldionne, libcxx-commits

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

llvm-svn: 351226

5 years agoAdd large file support to create_file for 32-bit.
Dan Albert [Tue, 15 Jan 2019 19:14:15 +0000 (19:14 +0000)]
Add large file support to create_file for 32-bit.

Summary:
The tests need to create files larger than 2GB, but size_t is 32-bit
on a 32-bit system. Make use of explicit off64_t APIs so we can still
use a default off_t for the tests while enabling 64-bit file offsets
for create_file.

Reviewers: mclow.lists, EricWF

Reviewed By: EricWF

Subscribers: christof, ldionne, libcxx-commits

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

llvm-svn: 351225

5 years ago[OpenMP] Add lock function definitions to fix Bug 40042
Jonathan Peyton [Tue, 15 Jan 2019 19:14:00 +0000 (19:14 +0000)]
[OpenMP] Add lock function definitions to fix Bug 40042

This change fixes the sanity issue reported in Bug 40042.
Lock function definitions for the three lock kinds were added
to disambiguate calls to the lock functions done directly and indirectly.

Bugzilla: https://bugs.llvm.org/show_bug.cgi?id=40042
Patch by Hansang Bae

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

llvm-svn: 351224

5 years ago[OpenMP][Cmake] Allowed OpenMP testing detect test compiler with same generator
Jonathan Peyton [Tue, 15 Jan 2019 19:08:26 +0000 (19:08 +0000)]
[OpenMP][Cmake] Allowed OpenMP testing detect test compiler with same generator

Fix ninja build detect test compiler failed under windows.

Patch by Peiyuan Song

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

llvm-svn: 351223

5 years ago[Tooling] Make clang-tool find libc++ dir on mac when running on a file without compi...
Haojian Wu [Tue, 15 Jan 2019 19:05:50 +0000 (19:05 +0000)]
[Tooling] Make clang-tool find libc++ dir on mac when running on a file without compilation database.

Summary:
This is a regression of r348365.

When clang-tools run on a file without a complation database (`clang-check /tmp/t.cc`),
we will use fixed compilation database as a fallback. However the actual compiler
path in the fallback complation command is just `clang-tool` which is
insufficient to detect the libc++ dir.

Reviewers: ilya-biryukov, EricWF

Reviewed By: ilya-biryukov

Subscribers: cfe-commits

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

llvm-svn: 351222

5 years ago[OpenMP] Fix performance regression in SPEC kdtree test
Jonathan Peyton [Tue, 15 Jan 2019 18:57:24 +0000 (18:57 +0000)]
[OpenMP] Fix performance regression in SPEC kdtree test

Make __ompt_implicit_task_end a static function and remove the inline part.  Remove
pId variable that is unused.  This fixes small regression in SPEC kdtree benchmark.
Also reformat some of __ompt_implicit_task_end.

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

llvm-svn: 351221

5 years ago[libc++] Support different libc++ namespaces in the iterator test
Petr Hosek [Tue, 15 Jan 2019 18:55:55 +0000 (18:55 +0000)]
[libc++] Support different libc++ namespaces in the iterator test

libc++ allows changing the namespace, don't assume __1 in the test
to avoid the test failure if different namespace is being used.

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

llvm-svn: 351220

5 years agoReapply "[CodeGen][X86] Expand USUBSAT to UMAX+SUB, also for vectors"
Nikita Popov [Tue, 15 Jan 2019 18:43:41 +0000 (18:43 +0000)]
Reapply "[CodeGen][X86] Expand USUBSAT to UMAX+SUB, also for vectors"

Related to https://bugs.llvm.org/show_bug.cgi?id=40123.

Rather than scalarizing, expand a vector USUBSAT into UMAX+SUB,
which produces much better code for X86.

Reapplying with updated SLPVectorizer tests.

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

llvm-svn: 351219

5 years agoDo not emit a corrupt symbol table entry for .rela_iplt_{start,end}.
Rui Ueyama [Tue, 15 Jan 2019 18:30:23 +0000 (18:30 +0000)]
Do not emit a corrupt symbol table entry for .rela_iplt_{start,end}.

If .rela.iplt does not exist, we used to emit a corrupt symbol table
that contains two symbols, .rela_iplt_{start,end}, pointing to a
nonexisting section.

This patch fixes the issue by setting section index 0 to the symbols
if .rel.iplt section does not exist.

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

llvm-svn: 351218

5 years ago[Solaris] Move enabling IAS for SPARC from the Solaris toolchain to Generic_GCC.
Brad Smith [Tue, 15 Jan 2019 18:24:03 +0000 (18:24 +0000)]
[Solaris] Move enabling IAS for SPARC from the Solaris toolchain to Generic_GCC.

llvm-svn: 351217

5 years ago[WebAssembly] Fix updating/moving DBG_VALUEs in RegStackify
Yury Delendik [Tue, 15 Jan 2019 18:14:12 +0000 (18:14 +0000)]
[WebAssembly] Fix updating/moving DBG_VALUEs in RegStackify

Summary:
As described in PR40209, there can be issues in DBG_VALUEs handling when multiple defs present in a BB. This patch
adds logic for detection of related to def DBG_VALUEs and localizes register update and movement to found DBG_VALUEs.

Reviewers: aheejin

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

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

llvm-svn: 351216

5 years agoSilence compiler warnings
Adrian Prantl [Tue, 15 Jan 2019 18:07:54 +0000 (18:07 +0000)]
Silence compiler warnings

llvm-svn: 351215

5 years agoMake CompilerType::getBitSize() / getByteSize() return an optional result. NFC
Adrian Prantl [Tue, 15 Jan 2019 18:07:52 +0000 (18:07 +0000)]
Make CompilerType::getBitSize() / getByteSize() return an optional result. NFC

The code in LLDB assumes that CompilerType and friends use the size 0
as a sentinel value to signal an error. This works for C++, where no
zero-sized type exists, but in many other programming languages
(including I believe C) types of size zero are possible and even
common. This is a particular pain point in swift-lldb, where extra
code exists to double-check that a type is *really* of size zero and
not an error at various locations.

To remedy this situation, this patch starts by converting
CompilerType::getBitSize() and getByteSize() to return an optional
result. To avoid wasting space, I hand-rolled my own optional data
type assuming that no type is larger than what fits into 63
bits. Follow-up patches would make similar changes to the ValueObject
hierarchy.

rdar://problem/47178964

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

llvm-svn: 351214

5 years ago[WebAssembly] Update release notes
Derek Schuff [Tue, 15 Jan 2019 17:54:42 +0000 (17:54 +0000)]
[WebAssembly] Update release notes

Summary:
Explicitly note that multithreading support is not included in the stable
ABI.

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

llvm-svn: 351213

5 years agoFix cpu-dispatch MV regression caused by r347812
Erich Keane [Tue, 15 Jan 2019 17:51:09 +0000 (17:51 +0000)]
Fix cpu-dispatch MV regression caused by r347812

r347812 permitted forward declarations for cpu-dispatch functions, which
are occassionally useful as exposition in  header files.  However, this inadvertently
permitted this function to become multiversioned after a usage.  This
patch ensures that the "CausesMV" checks are still run in the
forward-declaration case.

Change-Id: Icb6f975a2d068f088b89e3bbe26cf1d24f5a972c
llvm-svn: 351212

5 years agoWe can improve the performance (generally) by memo-izing the action to map a debug...
David Callahan [Tue, 15 Jan 2019 17:45:54 +0000 (17:45 +0000)]
We can improve the performance (generally) by memo-izing the action to map a debug location to its function summary.

Summary:
Here are timings (as reported by "opt -time-passes") for
sample-profile pass for some files holding hot functions from a major
serviceĀ©r. Average 17% reduction. Delta column is 100*(old-new)/old.

```
Old    New    Delta
0.0537 0.0538 -0.2%
0.8155 0.6522 20.0%
0.0779 0.0751  3.6%
0.0727 0.0913 -25.6%
0.1622 0.1302 19.7%
0.0627 0.0594  5.3%
0.0766 0.0744  2.9%
0.6426 0.4387 31.7%
0.3521 0.2776 21.2%
0.3549 0.2721 23.3%
0.0912 0.0904  0.9%
0.1236 0.1059 14.3%
0.0854 0.0866 -1.4%
0.0757 0.0722  4.6%
0.1293 0.1147 11.3%
0.1354 0.1122 17.1%
0.0767 0.0770 -0.4%
0.1135 0.0968 14.7%
0.0524 0.0608 -16.0%
0.1279 0.1106 13.5%
==========
3.6820 3.0520 17.1% Total
```

Reviewers: twoh, Kader, danielcdh, wmi

Reviewed By: wmi

Subscribers: dblaikie, llvm-commits

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

llvm-svn: 351211

5 years agoRevert "[X86] Make _xgetbv/_xsetbv on non-windows platforms"
Benjamin Kramer [Tue, 15 Jan 2019 17:23:36 +0000 (17:23 +0000)]
Revert "[X86] Make _xgetbv/_xsetbv on non-windows platforms"

This reverts commit r351160. Breaks building v8.

llvm-svn: 351210

5 years agoRevert "Correct the source range returned from preprocessor callbacks."
Benjamin Kramer [Tue, 15 Jan 2019 17:20:05 +0000 (17:20 +0000)]
Revert "Correct the source range returned from preprocessor callbacks."

This reverts commit r350891. Also add a test case that would return an
empty string with r350891.

llvm-svn: 351209

5 years agoRevert "Update clang-tools-extra for r350891 from Clang."
Benjamin Kramer [Tue, 15 Jan 2019 17:20:04 +0000 (17:20 +0000)]
Revert "Update clang-tools-extra for r350891 from Clang."

This reverts commit r350892.

llvm-svn: 351208

5 years ago[SelectionDAG] Check membership of register in class for single
Nirav Dave [Tue, 15 Jan 2019 17:09:23 +0000 (17:09 +0000)]
[SelectionDAG] Check membership of register in class for single
register constraints. NFCI.

Now that X86's ST(7) constraints are fixed this check can be
reinstated.

llvm-svn: 351207

5 years ago[X86] Fix register class for assembly constraints to ST(7). NFCI.
Nirav Dave [Tue, 15 Jan 2019 17:09:14 +0000 (17:09 +0000)]
[X86] Fix register class for assembly constraints to ST(7). NFCI.

Modify getRegForInlineAsmConstraint to return special singleton
register class when a constraint references ST(7) not RFP80 for which
ST(7) is not a member.

llvm-svn: 351206

5 years ago[llvm-readelf] Allow single-letter flags to be merged.
Jordan Rupprecht [Tue, 15 Jan 2019 17:04:40 +0000 (17:04 +0000)]
[llvm-readelf] Allow single-letter flags to be merged.

Summary:
This patch adds support for merged arguments (e.g. -SW == -S -W) for llvm-readelf.

No changes are intended for llvm-readobj. There are a few short flags (-sd, -sr, -st, -dt) that would conflict with grouped single letter flags, and having only some grouped flags might be confusing. So, allow merged flags for readelf compatibility, but force separate args for llvm-readobj. From what I can tell, these two-letter flags are only used with llvm-readobj, not llvm-readelf.

This fixes PR40064.

Reviewers: jhenderson, kristina, echristo, phosek

Reviewed By: jhenderson

Subscribers: llvm-commits

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

llvm-svn: 351205

5 years ago[llvm-objcopy] Use SHT_NOTE for added note sections.
Jordan Rupprecht [Tue, 15 Jan 2019 16:57:23 +0000 (16:57 +0000)]
[llvm-objcopy] Use SHT_NOTE for added note sections.

Summary:
Fix llvm-objcopy to add .note sections as SHT_NOTEs. GNU objcopy overrides section flags for special sections. For `.note` sections (with the exception of `.note.GNU-stack`), SHT_NOTE is used.

Many other sections are special cased by libbfd, but `.note` is the only special section I can seem to find being used with objcopy --add-section.

See `.note` in context of the full list of special sections here: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=bfd/elf.c;h=eb3e1828e9c651678b95a1dcbc3b124783d1d2be;hb=HEAD#l2675

Reviewers: jhenderson, alexshap, jakehehrlich, espindola

Reviewed By: jhenderson

Subscribers: emaste, arichardson, llvm-commits

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

llvm-svn: 351204

5 years ago[X86] Bailout of lowerVectorShuffleAsPermuteAndUnpack for shuffle-with-zero (PR40306)
Simon Pilgrim [Tue, 15 Jan 2019 16:56:55 +0000 (16:56 +0000)]
[X86] Bailout of lowerVectorShuffleAsPermuteAndUnpack for shuffle-with-zero (PR40306)

If we're shuffling with a zero vector, then we are better off not doing VECTOR_SHUFFLE(UNPCK()) as we lose track of those zero elements.

We were already doing this for SSSE3 targets as we have PSHUFB, but its worth doing for all targets.

llvm-svn: 351203

5 years agogn build: Don't assume valgrind.h exists on Linux
Hans Wennborg [Tue, 15 Jan 2019 16:51:45 +0000 (16:51 +0000)]
gn build: Don't assume valgrind.h exists on Linux

It didn't on my machine, so defaulting it to off seems better.

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

llvm-svn: 351202

5 years ago[X86] Add PR40318 shuffle test case
Simon Pilgrim [Tue, 15 Jan 2019 16:31:10 +0000 (16:31 +0000)]
[X86] Add PR40318 shuffle test case

The other test case is already covered by the PR40306 test case, which was mainly concerned with SSSE3 codegen.

llvm-svn: 351201

5 years agoRemove irrelevant references to legacy git repositories from
James Y Knight [Tue, 15 Jan 2019 16:18:52 +0000 (16:18 +0000)]
Remove irrelevant references to legacy git repositories from
compiler identification lines in test-cases.

(Doing so only because it's then easier to search for references which
are actually important and need fixing.)

llvm-svn: 351200

5 years ago[SLP][X86] Split prefer-256-bit 'AVX256BW' tests from AVX2 checks
Simon Pilgrim [Tue, 15 Jan 2019 16:13:37 +0000 (16:13 +0000)]
[SLP][X86] Split prefer-256-bit 'AVX256BW' tests from AVX2 checks

Fixes SLP test issue with D56636

llvm-svn: 351199

5 years ago[DAGCombiner] reduce buildvec of zexted extracted element to shuffle
Sanjay Patel [Tue, 15 Jan 2019 16:11:05 +0000 (16:11 +0000)]
[DAGCombiner] reduce buildvec of zexted extracted element to shuffle

The motivating case for this is shown in the first regression test. We are
transferring to scalar and back rather than just zero-extending with 'vpmovzxdq'.

That's a special-case for a more general pattern as shown here. In all tests,
we're avoiding the vector-scalar-vector moves in favor of vector ops.

We aren't producing optimal shuffle code in some cases though, so the patch is
limited to reduce regressions.

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

llvm-svn: 351198

5 years ago[OMPT] Second chunk of final OMPT 5.0 interface updates
Joachim Protze [Tue, 15 Jan 2019 15:36:53 +0000 (15:36 +0000)]
[OMPT] Second chunk of final OMPT 5.0 interface updates

The omp-tools.h file is generated from the OpenMP spec to ensure that the interface
is implemented as specified.
The other changes are necessary to update the interface implementation to the
final version as published in 5.0.
The omp-tools.h header was previously called ompt.h, currently a copy under this name
is installed for legacy tools.

Patch partially perpared by @sconvent

Reviewers: AndreyChurbanov, hbae, Hahnfeld

Reviewed By: hbae

Tags: #openmp, #ompt

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

llvm-svn: 351197

5 years agoReduce ASTMatchers stack footprint. Addresses http://llvm.org/PR38851
Alexander Kornienko [Tue, 15 Jan 2019 15:34:26 +0000 (15:34 +0000)]
Reduce ASTMatchers stack footprint. Addresses llvm.org/PR38851

The BoundNodesTreeBuilder class is used both directly and indirectly as a local
variable in matchesAncestorOfRecursively, memoizedMatchesAncestorOfRecursively
and other functions that happen to be on long recursive call paths. By reducing
the inline storage size of the SmallVector we dramatically reduce the stack
requirements of ASTMatchers. Running clang-tidy with a large number of checks
enabled on a few arbitrarily chosen files show no performance regression.

llvm-svn: 351196

5 years agoRevert r351138 "[ORC] Move ORC Core symbol map and set types into their own
Lang Hames [Tue, 15 Jan 2019 15:21:13 +0000 (15:21 +0000)]
Revert r351138 "[ORC] Move ORC Core symbol map and set types into their own
header: CoreTypes.h."

This commit broke some bots. Reverting while I investigate.

llvm-svn: 351195

5 years agoUpdate year in license files
Hans Wennborg [Tue, 15 Jan 2019 15:10:32 +0000 (15:10 +0000)]
Update year in license files

In last year's update (D48219) it was suggested that the release manager
might want to do this, so here we go.

llvm-svn: 351194

5 years ago[SimpleLoopUnswitch] Increment stats counter for unswitching switch instruction
Zaara Syeda [Tue, 15 Jan 2019 15:08:01 +0000 (15:08 +0000)]
[SimpleLoopUnswitch] Increment stats counter for unswitching switch instruction

Increment statistics counter NumSwitches at unswitchNontrivialInvariants() for
unswitching a non-trivial switch instruction. This is to fix a bug that it
increments NumBranches even for the case of switch instruction.
There is no functional change in this patch.

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

llvm-svn: 351193

5 years ago[llvm-obdump] - Fix the help lines for -stop-address and -z.
George Rimar [Tue, 15 Jan 2019 14:03:50 +0000 (14:03 +0000)]
[llvm-obdump] - Fix the help lines for -stop-address and -z.

It was broken by me by mistake in r350823 during addressing the
review comment before committing (changed not the right text line).

llvm-svn: 351192

5 years agoRevert little bad rebasing.
David Carlier [Tue, 15 Jan 2019 13:08:20 +0000 (13:08 +0000)]
Revert little bad rebasing.

llvm-svn: 351191

5 years ago[Sanitizer] Intercept sl_add api on FreeBSD/NetBSD
David Carlier [Tue, 15 Jan 2019 11:21:33 +0000 (11:21 +0000)]
[Sanitizer] Intercept sl_add api on FreeBSD/NetBSD

Reviewers: krytarowski, vitalybuka

Reviewed By: krytarowski

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

llvm-svn: 351189

5 years ago[OpenCL] opencl-c.h: read_image*(): sampler-less, and image{1,2}d_array_t variants...
Roman Lebedev [Tue, 15 Jan 2019 11:20:02 +0000 (11:20 +0000)]
[OpenCL] opencl-c.h: read_image*(): sampler-less, and image{1,2}d_array_t variants are OpenCL-1.2+, mark them as such

Summary:
Refer to [[ https://www.khronos.org/registry/OpenCL/specs/opencl-1.1.pdf#page=242 | `6.11.13.2 Built-in Image Functions` ]],
and [[ https://www.khronos.org/registry/OpenCL/specs/opencl-1.1.pdf#page=306 | `9.6.8 Image Read and Write Functions` ]] of the OpenCL 1.1 spec.

* There is no mention of `image1d_array_t` and `image2d_array_t` anywhere in the OpenCL 1.1 spec.
* All the `read_image{f,i,ui,h}()` functions, as of OpenCL 1.1 spec, have a second required parameter `sampler_t sampler`

Should have prevented the following regression:
https://redmine.darktable.org/issues/12493

Reviewers: yaxunl, Anastasia, echuraev, asavonic

Reviewed By: Anastasia

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 351188

5 years ago[InstCombine] Don't undo 0 - (X * Y) canonicalization when combining subs.
Florian Hahn [Tue, 15 Jan 2019 11:18:21 +0000 (11:18 +0000)]
[InstCombine] Don't undo 0 - (X * Y) canonicalization when combining subs.

Otherwise instcombine gets stuck in a cycle. The canonicalization was
added in D55961.

This patch fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=12400

llvm-svn: 351187

5 years ago[ELF][AArch64] Add missing PLT relocations to isStaticLinkTimeConstant
Peter Smith [Tue, 15 Jan 2019 11:17:03 +0000 (11:17 +0000)]
[ELF][AArch64] Add missing PLT relocations to isStaticLinkTimeConstant

r347650 fixed pr38074 for AArch64 for static linking. It added two new
RelExpr instances R_AARCH64_GOT_PAGE_PC_PLT and R_GOT_PLT. These need to be
added to isStaticLinkTimeConstant so that the address of an ifunc can be
taken when building a shared library.

fixes pr40250

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

llvm-svn: 351186

5 years ago[NFC] Remove some code duplication
Max Kazantsev [Tue, 15 Jan 2019 11:16:14 +0000 (11:16 +0000)]
[NFC] Remove some code duplication

llvm-svn: 351185

5 years ago[compiler-rt] alignment-assumption-blacklist.cpp test apparently passes on android...
Roman Lebedev [Tue, 15 Jan 2019 10:48:51 +0000 (10:48 +0000)]
[compiler-rt] alignment-assumption-blacklist.cpp test apparently passes on android, un-XFAIL it.

llvm-svn: 351184

5 years ago[NFC] Remove obsolete enum RangeCheckKind
Max Kazantsev [Tue, 15 Jan 2019 10:48:45 +0000 (10:48 +0000)]
[NFC] Remove obsolete enum RangeCheckKind

llvm-svn: 351183

5 years ago[NFC][X86] extract-bits.ll: add test with truncation with extra-use.
Roman Lebedev [Tue, 15 Jan 2019 10:36:20 +0000 (10:36 +0000)]
[NFC][X86] extract-bits.ll: add test with truncation with extra-use.

That extra-use *should* prevent D56052 from looking past the trunc.

llvm-svn: 351182

5 years ago[compiler-rt] fuzzer-alignment-assumption.test: fixup the expected column number
Roman Lebedev [Tue, 15 Jan 2019 10:25:14 +0000 (10:25 +0000)]
[compiler-rt] fuzzer-alignment-assumption.test: fixup the expected column number

llvm-svn: 351181

5 years ago[NFC] Decrease if nest
Max Kazantsev [Tue, 15 Jan 2019 10:01:46 +0000 (10:01 +0000)]
[NFC] Decrease if nest

llvm-svn: 351180

5 years ago[NFC] Move some functions to LoopUtils
Max Kazantsev [Tue, 15 Jan 2019 09:51:34 +0000 (09:51 +0000)]
[NFC] Move some functions to LoopUtils

llvm-svn: 351179

5 years ago[compiler-rt][UBSan] Sanitization for alignment assumptions.
Roman Lebedev [Tue, 15 Jan 2019 09:44:27 +0000 (09:44 +0000)]
[compiler-rt][UBSan] Sanitization for alignment assumptions.

Summary:
This is the compiler-rt part.
The clang part is D54589.

This is a second commit, the original one was r351106,
which was mass-reverted in r351159 because 2 compiler-rt tests were failing.

Now, i have fundamentally changed the testing approach:
i malloc a few bytes, intentionally mis-align the pointer
(increment it by one), and check that. Also, i have decreased
the expected alignment. This hopefully should be enough to pacify
all the bots. If not, i guess i might just drop the two 'bad' tests.

Reviewers: filcab, vsk, #sanitizers, vitalybuka, rsmith, morehouse

Reviewed By: morehouse

Subscribers: rjmccall, krytarowski, rsmith, kcc, srhines, kubamracek, dberris, llvm-commits

Tags: #sanitizers

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

llvm-svn: 351178

5 years ago[clang][UBSan] Sanitization for alignment assumptions.
Roman Lebedev [Tue, 15 Jan 2019 09:44:25 +0000 (09:44 +0000)]
[clang][UBSan] Sanitization for alignment assumptions.

Summary:
UB isn't nice. It's cool and powerful, but not nice.
Having a way to detect it is nice though.
[[ https://wg21.link/p1007r3 | P1007R3: std::assume_aligned ]] / http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1007r2.pdf says:
```
We propose to add this functionality via a library function instead of a core language attribute.
...
If the pointer passed in is not aligned to at least N bytes, calling assume_aligned results in undefined behaviour.
```

This differential teaches clang to sanitize all the various variants of this assume-aligned attribute.

Requires D54588 for LLVM IRBuilder changes.
The compiler-rt part is D54590.

This is a second commit, the original one was r351105,
which was mass-reverted in r351159 because 2 compiler-rt tests were failing.

Reviewers: ABataev, craig.topper, vsk, rsmith, rnk, #sanitizers, erichkeane, filcab, rjmccall

Reviewed By: rjmccall

Subscribers: chandlerc, ldionne, EricWF, mclow.lists, cfe-commits, bkramer

Tags: #sanitizers

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

llvm-svn: 351177

5 years ago[llvm][IRBuilder] Introspection for CreateAlignmentAssumption*() functions
Roman Lebedev [Tue, 15 Jan 2019 09:44:13 +0000 (09:44 +0000)]
[llvm][IRBuilder] Introspection for CreateAlignmentAssumption*() functions

Summary:
Clang calls these functions to produce IR for assume-aligned attributes.
I would like to teach UBSAN to verify these assumptions.
For that, i need to access the final pointer on which the check is performed,
and the actual `icmp` that does the check.

The alternative to this would be to fully re-implement this in clang.

This is a second commit, the original one was r351104,
which was mass-reverted in r351159 because 2 compiler-rt tests were failing.

Reviewers: spatel, dneilson, craig.topper, dblaikie, hfinkel

Reviewed By: hfinkel

Subscribers: hfinkel, llvm-commits

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

llvm-svn: 351176

5 years agoNFC: Move Decl node handling to TextNodeDumper
Stephen Kelly [Tue, 15 Jan 2019 09:35:52 +0000 (09:35 +0000)]
NFC: Move Decl node handling to TextNodeDumper

Reviewers: aaron.ballman

Subscribers: cfe-commits

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

llvm-svn: 351175

5 years ago[llvm-objcopy] [COFF] Implement --strip-all[-gnu] for symbols
Martin Storsjo [Tue, 15 Jan 2019 09:34:55 +0000 (09:34 +0000)]
[llvm-objcopy] [COFF] Implement --strip-all[-gnu] for symbols

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

llvm-svn: 351174

5 years ago[llvm-objcopy] [COFF] Remove pointless comment chars from .test files. NFC.
Martin Storsjo [Tue, 15 Jan 2019 09:34:45 +0000 (09:34 +0000)]
[llvm-objcopy] [COFF] Remove pointless comment chars from .test files. NFC.

llvm-svn: 351173

5 years ago[ASTDump] NFC: Move dump of type nodes to NodeDumper
Stephen Kelly [Tue, 15 Jan 2019 09:30:00 +0000 (09:30 +0000)]
[ASTDump] NFC: Move dump of type nodes to NodeDumper

Reviewers: aaron.ballman

Subscribers: cfe-commits

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

llvm-svn: 351172

5 years ago[llvm-objdump] - Cleanup the code. NFCI.
George Rimar [Tue, 15 Jan 2019 09:19:18 +0000 (09:19 +0000)]
[llvm-objdump] - Cleanup the code. NFCI.

This is a cosmetic cleanup for the llvm-objdump code.

This patch:
* Renames things to match the official LLVM code style (lower case -> upper case).
* Removes few obviously excessive variables.
* Moves a few lines closer to the place of use, reorders the code a bit to simplify it,
to avoid doing excessive returns and to avoid using 'else` after returns.

I focused only on a llvm-objdump.h/llvm-objdump.cpp files. Few changes in the
MachODump.cpp and COFFDump.cpp are a result of llvm-objdump.h modification.

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

llvm-svn: 351171

5 years ago[clangd] Fix updated file detection logic in indexing
Kadir Cetinkaya [Tue, 15 Jan 2019 09:03:33 +0000 (09:03 +0000)]
[clangd] Fix updated file detection logic in indexing

Summary:
Files without any symbols were never marked as updated during indexing, which resulted in failure while writing shards for these files.

This patch fixes the logic to mark files that are seen for the first time but don't contain any symbols as updated.

Reviewers: ilya-biryukov

Reviewed By: ilya-biryukov

Subscribers: ioeric, MaskRay, jkorous, arphaman, cfe-commits

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

llvm-svn: 351170

5 years agoExplicitly set C++ standard for `Posix/no-fd.cc` ASan test.
Dan Liew [Tue, 15 Jan 2019 08:54:10 +0000 (08:54 +0000)]
Explicitly set C++ standard for `Posix/no-fd.cc` ASan test.

Summary:
The test uses `nullptr` which can break running the test if the
compiler happens to be using something older than C++11 as the default
language standard. Avoid this by explicitly setting the standard.

rdar://problem/47253542

Reviewers: eugenis, yln, vitalybuka

Subscribers: kubamracek, #sanitizers, llvm-commits

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

llvm-svn: 351169

5 years agogn build: Rename llvm_host_triple to llvm_current_triple and have it use current_...
Peter Collingbourne [Tue, 15 Jan 2019 08:20:29 +0000 (08:20 +0000)]
gn build: Rename llvm_host_triple to llvm_current_triple and have it use current_{cpu,os}.

This makes e.g. ToolChain::isCrossCompiling() in
clang/lib/Driver/ToolChain.cpp return the correct result
if the compiler was cross-compiled. This change also affects
llvm_default_target_triple, so cross-compiled compilers default to
targeting the cross-compilation target, which makes more sense than
the host that the compiler was compiled on.

This change will also be necessary in order for the correct triples
to appear in generated lit files for non-native targets.

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

llvm-svn: 351168

5 years agogn build: Make a couple of improvements to the unix toolchain.
Peter Collingbourne [Tue, 15 Jan 2019 08:14:38 +0000 (08:14 +0000)]
gn build: Make a couple of improvements to the unix toolchain.

Add an asm tool (will be required for building sanitizer_common on
x64) and set a soname for DSOs so that anything that links against
them gets the correct DT_NEEDED.

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

llvm-svn: 351167

5 years agogn build: Switch to using current_os in lib/Support/BUILD.gn.
Peter Collingbourne [Tue, 15 Jan 2019 07:17:03 +0000 (07:17 +0000)]
gn build: Switch to using current_os in lib/Support/BUILD.gn.

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

llvm-svn: 351166

5 years ago[X86] Upgrade some avx512bw shift intrinsics that were removed a while ago. NFC
Craig Topper [Tue, 15 Jan 2019 07:15:20 +0000 (07:15 +0000)]
[X86] Upgrade some avx512bw shift intrinsics that were removed a while ago. NFC

Masking was removed from these intrinsics and I guess we didn't update the tests then.

llvm-svn: 351165

5 years ago[WebAssembly] Support multilibs for wasm32 and add a wasm OS that uses it
Dan Gohman [Tue, 15 Jan 2019 06:58:16 +0000 (06:58 +0000)]
[WebAssembly] Support multilibs for wasm32 and add a wasm OS that uses it

This adds support for multilib paths for wasm32 targets, following
[Debian's Multiarch conventions], and also adds an experimental OS name in
order to test it.

[Debian's Multiarch conventions]: https://wiki.debian.org/Multiarch/

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

llvm-svn: 351164

5 years ago[WebAssembly] Support multilibs for wasm32 and add a wasm OS that uses it
Dan Gohman [Tue, 15 Jan 2019 06:58:13 +0000 (06:58 +0000)]
[WebAssembly] Support multilibs for wasm32 and add a wasm OS that uses it

This adds support for multilib paths for wasm32 targets, following
[Debian's Multiarch conventions], and also adds an experimental OS name in
order to test it.

[Debian's Multiarch conventions]: https://wiki.debian.org/Multiarch/

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

llvm-svn: 351163

5 years ago[X86] Add test cases for D56695. NFC
Craig Topper [Tue, 15 Jan 2019 06:39:51 +0000 (06:39 +0000)]
[X86] Add test cases for D56695. NFC

llvm-svn: 351162

5 years ago[X86] Switch the triple on avx2-intrinsics-x86.ll to be -unknown-unknown instead...
Craig Topper [Tue, 15 Jan 2019 06:39:49 +0000 (06:39 +0000)]
[X86] Switch the triple on avx2-intrinsics-x86.ll to be -unknown-unknown instead of darwin so the constant pool entries will be filtered better by the script.

Darwin uses LCPI instead of .LCPI so the filter doesn't work.

This is silly, but it will help reduce some future some test diffs.

llvm-svn: 351161

5 years ago[X86] Make _xgetbv/_xsetbv on non-windows platforms
Craig Topper [Tue, 15 Jan 2019 05:03:18 +0000 (05:03 +0000)]
[X86] Make _xgetbv/_xsetbv on non-windows platforms

Summary:
This patch attempts to redo what was tried in r278783, but was reverted.

These intrinsics should be available on non-windows platforms with "xsave" feature check. But on Windows platforms they shouldn't have feature check since that's how MSVC behaves.

To accomplish this I've added a MS builtin with no feature check. And a normal gcc builtin with a feature check. When _MSC_VER is not defined _xgetbv/_xsetbv will be macros pointing to the gcc builtin name.

I've moved the forward declarations from intrin.h to immintrin.h to match the MSDN documentation and used that as the header file for the MS builtin.

I'm not super happy with this implementation, and I'm open to suggestions for better ways to do it.

Reviewers: rnk, RKSimon, spatel

Reviewed By: rnk

Subscribers: cfe-commits

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

llvm-svn: 351160

5 years agoRevert alignment assumptions changes
Vlad Tsyrklevich [Tue, 15 Jan 2019 03:38:02 +0000 (03:38 +0000)]
Revert alignment assumptions changes

Revert r351104-6, r351109, r351110, r351119, r351134, and r351153. These
changes fail on the sanitizer bots.

llvm-svn: 351159

5 years ago[LLDB] Remove the unused variable oso_dwarf.
David L. Jones [Tue, 15 Jan 2019 03:27:54 +0000 (03:27 +0000)]
[LLDB] Remove the unused variable oso_dwarf.

Patch by Ali Tamur! (tamur@google.com)

llvm-svn: 351158

5 years agogn build: Split no-RTTI flag into a config.
Peter Collingbourne [Tue, 15 Jan 2019 02:43:33 +0000 (02:43 +0000)]
gn build: Split no-RTTI flag into a config.

Some of the sanitizer runtime code needs to be built with RTTI;
this allows that code to opt in to RTTI.

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

llvm-svn: 351155

5 years agogn build: Stop defining LLVM_ON_UNIX globally.
Peter Collingbourne [Tue, 15 Jan 2019 02:42:47 +0000 (02:42 +0000)]
gn build: Stop defining LLVM_ON_UNIX globally.

This macro is already being defined in llvm-config.h.

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

llvm-svn: 351154

5 years agoSilence failing tests
Vlad Tsyrklevich [Tue, 15 Jan 2019 02:22:14 +0000 (02:22 +0000)]
Silence failing tests

r351134 tried to disable these tests by using 'UNSUPPORTED: *' but '*'
is not supported for UNSUPPORTED like it is for XFAIL. Update these
tests to use XFAIL for now in order to silence x86_64-linux and
x86_64-linux-android.

llvm-svn: 351153

5 years ago[libFuzzer][MSVC] Use alternatename for ext functions
Jonathan Metzman [Tue, 15 Jan 2019 02:20:53 +0000 (02:20 +0000)]
[libFuzzer][MSVC] Use alternatename for ext functions

Summary:
Use alternatename for external functions only when using
MSVC since Clang doesn't support it and MSVC doesn't support
Clang's method (weak aliases).

Reviewers: morehouse

Reviewed By: morehouse

Subscribers: rnk, thakis, mgorny

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

llvm-svn: 351152

5 years ago[WebAssembly] Expand SIMD shifts while V8's implementation disagrees
Thomas Lively [Tue, 15 Jan 2019 02:16:03 +0000 (02:16 +0000)]
[WebAssembly] Expand SIMD shifts while V8's implementation disagrees

Summary:
V8 currently implements SIMD shifts as taking an immediate operation,
which disagrees with the spec proposal and the toolchain
implementation. As a stopgap measure to get things working, unroll all
vector shifts. Since this is a temporary measure, there are no tests.

Reviewers: aheejin, dschuff

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

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

llvm-svn: 351151

5 years agoAMDGPU: Add a fast path for icmp.i1(src, false, NE)
Marek Olsak [Tue, 15 Jan 2019 02:13:18 +0000 (02:13 +0000)]
AMDGPU: Add a fast path for icmp.i1(src, false, NE)

Summary:
This allows moving the condition from the intrinsic to the standard ICmp
opcode, so that LLVM can do simplifications on it. The icmp.i1 intrinsic
is an identity for retrieving the SGPR mask.

And we can also get the mask from and i1, or i1, xor i1.

Reviewers: arsenm, nhaehnle

Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, llvm-commits

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

llvm-svn: 351150

5 years ago[AArch64] Adjust the feature set for Exynos
Evandro Menezes [Tue, 15 Jan 2019 01:53:49 +0000 (01:53 +0000)]
[AArch64] Adjust the feature set for Exynos

Enable the fusion of arithmetic and logic instructions for Exynos M4.

llvm-svn: 351149

5 years ago[test] Fix logic error in <compare> tests; enable for MSVC Dev16
Casey Carter [Tue, 15 Jan 2019 01:53:12 +0000 (01:53 +0000)]
[test] Fix logic error in <compare> tests; enable for MSVC Dev16

Submitted upstream as https://reviews.llvm.org/D53763.

llvm-svn: 351148

5 years ago[COFF, ARM64] Add __byteswap intrinsics
Mandeep Singh Grang [Tue, 15 Jan 2019 01:26:26 +0000 (01:26 +0000)]
[COFF, ARM64] Add __byteswap intrinsics

Reviewers: rnk, efriedma, ssijaric, TomTan, haripul

Reviewed By: efriedma

Subscribers: javed.absar, cfe-commits, kristof.beyls

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

llvm-svn: 351147

5 years ago[X86] Avoid clobbering ESP/RSP in the epilogue.
Reid Kleckner [Tue, 15 Jan 2019 01:24:18 +0000 (01:24 +0000)]
[X86] Avoid clobbering ESP/RSP in the epilogue.

Summary:
In r345197 ESP and RSP were added to GR32_TC/GR64_TC, allowing them to
be used for tail calls, but this also caused `findDeadCallerSavedReg` to
think they were acceptable targets for clobbering. Filter them out.

Fixes PR40289.

Patch by Geoffry Song!

Reviewed By: rnk

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

llvm-svn: 351146

5 years ago[CMake][Fuchsia] Synchronize first and second stage builds
Petr Hosek [Tue, 15 Jan 2019 01:15:00 +0000 (01:15 +0000)]
[CMake][Fuchsia] Synchronize first and second stage builds

This reorders options between the first and second stage builds to make
them better lined up. The change also re-enables tests for first stage
which is useful e.g. for cross-compiling when we cannot run tests for
second stage directly (i.e. without emulation).

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

llvm-svn: 351145

5 years ago[AArch64] Fix typo (NFC)
Evandro Menezes [Tue, 15 Jan 2019 00:58:59 +0000 (00:58 +0000)]
[AArch64] Fix typo (NFC)

Fix another typo, this time in the `RUN` line, which used a syntax not
universally supported, in test case added by D56572.

llvm-svn: 351144

5 years ago[AArch64] Fix typo (NFC)
Evandro Menezes [Tue, 15 Jan 2019 00:20:57 +0000 (00:20 +0000)]
[AArch64] Fix typo (NFC)

Fix typo in test case added by D56572 (rL351139).

llvm-svn: 351143

5 years ago[EarlyIfConversion] Don't if-convert unconditional branches.
Eli Friedman [Tue, 15 Jan 2019 00:19:46 +0000 (00:19 +0000)]
[EarlyIfConversion] Don't if-convert unconditional branches.

A block ending in an unconditional branch can have two successors if one
is a landing pad.  In practice, I think this only has an effect on
Windows because landing pads are never empty for Itanium unwinding.

(Alternatively, I could add a check to
AArch64InstrInfo::canInsertSelect, but this seems more obvious.)

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

llvm-svn: 351142

5 years ago[AArch64] Explicitly use v1i64 type for llvm.aarch64.neon.abs.i64 .
Eli Friedman [Tue, 15 Jan 2019 00:15:24 +0000 (00:15 +0000)]
[AArch64] Explicitly use v1i64 type for llvm.aarch64.neon.abs.i64 .

Otherwise, with D56544, the intrinsic will be expanded to an integer
csel, which is probably not what the user expected.  This matches the
general convention of using "v1" types to represent scalar integer
operations in vector registers.

While I'm here, also add some error checking so we don't generate
illegal ABS nodes.

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

llvm-svn: 351141

5 years agoGeneralize the comparison test structure to support cross-type comparisons. NFC to...
Marshall Clow [Tue, 15 Jan 2019 00:05:05 +0000 (00:05 +0000)]
Generalize the comparison test structure to support cross-type comparisons. NFC to the library

llvm-svn: 351140

5 years ago[AArch64] Add new target feature to fuse arithmetic and logic operations
Evandro Menezes [Mon, 14 Jan 2019 23:54:36 +0000 (23:54 +0000)]
[AArch64] Add new target feature to fuse arithmetic and logic operations

This feature enables the fusion of some arithmetic and logic instructions
together.

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

llvm-svn: 351139

5 years ago[ORC] Move ORC Core symbol map and set types into their own header: CoreTypes.h.
Lang Hames [Mon, 14 Jan 2019 23:49:13 +0000 (23:49 +0000)]
[ORC] Move ORC Core symbol map and set types into their own header: CoreTypes.h.

This will allow other utilities (including a future RuntimeDyld replacement) to
use these types without pulling in the major Core types (JITDylib, etc.).

llvm-svn: 351138

5 years ago[Sema] Change std::sort to llvm::sort
Mandeep Singh Grang [Mon, 14 Jan 2019 23:45:58 +0000 (23:45 +0000)]
[Sema] Change std::sort to llvm::sort

llvm-svn: 351137

5 years ago[X86] Fix unused variable warning in Release builds. NFC.
Benjamin Kramer [Mon, 14 Jan 2019 23:29:54 +0000 (23:29 +0000)]
[X86] Fix unused variable warning in Release builds. NFC.

llvm-svn: 351136

5 years ago[COFF, ARM64] Add __nop intrinsic
Mandeep Singh Grang [Mon, 14 Jan 2019 23:26:01 +0000 (23:26 +0000)]
[COFF, ARM64] Add __nop intrinsic

Reviewers: rnk, efriedma, TomTan, haripul, ssijaric

Reviewed By: rnk, efriedma

Subscribers: javed.absar, kristof.beyls, cfe-commits

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

llvm-svn: 351135

5 years ago[compiler-rt] UBSan: just completely disable two alignment-assumption tests for now.
Roman Lebedev [Mon, 14 Jan 2019 22:44:19 +0000 (22:44 +0000)]
[compiler-rt] UBSan: just completely disable two alignment-assumption tests for now.

And they are faling on clang-cmake-armv7-full too.
*ONLY* these two.
I'm not sure what to make of it.

Perhaps doing a malloc and checking that pointer will
make them fail as expected?

llvm-svn: 351134

5 years ago[SymbolFile] Remove SymbolContext parameter from FindTypes.
Zachary Turner [Mon, 14 Jan 2019 22:41:21 +0000 (22:41 +0000)]
[SymbolFile] Remove SymbolContext parameter from FindTypes.

This parameter was only ever used with the Module set, and
since a SymbolFile is tied to a module, the parameter turns
out to be entirely unnecessary.  Furthermore, it doesn't make
a lot of sense to ask a caller to ask SymbolFile which is tied
to Module X to find types for Module Y, but that possibility
was open with the previous interface.  By removing this
parameter from the API, it makes it harder to use incorrectly
as well as easier for an implementor to understand what it
needs to do.

llvm-svn: 351133

5 years ago[SymbolFile] Remove the SymbolContext parameter from FindNamespace.
Zachary Turner [Mon, 14 Jan 2019 22:41:00 +0000 (22:41 +0000)]
[SymbolFile] Remove the SymbolContext parameter from FindNamespace.

Every callsite was passing an empty SymbolContext, so this parameter
had no effect.  Inside the DWARF implementation of this function,
however, there was one codepath that checked members of the
SymbolContext.  Since no call-sites actually ever used this
functionality, it was essentially dead code, so I've deleted this
code path as well.

llvm-svn: 351132

5 years ago[SymbolFile] Rename ParseFunctionBlocks to ParseBlocksRecursive.
Zachary Turner [Mon, 14 Jan 2019 22:40:41 +0000 (22:40 +0000)]
[SymbolFile] Rename ParseFunctionBlocks to ParseBlocksRecursive.

This method took a SymbolContext but only actually cared about the
case where the m_function member was set.  Furthermore, it was
intended to be implemented to parse blocks recursively despite not
documenting this in its name.  So we change the name to indicate
that it should be recursive, while also limiting the function
parameter to be a Function&.  This lets the caller know what is
required to use it, as well as letting new implementers know what
kind of inputs they need to be prepared to handle.

llvm-svn: 351131

5 years agoUpdate GettingStarted guide to recommend that people use the new
James Y Knight [Mon, 14 Jan 2019 22:27:32 +0000 (22:27 +0000)]
Update GettingStarted guide to recommend that people use the new
official Git repository.

Remove the directions for using git-svn, and demote the prominence of
the svn instructions.

Also, fix a few other issues while I'm in there:

* Mention LLVM_ENABLE_PROJECTS more.
* Getting started doesn't need to mention test-suite, but should
  mention clang and the other projects.
* Remove mentions of "configure", since that's long gone.

I've also adjusted a few other mentions of svn to point to github, but
have not done so comprehensively.

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

llvm-svn: 351130

5 years agoRevert "[CodeGen][X86] Expand USUBSAT to UMAX+SUB, also for vectors"
Nikita Popov [Mon, 14 Jan 2019 22:18:39 +0000 (22:18 +0000)]
Revert "[CodeGen][X86] Expand USUBSAT to UMAX+SUB, also for vectors"

This reverts commit r351125.

I missed test changes in an SLPVectorizer test, due to the cost model
changes. Reverting for now.

llvm-svn: 351129

5 years ago[Object] Return a symbol_iterator, rather than a basic_symbol_iterator, from
Lang Hames [Mon, 14 Jan 2019 22:05:12 +0000 (22:05 +0000)]
[Object] Return a symbol_iterator, rather than a basic_symbol_iterator, from
MachOObjectFile::getSymbolByIndex.

ObjectFile derivatives should prefer symbol_iterator/SymbolRef over
basic_symbol_iterator/BasicSymbolRef where possible, as the former
retain their link to the ObjectFile (rather than a SymbolicFile) and provide
more functionality.

No test for this: Existing code is working, and we don't have (m)any libObject
unit tests. I'll think about how we can test more systematically going forward.

llvm-svn: 351128

5 years ago[WebAssembly][FastISel] Do not assume naive CmpInst lowering
Thomas Lively [Mon, 14 Jan 2019 22:03:43 +0000 (22:03 +0000)]
[WebAssembly][FastISel] Do not assume naive CmpInst lowering

Summary:
Fixes https://bugs.llvm.org/show_bug.cgi?id=40172. See
test/CodeGen/WebAssembly/PR40172.ll for an explanation.

Reviewers: dschuff, aheejin

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

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

llvm-svn: 351127

5 years ago[llvm-ar] Temporarily remove failing test which is breaking buildbots
Jordan Rupprecht [Mon, 14 Jan 2019 21:58:15 +0000 (21:58 +0000)]
[llvm-ar] Temporarily remove failing test which is breaking buildbots

llvm-svn: 351126

5 years ago[CodeGen][X86] Expand USUBSAT to UMAX+SUB, also for vectors
Nikita Popov [Mon, 14 Jan 2019 21:43:30 +0000 (21:43 +0000)]
[CodeGen][X86] Expand USUBSAT to UMAX+SUB, also for vectors

Related to https://bugs.llvm.org/show_bug.cgi?id=40123.

Rather than scalarizing, expand a vector USUBSAT into UMAX+SUB,
which produces much better code for X86.

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

llvm-svn: 351125