platform/upstream/llvm.git
7 years agoFix a typo in the documentation. NFC.
Martin Storsjo [Sat, 16 Sep 2017 20:52:05 +0000 (20:52 +0000)]
Fix a typo in the documentation. NFC.

llvm-svn: 313470

7 years agoTry to fix some failing bots.
Zachary Turner [Sat, 16 Sep 2017 19:20:53 +0000 (19:20 +0000)]
Try to fix some failing bots.

It doesn't make sense to me why these bots are failing as the
traceback does not agree with the source code.  It's possible
something is stale or there is some other mysterious error,
but in any case hopefully this fixes it.

llvm-svn: 313469

7 years ago[llvm-symbolizer] Fix coff-dwarf.test
Zachary Turner [Sat, 16 Sep 2017 19:01:04 +0000 (19:01 +0000)]
[llvm-symbolizer] Fix coff-dwarf.test

This was a bug in the test that was only exposed as a result of
refactoring some code in lit configuration files.  Previously,
llvm's lit configuration would only set the target-windows feature
if the system was also windows.  Since cross-compilation is
a thing, this isn't correct.  target-windows should be set
independently of system-windows.

Adding to that bug, this particular test then checked for
target-windows when it really meant "can I call a certain API on
the host machine", which is what system-windows is for.

Ultimately, this test only works if *both* the target and host
are Windows, so I've updated the test to reflect that.

llvm-svn: 313468

7 years agoResubmit "Add a shared llvm.lit module that all test suites can use."
Zachary Turner [Sat, 16 Sep 2017 18:46:21 +0000 (18:46 +0000)]
Resubmit "Add a shared llvm.lit module that all test suites can use."

There were some issues surrounding Py2 / Py3 compatibility, but
I've now tested with both Py2 and Py3 and everything seems to
work.

llvm-svn: 313467

7 years ago[lit] Fix some Python 3 compatibility issues.
Zachary Turner [Sat, 16 Sep 2017 18:45:44 +0000 (18:45 +0000)]
[lit] Fix some Python 3 compatibility issues.

llvm-svn: 313466

7 years ago[X86] Remove some extra code that snuck into r313450.
Craig Topper [Sat, 16 Sep 2017 17:51:55 +0000 (17:51 +0000)]
[X86] Remove some extra code that snuck into r313450.

The same code appears earlier in the function. This represents an earlier version of what became r313373 that I still had sitting in my local repo.

llvm-svn: 313465

7 years agollvm-dwarfdump: support a --show-children option
Adrian Prantl [Sat, 16 Sep 2017 17:28:00 +0000 (17:28 +0000)]
llvm-dwarfdump: support a --show-children option

This will print all children of a DIE when selectively printing only
one DIE at a given offset.

llvm-svn: 313464

7 years agollvm-dwarfdump: Add support for -debug-types=<offset>.
Adrian Prantl [Sat, 16 Sep 2017 16:58:18 +0000 (16:58 +0000)]
llvm-dwarfdump: Add support for -debug-types=<offset>.

llvm-svn: 313463

7 years ago[X86] Remove unnecessary extra encodings from the CPU name enum in clang
Craig Topper [Sat, 16 Sep 2017 16:44:39 +0000 (16:44 +0000)]
[X86] Remove unnecessary extra encodings from the CPU name enum in clang

Summary:
For a lot of older CPUs we have a 1:1 mapping between CPU name and enum name. But many of them are effectively aliases of each other and as a result are always repeated together at every usage

This patch removes most of the duplication. It also uses StringSwitch::Cases to make the many to one mapping in the StringSwitch more obvious.

Reviewers: RKSimon, spatel, zvi, igorb

Reviewed By: RKSimon

Subscribers: cfe-commits

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

llvm-svn: 313462

7 years ago[lit] Fix the lit unit tests.
Zachary Turner [Sat, 16 Sep 2017 15:48:30 +0000 (15:48 +0000)]
[lit] Fix the lit unit tests.

A few tests were manually constructing a LitConfig object, since
I added a new argument to it this was triggering some failures
I didn't detect.  `ninja check-lit` passes now.

llvm-svn: 313461

7 years ago[lit] Add a single process mode.
Zachary Turner [Sat, 16 Sep 2017 15:31:34 +0000 (15:31 +0000)]
[lit] Add a single process mode.

This is helpful for debugging test failures since it removes
the multiprocessing pool from the picture.  This will obviously
slow down the test suite by a few orders of magnitude, so it
should only be used for debugging specific failures.

llvm-svn: 313460

7 years ago[llvm-readobj] - Teach tool to report error if some section is in multiple COMDAT...
George Rimar [Sat, 16 Sep 2017 14:29:51 +0000 (14:29 +0000)]
[llvm-readobj] - Teach tool to report error if some section is in multiple COMDAT groups at once.

readelf tool reports an error when output contains the same section
in multiple COMDAT groups. That can be useful.
Path teaches llvm-readobj to do the same.

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

llvm-svn: 313459

7 years ago[x86] enable storeOfVectorConstantIsCheap() target hook
Sanjay Patel [Sat, 16 Sep 2017 13:29:12 +0000 (13:29 +0000)]
[x86] enable storeOfVectorConstantIsCheap() target hook

This allows vector-sized store merging of constants in DAGCombiner using the existing code in MergeConsecutiveStores().
All of the twisted logic that decides exactly what vector operations are legal and fast for each particular CPU are
handled separately in there using the appropriate hooks.

For the motivating tests in merge-store-constants.ll, we already produce the same vector code in IR via the SLP vectorizer.
So this is just providing a backend backstop for code that doesn't go through that pass (-O1). More details in PR24449:
https://bugs.llvm.org/show_bug.cgi?id=24449 (this change should be the last step to resolve that bug)

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

llvm-svn: 313458

7 years agoReformat.
NAKAMURA Takumi [Sat, 16 Sep 2017 12:13:03 +0000 (12:13 +0000)]
Reformat.

llvm-svn: 313457

7 years agollvm/IR/DiagnosticHandler.h: Add include guard, or -fmodules would be confused.
NAKAMURA Takumi [Sat, 16 Sep 2017 12:13:00 +0000 (12:13 +0000)]
llvm/IR/DiagnosticHandler.h: Add include guard, or -fmodules would be confused.

llvm-svn: 313456

7 years ago[X86] Add isel patterns to be able to fold loads into VPERM2F128 even when the load...
Craig Topper [Sat, 16 Sep 2017 09:16:48 +0000 (09:16 +0000)]
[X86] Add isel patterns to be able to fold loads into VPERM2F128 even when the load is on the first input to the SDNode.

We just need to toggle bits 1 and 5 of the immediate and swap the sources. The peephole pass could trigger commuting/folding for this later, but its easy enough to fix in isel.

Disable the peephole pass on the main vperm2x128 test so we know we're doing this through isel.

llvm-svn: 313455

7 years ago[X86] Remove unused check lines that got left behind when I moved tests to the instri...
Craig Topper [Sat, 16 Sep 2017 09:16:46 +0000 (09:16 +0000)]
[X86] Remove unused check lines that got left behind when I moved tests to the instrinsic upgrade file and regenerated.

llvm-svn: 313454

7 years ago[X86] Remove VPERM2X128 isel patterns with 32-bit elements.
Craig Topper [Sat, 16 Sep 2017 08:15:52 +0000 (08:15 +0000)]
[X86] Remove VPERM2X128 isel patterns with 32-bit elements.

Now that the intrinsics are gone we only need 64-bit elements since that's what shuffle lowering uses.

llvm-svn: 313453

7 years ago[sanitizer] Fix check for i386 Android in lit tests
Vitaly Buka [Sat, 16 Sep 2017 07:56:06 +0000 (07:56 +0000)]
[sanitizer] Fix check for i386 Android in lit tests

llvm-svn: 313452

7 years ago[X86] Remove the vperm2f128 test file I just added in r313450.
Craig Topper [Sat, 16 Sep 2017 07:51:01 +0000 (07:51 +0000)]
[X86] Remove the vperm2f128 test file I just added in r313450.

I missed the we already had a pretty thorough test file for these instructions.

llvm-svn: 313451

7 years ago[X86] Remove VPERM2F128/VPERM2I128 intrinsics and autoupgrade to native shuffles.
Craig Topper [Sat, 16 Sep 2017 07:36:14 +0000 (07:36 +0000)]
[X86] Remove VPERM2F128/VPERM2I128 intrinsics and autoupgrade to native shuffles.

I've moved the test cases from the InstCombine optimizations to the backend to keep the coverage we had there. It covered every possible immediate so I've preserved the resulting shuffle mask for each of those immediates.

llvm-svn: 313450

7 years ago[sanitizer] Move signal interceptors from asan to sanitizer_common
Vitaly Buka [Sat, 16 Sep 2017 07:16:29 +0000 (07:16 +0000)]
[sanitizer] Move signal interceptors from asan to sanitizer_common

Summary: Part of https://github.com/google/sanitizers/issues/637

Reviewers: eugenis, alekseyshl

Subscribers: srhines, kubamracek, llvm-commits

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

llvm-svn: 313449

7 years ago[X86] Fix some FileCheck lines that use the wrong prefix.
Craig Topper [Sat, 16 Sep 2017 07:13:39 +0000 (07:13 +0000)]
[X86] Fix some FileCheck lines that use the wrong prefix.

Assume they were moved during autoupgrading and not changed.

llvm-svn: 313448

7 years ago[sanitizer] Disable sanitizer test which already fails on Android i386
Vitaly Buka [Sat, 16 Sep 2017 07:08:23 +0000 (07:08 +0000)]
[sanitizer] Disable sanitizer test which already fails on Android i386

llvm-svn: 313447

7 years agoRemove comment accidentally committed with D36642. NFC.
Vedant Kumar [Sat, 16 Sep 2017 06:26:51 +0000 (06:26 +0000)]
Remove comment accidentally committed with D36642. NFC.

llvm-svn: 313446

7 years ago[sanitizer] Support check-asan on Android
Vitaly Buka [Sat, 16 Sep 2017 05:14:05 +0000 (05:14 +0000)]
[sanitizer] Support check-asan on Android

This patch enabled asan tests from sanitizer_common.

llvm-svn: 313444

7 years ago[sanitizer] Move android_commoands from asan into sanitizer_common
Vitaly Buka [Sat, 16 Sep 2017 05:13:56 +0000 (05:13 +0000)]
[sanitizer] Move android_commoands from asan into sanitizer_common

llvm-svn: 313443

7 years agoFix compatibility with OpenOCD debug stub.
Vadim Chugunov [Sat, 16 Sep 2017 03:53:13 +0000 (03:53 +0000)]
Fix compatibility with OpenOCD debug stub.

OpenOCD sends register classes as two separate <feature> nodes, fixed parser to process both of them.

OpenOCD returns "l" in response to "qfThreadInfo", so IsUnsupportedResponse() was false and we were ending up without any threads in the process. I think it's reasonable to assume that there's always at least one thread.

llvm-svn: 313442

7 years ago[builtins] Remove one more missed not-android
Vitaly Buka [Sat, 16 Sep 2017 03:47:19 +0000 (03:47 +0000)]
[builtins] Remove one more missed not-android

llvm-svn: 313441

7 years ago[asan] Remove not-android
Vitaly Buka [Sat, 16 Sep 2017 03:41:16 +0000 (03:41 +0000)]
[asan] Remove not-android

Replaced with !android

llvm-svn: 313440

7 years agoRevert "[ubsan] Update ubsan_interface.inc"
Vitaly Buka [Sat, 16 Sep 2017 03:26:12 +0000 (03:26 +0000)]
Revert "[ubsan] Update ubsan_interface.inc"

This brakes interface_symbols_linux.c test.

This reverts commit r313432.

llvm-svn: 313439

7 years ago[asan] Enable asan_and_llvm_coverage_test.cc on Android
Vitaly Buka [Sat, 16 Sep 2017 03:26:03 +0000 (03:26 +0000)]
[asan] Enable asan_and_llvm_coverage_test.cc on Android

Test just needs profile.

llvm-svn: 313438

7 years agoCheck availability of accept4 in C++ instad of C code.
Eugene Zemtsov [Sat, 16 Sep 2017 02:58:49 +0000 (02:58 +0000)]
Check availability of accept4 in C++ instad of C code.

llvm-svn: 313437

7 years agoMore precise c library feature detection for Android.
Eugene Zemtsov [Sat, 16 Sep 2017 02:19:21 +0000 (02:19 +0000)]
More precise c library feature detection for Android.

llvm-svn: 313436

7 years ago[git] Update the llvm git helper script to work correctly with the
Chandler Carruth [Sat, 16 Sep 2017 02:13:35 +0000 (02:13 +0000)]
[git] Update the llvm git helper script to work correctly with the
latest Python versions.

llvm-svn: 313435

7 years ago[X86] Don't set reserved bits in the immediate in the test cases for vperm2f128.
Craig Topper [Sat, 16 Sep 2017 02:11:21 +0000 (02:11 +0000)]
[X86] Don't set reserved bits in the immediate in the test cases for vperm2f128.

I'm going to autoupgrade these intrinsics in a future commit. This bit will never be set in the resulting output so pre-removing the bit.

llvm-svn: 313434

7 years ago[X86] Remove slash in front of a CHECK line in a test.
Craig Topper [Sat, 16 Sep 2017 01:43:21 +0000 (01:43 +0000)]
[X86] Remove slash in front of a CHECK line in a test.

llvm-svn: 313433

7 years ago[ubsan] Update ubsan_interface.inc
Vitaly Buka [Sat, 16 Sep 2017 01:21:04 +0000 (01:21 +0000)]
[ubsan] Update ubsan_interface.inc

llvm-svn: 313432

7 years agoRevert "Fix Bug 30978 by emitting cv file checksums."
Eric Beckmann [Sat, 16 Sep 2017 01:14:36 +0000 (01:14 +0000)]
Revert "Fix Bug 30978 by emitting cv file checksums."

This reverts commit 6389e7aa724ea7671d096f4770f016c3d86b0d54.

There is a bug in this implementation where the string value of the
checksum is outputted, instead of the actual hex bytes.  Therefore the
checksum is incorrect, and this prevent pdbs from being loaded by visual
studio.  Revert this until the checksum is emitted correctly.

llvm-svn: 313431

7 years ago[WebAssembly] Restore __builtin_wasm_rethrow builtin
Heejin Ahn [Sat, 16 Sep 2017 01:07:43 +0000 (01:07 +0000)]
[WebAssembly] Restore __builtin_wasm_rethrow builtin

Summary:
Restore the `__builtin_wasm_rethrow` builtin deleted in D37931. On second
thought, it appears it can be used to implement `__cxa_rethrow`.

Reviewers: dschuff, sunfish

Reviewed By: dschuff

Subscribers: jfb, sbc100, jgravelle-google

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

llvm-svn: 313430

7 years agoRevert lit changes related to lit.llvm module.
Zachary Turner [Sat, 16 Sep 2017 00:52:49 +0000 (00:52 +0000)]
Revert lit changes related to lit.llvm module.

It looks like this is going to be non-trivial to get working
in both Py2 and Py3, so for now I'm reverting until I have time
to fully test it under Python 3.

llvm-svn: 313429

7 years ago[lit] Fix another Python 3 error.
Zachary Turner [Sat, 16 Sep 2017 00:43:16 +0000 (00:43 +0000)]
[lit] Fix another Python 3 error.

Apparently we have a buildbot running Python 3.  This is going
to be fun :-/

llvm-svn: 313428

7 years ago[lit] Better check for integral value.
Zachary Turner [Sat, 16 Sep 2017 00:38:20 +0000 (00:38 +0000)]
[lit] Better check for integral value.

Some versions of python don't have 'long'.  Use numbers.Number
instead.

llvm-svn: 313427

7 years agoResubmit "[lit] Add a lit.llvm module that all llvm projects can use"
Zachary Turner [Sat, 16 Sep 2017 00:25:58 +0000 (00:25 +0000)]
Resubmit "[lit] Add a lit.llvm module that all llvm projects can use"

This was reverted alongside the revert of the lit/llvm-lit refactor,
but now that that has re-landed, I'm relanding this as well.

llvm-svn: 313426

7 years ago[docs] add Windows examples to ThinLTO.rst
Bob Haarman [Sat, 16 Sep 2017 00:16:13 +0000 (00:16 +0000)]
[docs] add Windows examples to ThinLTO.rst

Reviewers: pcc, ruiu

Reviewed By: ruiu

Subscribers: mehdi_amini, eraman, cfe-commits

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

llvm-svn: 313425

7 years ago[X86] Remove usages of vperm2f intrinsics from fast isel tests to match what clang...
Craig Topper [Fri, 15 Sep 2017 23:53:43 +0000 (23:53 +0000)]
[X86] Remove usages of vperm2f intrinsics from fast isel tests to match what clang generates after r313418.

llvm-svn: 313424

7 years agoTry to fix check-asan.
Peter Collingbourne [Fri, 15 Sep 2017 23:37:22 +0000 (23:37 +0000)]
Try to fix check-asan.

llvm-svn: 313423

7 years ago[llvm-cov] Fix a bot failure due to r313417
Vedant Kumar [Fri, 15 Sep 2017 23:14:22 +0000 (23:14 +0000)]
[llvm-cov] Fix a bot failure due to r313417

There's a type mismatch issue with the arguments to a call to std::min
introduced in r313417.

http://lab.llvm.org:8011/builders/clang-cmake-thumbv7-a15/builds/11174

llvm-svn: 313422

7 years ago[libFuzzer] add linux-specific test for gc-sections
Kostya Serebryany [Fri, 15 Sep 2017 23:07:18 +0000 (23:07 +0000)]
[libFuzzer] add linux-specific test for gc-sections

llvm-svn: 313421

7 years ago[X86] Remove GCCBuiltin names from perm2f128/perm2i128 intrinsics so we can provide...
Craig Topper [Fri, 15 Sep 2017 23:05:51 +0000 (23:05 +0000)]
[X86] Remove GCCBuiltin names from perm2f128/perm2i128 intrinsics so we can provide a custom implementation in clang.

llvm-svn: 313420

7 years agollvm-dwarfdump: Add support for -debug-info=<offset>.
Adrian Prantl [Fri, 15 Sep 2017 23:04:04 +0000 (23:04 +0000)]
llvm-dwarfdump: Add support for -debug-info=<offset>.

This is the first of many commits that enable selectively dumping just
one record from the debug info.

This reapplies r313412 with some extra qualification to appease GCC and MSVC.

llvm-svn: 313419

7 years ago[X86] Use native shuffle vector for the perm2f128 intrinsics
Craig Topper [Fri, 15 Sep 2017 23:00:59 +0000 (23:00 +0000)]
[X86] Use native shuffle vector for the perm2f128 intrinsics

This patch replaces the perm2f128 intrinsics with native shuffle vectors.

This uses a pretty simple approach to allocate source 0 to the lower half input and source 1 to the upper half input. Then its just a matter of filling in the indices to use either the lower or upper half of that specific source. This can result in the same source being used by both operands. InstCombine or SelectionDAGBuilder should be able to clean that up.

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

llvm-svn: 313418

7 years ago[llvm-cov] Avoid over-counting covered lines and regions
Vedant Kumar [Fri, 15 Sep 2017 23:00:02 +0000 (23:00 +0000)]
[llvm-cov] Avoid over-counting covered lines and regions

* Fix an unsigned integer overflow in the logic that computes the
  number of uncovered lines in a function.

* When aggregating region and line coverage summaries, take into account
  that different instantiations may have a different number of regions.

The new test case provides test coverage for both bugs. I also verified
this change by preparing a coverage report for a stage2 build of llc --
the new assertions should detect any outstanding over-counting bugs.

Fixes PR34613.

llvm-svn: 313417

7 years ago[llvm-cov] Make some summary info fields private. NFC.
Vedant Kumar [Fri, 15 Sep 2017 23:00:01 +0000 (23:00 +0000)]
[llvm-cov] Make some summary info fields private. NFC.

There's a bug in the way the line and region summary objects are merged.
It would have been less likely to occur if those objects kept some data
private.

llvm-svn: 313416

7 years ago[llvm-cov] Remove a redundant field. NFC.
Vedant Kumar [Fri, 15 Sep 2017 23:00:00 +0000 (23:00 +0000)]
[llvm-cov] Remove a redundant field. NFC.

The "NotCovered" fields in the region and line summary structs are
redundant. We should remove them to make the code clearer.

As a follow-up, the "NotCovered" entries should be removed from the
reports as well.

llvm-svn: 313415

7 years agoRevert r303378: Set IMAGE_DLL_CHARACTERISTICS_NO_BIND.
Rui Ueyama [Fri, 15 Sep 2017 22:49:13 +0000 (22:49 +0000)]
Revert r303378: Set IMAGE_DLL_CHARACTERISTICS_NO_BIND.

r303378 was submitted because r303374 (Merge IAT and ILT) made lld's
output incompatible with the Binding feature. Now that r303374 was
reverted, we do not need to keep this change.

Pointed out by pcc.

llvm-svn: 313414

7 years agoRevert "llvm-dwarfdump: Add support for -debug-info=<offset>."
Adrian Prantl [Fri, 15 Sep 2017 22:47:16 +0000 (22:47 +0000)]
Revert "llvm-dwarfdump: Add support for -debug-info=<offset>."

This reverts commit r313412 because of a g++ incompatibility.

llvm-svn: 313413

7 years agollvm-dwarfdump: Add support for -debug-info=<offset>.
Adrian Prantl [Fri, 15 Sep 2017 22:37:56 +0000 (22:37 +0000)]
llvm-dwarfdump: Add support for -debug-info=<offset>.

This is the first of many commits that enable selectively dumping just
one record from the debug info.

llvm-svn: 313412

7 years ago[libFuzzer] test fix
Kostya Serebryany [Fri, 15 Sep 2017 22:29:20 +0000 (22:29 +0000)]
[libFuzzer] test fix

llvm-svn: 313411

7 years ago[TargetTransformInfo] Static alloca has 0 cost
Guozhi Wei [Fri, 15 Sep 2017 22:28:12 +0000 (22:28 +0000)]
[TargetTransformInfo] Static alloca has 0 cost

Static alloca usually doesn't generate any machine instructions, so it has 0 cost.

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

llvm-svn: 313410

7 years ago[SLP] Revert r312791 and other necessary commits, except for TTI and
Chandler Carruth [Fri, 15 Sep 2017 22:23:27 +0000 (22:23 +0000)]
[SLP] Revert r312791 and other necessary commits, except for TTI and
CostModel.

The original patch added support for horizontal min/max reductions to
the SLP vectorizer.

This patch causes LLVM to miscompile fairly simple signed min
reductions. I have attached a test progrom to http://llvm.org/PR34635
that shows the behavior change after this patch. We found this in a test
for the open source Eigen library, but also in other code.

Unfortunately, the revert is moderately challenging. It required
reverting:
r313042: [SLP] Test with multiple uses of conditional op and wrong parent.
r312853: [SLP] Fix buildbots, NFC.
r312793: [SLP] Fix the warning about paths not returning the value, NFC.
r312791: [SLP] Support for horizontal min/max reduction.

And even then, I had to completely skip reverting the changes to TTI and
CostModel because r312832 rewrote so much of this code. Plus, the cost
modeling changes aren implicated in the miscompile, so they should be
fine and will just not be used until this gets re-introduced.

llvm-svn: 313409

7 years agoRemove redundant parentheses.
Rui Ueyama [Fri, 15 Sep 2017 22:14:59 +0000 (22:14 +0000)]
Remove redundant parentheses.

llvm-svn: 313408

7 years agoResubmit "[lit] Force site configs to run before source-tree configs"
Zachary Turner [Fri, 15 Sep 2017 22:10:46 +0000 (22:10 +0000)]
Resubmit "[lit] Force site configs to run before source-tree configs"

This is a resubmission of r313270.  It broke standalone builds of
compiler-rt because we were not correctly generating the llvm-lit
script in the standalone build directory.

The fixes incorporated here attempt to find llvm/utils/llvm-lit
from the source tree returned by llvm-config.  If present, it
will generate llvm-lit into the output directory.  Regardless,
the user can specify -DLLVM_EXTERNAL_LIT to point to a specific
lit.py on their file system.  This supports the use case of
someone installing lit via a package manager.  If it cannot find
a source tree, and -DLLVM_EXTERNAL_LIT is either unspecified or
invalid, then we print a warning that tests will not be able
to run.

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

llvm-svn: 313407

7 years ago[libFuzzer] minor refactoring, NFC
Kostya Serebryany [Fri, 15 Sep 2017 22:10:36 +0000 (22:10 +0000)]
[libFuzzer] minor refactoring, NFC

llvm-svn: 313406

7 years agoName the sentinel value used for the location number of the undefined register NFC
Reid Kleckner [Fri, 15 Sep 2017 22:08:50 +0000 (22:08 +0000)]
Name the sentinel value used for the location number of the undefined register NFC

llvm-svn: 313405

7 years agoTest patch to check my commit access
Jake Ehrlich [Fri, 15 Sep 2017 22:04:09 +0000 (22:04 +0000)]
Test patch to check my commit access

llvm-svn: 313404

7 years ago[libFuzzer] reduce the size of the merge control file by not dumping redundant featur...
Kostya Serebryany [Fri, 15 Sep 2017 22:02:26 +0000 (22:02 +0000)]
[libFuzzer] reduce the size of the merge control file by not dumping redundant features into it

llvm-svn: 313403

7 years agoRemove __builtin_wasm_rethrow builtin
Heejin Ahn [Fri, 15 Sep 2017 22:01:22 +0000 (22:01 +0000)]
Remove __builtin_wasm_rethrow builtin

Summary:
Remove `__builtin_wasm_rethrow` builtin. I thought it was required to implement
`__cxa_rethrow` function in libcxxabi, but it turned out it will be using
`__builtin_wasm_throw` instead.

Reviewers: dschuff, jgravelle-google

Reviewed By: jgravelle-google

Subscribers: jfb, sbc100, jgravelle-google

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

llvm-svn: 313402

7 years ago[debuginfo-tests] Add string NRVO test for PR34513
Reid Kleckner [Fri, 15 Sep 2017 21:59:39 +0000 (21:59 +0000)]
[debuginfo-tests] Add string NRVO test for PR34513

It should pass in -O0 and -O1 after r313400 and r313399.

llvm-svn: 313401

7 years ago[DebugInfo] Insert DW_OP_deref when spilling indirect DBG_VALUEs
Reid Kleckner [Fri, 15 Sep 2017 21:54:38 +0000 (21:54 +0000)]
[DebugInfo] Insert DW_OP_deref when spilling indirect DBG_VALUEs

Summary:
This comes up in optimized debug info for C++ programs that pass and
return objects indirectly by address. In these programs,
llvm.dbg.declare survives optimization, which causes us to emit indirect
DBG_VALUE instructions. The fast register allocator knows to insert
DW_OP_deref when spilling indirect DBG_VALUE instructions, but the
LiveDebugVariables did not until this change.

This fixes part of PR34513. I need to look into why this doesn't work at
-O0 and I'll send follow up patches to handle that.

Reviewers: aprantl, dblaikie, probinson

Subscribers: qcolombet, hiraditya, llvm-commits

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

llvm-svn: 313400

7 years ago[DebugInfo] Add missing DW_OP_deref when an NRVO pointer is spilled
Reid Kleckner [Fri, 15 Sep 2017 21:49:56 +0000 (21:49 +0000)]
[DebugInfo] Add missing DW_OP_deref when an NRVO pointer is spilled

Summary:
Fixes PR34513.

Indirect DBG_VALUEs typically come from dbg.declares of non-trivially
copyable C++ objects that must be passed by address. We were already
handling the case where the virtual register gets allocated to a
physical register and is later spilled. That's what usually happens for
normal parameters that aren't NRVO variables: they usually appear in
physical register parameters, and are spilled later in the function,
which would correctly add deref.

NRVO variables are different because the dbg.declare can come much later
after earlier instructions cause the incoming virtual register to be
spilled.

Also, clean up this code. We only need to look at the first operand of a
DBG_VALUE, which eliminates the operand loop.

Reviewers: aprantl, dblaikie, probinson

Subscribers: MatzeB, qcolombet, llvm-commits, hiraditya

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

llvm-svn: 313399

7 years ago[AutoUpgrade] Fix a compatibility issue with module flag
Steven Wu [Fri, 15 Sep 2017 21:12:14 +0000 (21:12 +0000)]
[AutoUpgrade] Fix a compatibility issue with module flag

Summary:
After r304661, module flag to record objective-c image info section is
encoded without whitespaces after comma. The new name is equivalent to
the old one, except that when LTO a module built by old compiler and a
module built by a new compiler, it will fail with conflicting values.

Fix the issue by removing whitespaces in bitcode upgrade path.

rdar://problem/34416934

Reviewers: compnerd

Reviewed By: compnerd

Subscribers: mehdi_amini, hans, llvm-commits

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

llvm-svn: 313398

7 years agoFix build for LLVM unittests
Reid Kleckner [Fri, 15 Sep 2017 21:12:13 +0000 (21:12 +0000)]
Fix build for LLVM unittests

llvm-svn: 313397

7 years agoUpdate the monorepo URL in a lld's document.
Rui Ueyama [Fri, 15 Sep 2017 21:04:43 +0000 (21:04 +0000)]
Update the monorepo URL in a lld's document.

llvm-svn: 313396

7 years ago[WebAssembly] MC: Create wasm data segments based on MCSections
Sam Clegg [Fri, 15 Sep 2017 20:54:59 +0000 (20:54 +0000)]
[WebAssembly] MC: Create wasm data segments based on MCSections

This means that we can honor -fdata-sections rather than
always creating a segment for each symbol.

It also allows for a followup change to add .init_array and friends.

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

llvm-svn: 313395

7 years ago[ConstantFold] Return the correct type when folding a GEP with vector indices.
Davide Italiano [Fri, 15 Sep 2017 20:53:05 +0000 (20:53 +0000)]
[ConstantFold] Return the correct type when folding a GEP with vector indices.

As Eli pointed out (and I got wrong in the first place), langref says: "The
getelementptr returns a vector of pointers, instead of a single address, when one
or more of its arguments is a vector. In such cases, all vector arguments should
have the same number of elements, and every scalar argument will be effectively
broadcast into a vector during address calculation."

Costantfold for gep doesn't really take in account this paragraph, returning a
pointer instead of a vector of pointer which triggers an assertion in RAUW,
as we're trying to replace values with mistmatching types.

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

llvm-svn: 313394

7 years agoChange encodeU/SLEB128 to pad to certain number of bytes
Sam Clegg [Fri, 15 Sep 2017 20:34:47 +0000 (20:34 +0000)]
Change encodeU/SLEB128 to pad to certain number of bytes

Previously the 'Padding' argument was the number of padding
bytes to add. However most callers that use 'Padding' know
how many overall bytes they need to write.  With the previous
code this would mean encoding the LEB once to find out how
many bytes it would occupy and then using this to calulate
the 'Padding' value.

See: https://reviews.llvm.org/D36595

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

llvm-svn: 313393

7 years ago[X86] Disable _mm512_maskz_set1_epi64 intrinsic on 32-bit targets to prevent a backen...
Craig Topper [Fri, 15 Sep 2017 20:27:59 +0000 (20:27 +0000)]
[X86] Disable _mm512_maskz_set1_epi64 intrinsic on 32-bit targets to prevent a backend isel failure.

The __builtin_ia32_pbroadcastq512_mem_mask we were previously trying to use in 32-bit mode is not implemented in the x86 backend and causes isel to fail in release builds. In debug builds it fails even earlier during legalization with an llvm_unreachable.

While there add the missing test case for this intrinsic for this for 64-bit mode.

This fixes PR34631. D37668 should be able to recover this for 32-bit mode soon. But I wanted to fix the crash ahead of that.

llvm-svn: 313392

7 years agoubsan: Unbreak ubsan_cxx runtime library on Windows.
Peter Collingbourne [Fri, 15 Sep 2017 20:24:12 +0000 (20:24 +0000)]
ubsan: Unbreak ubsan_cxx runtime library on Windows.

This was originally broken by r258744 which introduced a weak reference
from ubsan to ubsan_cxx. This reference does not work directly on
Windows because COFF has no direct concept of weak symbols. The fix is
to use /alternatename to create a weak external reference to ubsan_cxx.

Also fix the definition (and the name, so that we drop cached values)
of the cmake flag that controls whether to build ubsan_cxx. Now the
user-controllable flag is always on, and we turn it off internally
depending on whether we support building it.

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

llvm-svn: 313391

7 years agoThis patch fixes https://bugs.llvm.org/show_bug.cgi?id=32352
Vivek Pandya [Fri, 15 Sep 2017 20:10:09 +0000 (20:10 +0000)]
This patch fixes https://bugs.llvm.org/show_bug.cgi?id=32352
It enables OptimizationRemarkEmitter::allowExtraAnalysis and MachineOptimizationRemarkEmitter::allowExtraAnalysis to return true not only for -fsave-optimization-record but when specific remarks are requested with
command line options.
The diagnostic handler used to be callback now this patch adds a class
DiagnosticHandler. It has virtual method to provide custom diagnostic handler
and methods to control which particular remarks are enabled.
However LLVM-C API users can still provide callback function for diagnostic handler.

llvm-svn: 313390

7 years agoThis patch fixes https://bugs.llvm.org/show_bug.cgi?id=32352 LLVM code change is...
Vivek Pandya [Fri, 15 Sep 2017 20:09:55 +0000 (20:09 +0000)]
This patch fixes https://bugs.llvm.org/show_bug.cgi?id=32352 LLVM code change is as per https://reviews.llvm.org/D33514

llvm-svn: 313389

7 years ago[llvm] Fix some typos. NFC.
Mandeep Singh Grang [Fri, 15 Sep 2017 20:01:43 +0000 (20:01 +0000)]
[llvm] Fix some typos. NFC.

Reviewers: mcrosier

Reviewed By: mcrosier

Subscribers: mcrosier, llvm-commits

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

llvm-svn: 313388

7 years agoThis reverts r313381
Vivek Pandya [Fri, 15 Sep 2017 19:53:54 +0000 (19:53 +0000)]
This reverts r313381

llvm-svn: 313387

7 years ago[Sema] Error out early for tags defined inside an enumeration.
Volodymyr Sapsai [Fri, 15 Sep 2017 19:51:42 +0000 (19:51 +0000)]
[Sema] Error out early for tags defined inside an enumeration.

This fixes PR28903 by avoiding access check for inner enum constant. We
are performing access check because one enum constant references another
and because enum is defined in CXXRecordDecl. But access check doesn't
work because FindDeclaringClass doesn't expect more than one EnumDecl
and because inner enum has access AS_none due to not being an immediate
child of a record.

The change detects an enum is defined in wrong place and allows to skip
parsing its body. Access check is skipped together with body parsing.
There was no crash in C, added test case to cover the new error.

rdar://problem/28530809

Reviewers: rnk, doug.gregor, rsmith

Reviewed By: doug.gregor

Subscribers: cfe-commits

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

llvm-svn: 313386

7 years ago[Analyzer] Check function name size before indexing.
George Karpenkov [Fri, 15 Sep 2017 19:51:26 +0000 (19:51 +0000)]
[Analyzer] Check function name size before indexing.

https://reviews.llvm.org/D37908

llvm-svn: 313385

7 years ago[WebAssembly] Pass ArrayRef rather than SmallVector
Sam Clegg [Fri, 15 Sep 2017 19:50:44 +0000 (19:50 +0000)]
[WebAssembly] Pass ArrayRef rather than SmallVector

This is more flexible and less verbose.

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

llvm-svn: 313384

7 years agoImprove comment
Adam Nemet [Fri, 15 Sep 2017 19:38:01 +0000 (19:38 +0000)]
Improve comment

llvm-svn: 313383

7 years agoThis patch fixes https://bugs.llvm.org/show_bug.cgi?id=32352
Vivek Pandya [Fri, 15 Sep 2017 19:30:59 +0000 (19:30 +0000)]
This patch fixes https://bugs.llvm.org/show_bug.cgi?id=32352
It enables OptimizationRemarkEmitter::allowExtraAnalysis and MachineOptimizationRemarkEmitter::allowExtraAnalysis to return true not only for -fsave-optimization-record but when specific remarks are requested with
command line options.
The diagnostic handler used to be callback now this patch adds a class
DiagnosticHandler. It has virtual method to provide custom diagnostic handler
and methods to control which particular remarks are enabled.
However LLVM-C API users can still provide callback function for diagnostic handler.

llvm-svn: 313382

7 years ago[WebAssembly] MC: Fix crash in getProvitionalValue on weak references
Sam Clegg [Fri, 15 Sep 2017 19:22:01 +0000 (19:22 +0000)]
[WebAssembly] MC: Fix crash in getProvitionalValue on weak references

- Create helper function for resolving weak references.
- Add test that preproduces the crash.

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

llvm-svn: 313381

7 years agoFix selecting legal types in TypeInfer::getLegalTypes
Krzysztof Parzyszek [Fri, 15 Sep 2017 18:58:07 +0000 (18:58 +0000)]
Fix selecting legal types in TypeInfer::getLegalTypes

Collect all legal types for all modes.

llvm-svn: 313380

7 years agocfi: Enable ThinLTO tests on Windows.
Peter Collingbourne [Fri, 15 Sep 2017 18:55:35 +0000 (18:55 +0000)]
cfi: Enable ThinLTO tests on Windows.

We now avoid using absolute symbols on Windows (D37407 and D37408),
so this should work.

Fixes PR32770.

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

llvm-svn: 313379

7 years agoubsan: Stop building the DLL version of the runtime library on Windows.
Peter Collingbourne [Fri, 15 Sep 2017 18:54:37 +0000 (18:54 +0000)]
ubsan: Stop building the DLL version of the runtime library on Windows.

As far as I know we never use it.

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

llvm-svn: 313378

7 years ago[libc++] Account for Microsoft CRT const overloads
Shoaib Meenai [Fri, 15 Sep 2017 18:49:34 +0000 (18:49 +0000)]
[libc++] Account for Microsoft CRT const overloads

Microsoft's CRT already provides the const overloads, and it defines the
`_CRT_CONST_CORRECT_OVERLOADS` macro to indicate their presence. Check
for this macro before attempting to define our own const-correct
overloads, to avoid compiler warnings about casts dropping const
qualifiers.

llvm-svn: 313377

7 years agoRevert r313343 "[X86] PR32755 : Improvement in CodeGen instruction selection for...
Hans Wennborg [Fri, 15 Sep 2017 18:40:26 +0000 (18:40 +0000)]
Revert r313343 "[X86] PR32755 : Improvement in CodeGen instruction selection for LEAs."

This caused PR34629: asserts firing when building Chromium. It also broke some
buildbots building test-suite as reported on the commit thread.

> Summary:
>    1/  Operand folding during complex pattern matching for LEAs has been
>        extended, such that it promotes Scale to accommodate similar operand
>        appearing in the DAG.
>        e.g.
>           T1 = A + B
>           T2 = T1 + 10
>           T3 = T2 + A
>        For above DAG rooted at T3, X86AddressMode will no look like
>           Base = B , Index = A , Scale = 2 , Disp = 10
>
>    2/  During OptimizeLEAPass down the pipeline factorization is now performed over LEAs
>        so that if there is an opportunity then complex LEAs (having 3 operands)
>        could be factored out.
>        e.g.
>           leal 1(%rax,%rcx,1), %rdx
>           leal 1(%rax,%rcx,2), %rcx
>        will be factored as following
>           leal 1(%rax,%rcx,1), %rdx
>           leal (%rdx,%rcx)   , %edx
>
>    3/ Aggressive operand folding for AM based selection for LEAs is sensitive to loops,
>       thus avoiding creation of any complex LEAs within a loop.
>
> Reviewers: lsaba, RKSimon, craig.topper, qcolombet
>
> Reviewed By: lsaba
>
> Subscribers: spatel, igorb, llvm-commits
>
> Differential Revision: https://reviews.llvm.org/D35014

llvm-svn: 313376

7 years agoFix indentation.
Adrian Prantl [Fri, 15 Sep 2017 18:35:37 +0000 (18:35 +0000)]
Fix indentation.

llvm-svn: 313375

7 years agoFix Bug 30978 by emitting cv file checksums.
Eric Beckmann [Fri, 15 Sep 2017 18:20:28 +0000 (18:20 +0000)]
Fix Bug 30978 by emitting cv file checksums.

Summary:
The checksums had already been placed in the IR, this patch allows
MCCodeView to actually write it out to an MCStreamer.

Subscribers: llvm-commits, hiraditya

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

llvm-svn: 313374

7 years ago[X86] Prefer VPERMQ over VPERM2F128 for any unary shuffle, not just the ones that...
Craig Topper [Fri, 15 Sep 2017 18:11:13 +0000 (18:11 +0000)]
[X86] Prefer VPERMQ over VPERM2F128 for any unary shuffle, not just the ones that can be done with a insertf128

The early out for AVX2 in lowerV2X128VectorShuffle is positioned in a weird spot below some shuffle mask equivalency checks.

But I think we want to allow VPERMQ for any unary shuffle.

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

llvm-svn: 313373

7 years agoKeep some relocations with undefined weak symbols.
Rafael Espindola [Fri, 15 Sep 2017 18:05:02 +0000 (18:05 +0000)]
Keep some relocations with undefined weak symbols.

This fixes pr34301.

As the bug points out, we want to keep some relocations with undefined
weak symbols. This means that we cannot always claim that these
symbols are not preemptible as we do now.

Unfortunately, we cannot also just always claim that they are
preemptible. Doing so would, for example, cause us to try to create a
plt entry when we don't even have a dynamic symbol table.

What almost works is to say that weak undefined symbols are
preemptible if and only if we have a dynamic symbol table. Almost
because we don't want to fail the build trying to create a copy
relocation to a weak undefined.

llvm-svn: 313372

7 years agoRemove a couple of warnings pointed out by Ted Woodward.
Jim Ingham [Fri, 15 Sep 2017 17:54:37 +0000 (17:54 +0000)]
Remove a couple of warnings pointed out by Ted Woodward.

llvm-svn: 313371

7 years agollvm-dwarfdump: Factor out the printing of the section header (NFC)
Adrian Prantl [Fri, 15 Sep 2017 17:39:50 +0000 (17:39 +0000)]
llvm-dwarfdump: Factor out the printing of the section header (NFC)

llvm-svn: 313370