Commit Graph

298356 Commits

Author SHA1 Message Date
Martin Storsjo 1e8edd13ee [llvm-ar] Support * as comment char in MRI scripts
MRI scripts have two comment chars, * and ;, but only the latter was
supported before.

Also allow leading spaces before comment chars (and before any command
string), and allow comments after a command.

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

llvm-svn: 341571
2018-09-06 18:10:45 +00:00
Alexey Bataev d2c1dd5902 [OPENMP] Fix PR38823: Do not emit vtable if it is not used in target
context.

If the explicit template instantiation definition defined outside of the
target context, its vtable should not be marked as used. This is true
for other situations where the compiler want to emit vtables
unconditionally.

llvm-svn: 341570
2018-09-06 17:56:28 +00:00
Jonathan Metzman c239482207 [libfuzzer] Correct typo in comment (test commit).
Differential Revision: https://reviews.llvm.org/D51739

llvm-svn: 341569
2018-09-06 17:50:01 +00:00
Jonas Devlieghere 5e322f5125 [dsymutil] Reduce peak memory usage for the single threaded execution.
Keeping the compile units in memory is expensive. For the single
threaded case we allocate them in the analyze part and deallocate them
again once we've finished cloning. This poses a problem in the single
threaded case where we did all the analysis first followed by all the
cloning. This meant we had all the link context in memory right after
analyzing finished.

This patch changes the way we order work in the single threaded case.
Instead of doing all the analysis and cloning in serial, we now
interleave the two so we can deallocate the memory as soon as a file is
processed. The result is binary identical and peak memory usage went
down from 13.43GB to 5.73GB for a debug build of trunk clang.

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

llvm-svn: 341568
2018-09-06 17:31:59 +00:00
Matt Arsenault df84dc6979 AMDGPU: Remove old hack for function addresses
llvm-svn: 341567
2018-09-06 17:23:24 +00:00
Erik Pilkington f85e391063 [Sema] Clean up some __builtin_*_chk diagnostics
Namely, print the likely macro name when it's used, and include the actual
computed sizes in the diagnostic message, which are sometimes not obvious.

rdar://43909200

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

llvm-svn: 341566
2018-09-06 17:19:33 +00:00
Michael Berg 1b34b01a8e [NFC] - in preparation for adding nsw, nuw and exact as flags to MI
llvm-svn: 341565
2018-09-06 17:07:29 +00:00
Pavel Labath c1e0c34e45 Re-commit "Enable DWARF accelerator tables by default when tuning for lldb (-glldb => -gpubnames)""
This recommits r341472, which was reverted due to test failures on macos bots.

The issue was that a macos target implies -glldb which, together with
this patch added a -gpubnames switch where there previously wasn't one.
The intentions of those checks was to check that -gpubnames is not
emitted by default so I add an explicit -ggdb arg to those command lines
to get same behavior on all platforms (the fact that -glldb *does* set
-gpubnames is tested by a separate test).

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

llvm-svn: 341564
2018-09-06 17:01:45 +00:00
Jonas Hahnfeld 21e3ee0afe [libomptarget] Remove two unneeded includes, NFCI.
Follow-up to r340542 and r340767.

llvm-svn: 341563
2018-09-06 17:00:57 +00:00
Max Moroz a39da2f8ca [libfuzzer] Fix fuzzer-oom.test on windows and reenable it.
Summary: Patch by Jonathan Metzman (@metzman).

Reviewers: Dor1s, morehouse

Reviewed By: Dor1s

Subscribers: delcypher, llvm-commits, #sanitizers

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

llvm-svn: 341562
2018-09-06 16:48:18 +00:00
Zachary Turner d62d052c70 Fix a warning.
llvm-svn: 341561
2018-09-06 16:34:56 +00:00
A Bergen 51fdaba4ad Reverting r 341390 because it is causing test failures on GreenDragon.
http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental/52810/

llvm-svn: 341560
2018-09-06 16:29:40 +00:00
Sanjay Patel 93bd15a005 [InstCombine] add xor+not folds
This fold is needed to avoid a regression when we try
to recommit rL300977. 
We can't see the most basic win currently because 
demanded bits changes the patterns:
https://rise4fun.com/Alive/plpp

llvm-svn: 341559
2018-09-06 16:23:40 +00:00
JF Bastien 2920061105 ARM64: improve non-zero memset isel by ~2x
Summary:
I added a few ARM64 memset codegen tests in r341406 and r341493, and annotated
where the generated code was bad. This patch fixes the majority of the issues by
requesting that a 2xi64 vector be used for memset of 32 bytes and above.

The patch leaves the former request for f128 unchanged, despite f128
materialization being suboptimal: doing otherwise runs into other asserts in
isel and makes this patch too broad.

This patch hides the issue that was present in bzero_40_stack and bzero_72_stack
because the code now generates in a better order which doesn't have the store
offset issue. I'm not aware of that issue appearing elsewhere at the moment.

<rdar://problem/44157755>

Reviewers: t.p.northover, MatzeB, javed.absar

Subscribers: eraman, kristof.beyls, chrib, dexonsmith, llvm-commits

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

llvm-svn: 341558
2018-09-06 16:03:32 +00:00
Sanjay Patel 99d732052f [InstCombine] add tests for xor-not; NFC
These tests demonstrate a missing fold that would
also be needed to avoid a regression when we try 
to recommit rL300977.

llvm-svn: 341557
2018-09-06 15:35:01 +00:00
Simon Pilgrim 58310ec11f Remove unnecessary semicolon to silence -Wpedantic warning. NFCI.
llvm-svn: 341556
2018-09-06 15:16:17 +00:00
Simon Pilgrim 6088e85177 Remove unnecessary semicolon to silence -Wpedantic warning. NFCI.
llvm-svn: 341555
2018-09-06 15:15:28 +00:00
Alexander Potapenko 7f270fcf0a [MSan] store origins for variadic function parameters in __msan_va_arg_origin_tls
Add the __msan_va_arg_origin_tls TLS array to keep the origins for variadic function parameters.
Change the instrumentation pass to store parameter origins in this array.

This is a reland of r341528.

test/msan/vararg.cc doesn't work on Mips, PPC and AArch64 (because this
patch doesn't touch them), XFAIL these arches.
Also turned out Clang crashed on i80 vararg arguments because of
incorrect origin type returned by getOriginPtrForVAArgument() - fixed it
and added a test.

llvm-svn: 341554
2018-09-06 15:14:36 +00:00
Andrew Savonichev 05a15afe6f [OpenCL] Relax diagnostics on OpenCL access qualifiers
Summary:
Emit warning for multiple access qualifiers if they do not conflict.

Patch by Alexey Bader

Reviewers: Anastasia, yaxunl

Reviewed By: Anastasia

Subscribers: asavonic, bader, cfe-commits

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

llvm-svn: 341553
2018-09-06 15:10:26 +00:00
Kirill Bobyrev 049b2d4345 [clangd] Fix Dex initialization
This patch sets URI schemes of Dex to SymbolCollector's default schemes
in case callers tried to pass empty list of schemes. This was the case
for initialization in Clangd main and was a reason of incorrect
behavior.

Also, it fixes a bug with missed `continue;` after spotting invalid URI
scheme conversion.

llvm-svn: 341552
2018-09-06 15:10:10 +00:00
Louis Dionne 38895a0d80 [libc++] Add a link to the Release notes from the main libc++ documentation
llvm-svn: 341551
2018-09-06 15:05:43 +00:00
Louis Dionne 0fb7c99001 [libcxx] Add ReleaseNotes.rst file for release notes
llvm-svn: 341550
2018-09-06 14:46:22 +00:00
Sam McCall 026d8a20ec Revert "[DebugInfo] Generate debug information for labels. (Fix PR37395)"
This reverts commit r341519, which generates debug info that causes
backend crashes. (with -split-dwarf-file)

Details in https://reviews.llvm.org/D50495

llvm-svn: 341549
2018-09-06 14:27:40 +00:00
Diogo N. Sampaio 95f9f6a7cd Fix march triple used test from rL341475
Change the march triple of test files, possible fixing
test failures due rL341475

llvm-svn: 341548
2018-09-06 14:13:10 +00:00
Christian Bruel 6ccc4a7c20 Fix the -print-multi-directory flag to print the selected multilib.
Summary: Fix -print-multi-directory to print the selected multilib

Reviewers: jroelofs

Reviewed By: jroelofs

Subscribers: jroelofs, timshen, thakis, srhines, cfe-commits

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

llvm-svn: 341547
2018-09-06 14:03:44 +00:00
Alex Bradbury fea4ac01c5 [RISCV][NFC] Rework test/MC/RISCV/rv{32,64}* to allow testing of symbol operands
Standardise on check lines:
* CHECK-ASM
* CHECK-OBJ
* CHECK-ASM-AND-OBJ

This allows for the addition of tests involving symbol operands, which will
not result in identical instructions in both assembly and disassembled object 
output.

This commit doesn't exploit this reworking to increase test coverage of symbol
operands - that will come in a future patch.

llvm-svn: 341546
2018-09-06 13:41:04 +00:00
Sanjay Patel 1a00ffd656 [InstCombine] fix formatting in SimplifyDemandedVectorElts->Select; NFCI
I'm preparing to add the same functionality both here and to the DAG 
version of this code in D51696 / D51433, so try to make those cases 
as similar as possible to avoid bugs.

llvm-svn: 341545
2018-09-06 13:19:22 +00:00
Kirill Bobyrev afbf31854d [clangd] NFC: Use TopN instead of std::priority_queue
Quality.cpp defines a structure for convenient storage of Top N items,
it should be used instead of the `std::priority_queue` with slightly
obscure semantics.

This patch does not affect functionality.

Reviewed By: sammccall

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

llvm-svn: 341544
2018-09-06 13:15:03 +00:00
Kirill Bobyrev e4ee0213d4 [clangd] NFC: mark single-parameter constructors explicit
Code health: prevent implicit conversions to user-defined types.

Reviewed By: sammccall

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

llvm-svn: 341543
2018-09-06 13:06:04 +00:00
Kirill Bobyrev 19a9461e5f [clangd] Implement proximity path boosting for Dex
This patch introduces `PathURI` Search Token kind and utilizes it to
uprank symbols which are defined in files with small distance to the
directory where the fuzzy find request is coming from (e.g. files user
is editing).

Reviewed By: ioeric

Reviewers: ioeric, sammccall

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

llvm-svn: 341542
2018-09-06 12:54:43 +00:00
Alexander Potapenko ac6595bd53 [MSan] revert r341528 to unbreak the bots
llvm-svn: 341541
2018-09-06 12:19:27 +00:00
Tim Northover 8f141016ee ARM: wrap call to __clzsi2 so that the name is correct on MachO.
MachO symbols are prefixed with an extra '_' (that's 3 in total for this
function), so assembly calls have to go through a wrapper to insert any prefix
needed.

llvm-svn: 341540
2018-09-06 12:13:46 +00:00
Andrew Savonichev d353e6d748 [OpenCL] Disallow negative attribute arguments
Summary:
Negative arguments in kernel attributes are silently bitcast'ed to
unsigned, for example:

    __attribute__((reqd_work_group_size(1, -1, 1)))
    __kernel void k() {}

is a complete equivalent of:

    __attribute__((reqd_work_group_size(1, 4294967294, 1)))
    __kernel void k() {}

This is likely an error, so the patch forbids negative arguments in
several OpenCL attributes. Users who really want 4294967294 can still
use it as an unsigned representation.

Reviewers: Anastasia, yaxunl, bader

Reviewed By: Anastasia, yaxunl, bader

Subscribers: bader, cfe-commits

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

llvm-svn: 341539
2018-09-06 11:54:09 +00:00
Ilya Biryukov 5c4d6e66f0 [clangd] Fix data race in async fuzzyFind tests.
llvm-svn: 341538
2018-09-06 11:04:56 +00:00
Florian Hahn c51d08825f [LoopInterchange] Cleanup unused variables.
llvm-svn: 341537
2018-09-06 10:41:01 +00:00
Sven van Haastregt abe3295cbd Fix argument type in MachineInstr::hasPropertyInBundle
The MCID::Flag enumeration now has more than 32 items, this means that
the hasPropertyBundle argument 'Mask' can overflow.

This patch changes the argument to be 64 bits instead.

Patch by Mikael Nilsson.

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

llvm-svn: 341536
2018-09-06 10:25:59 +00:00
Raphael Isemann ee65d57321 Reland [ClangUserExpression][NFC] Removed unused code
The GetLanguageForExpr has side effects, so we can't remove this
call without breaking the completion mechanism. However, we can
keep the change that gets rid of this unnecessary variable.

llvm-svn: 341535
2018-09-06 10:24:11 +00:00
Eric Liu d25f1214a8 [clangd] Set SymbolID for sema macros so that they can be merged with index macros.
Reviewers: sammccall

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits

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

llvm-svn: 341534
2018-09-06 09:59:37 +00:00
Florian Hahn 236f6feb8f [LoopInterchange] Move preheader creation to transform stage and simplify.
There is no need to create preheaders in the analysis stage, we only
need them when adjusting the branches. Also, the only cases we need to
create our own preheaders is when they have more than 1 predecessors or
PHI nodes (even with only 1 predecessor, we could have an LCSSA phi
node). I have simplified the conditions and added some assertions to be
sure. Because we know the inner and outer loop need to be tightly
nested, it is sufficient to check if the inner loop preheader is the
outer loop header to check if we need to create a new preheader.

Reviewers: efriedma, mcrosier, karthikthecool

Reviewed By: efriedma

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

llvm-svn: 341533
2018-09-06 09:57:27 +00:00
Raphael Isemann 20c88ebf57 Revert "[ClangUserExpression][NFC] Removed unused code"
GetLanguageForExpr has side effects, so this actually breaks
the completion. Should fix TestExprCompletion.

llvm-svn: 341532
2018-09-06 09:42:44 +00:00
Max Kazantsev 6afebe1d30 [NFC] Simplify inner structure of InstructionPrecedenceTracking
Currently it has a set KnownBlocks that marks blocks as having cached
answers and a map FirstSpecialInsts that maps these blocks to first
special instructions in them. The value in the map is always non-null,
and for blocks that are known to have no special instructions the map
does not have an instance.

This patch removes KnownBlocks as obsolete. Instead, for blocks that
are known to have no special instructions, we just put a nullptr value.
This makes the code much easier to read.

llvm-svn: 341531
2018-09-06 09:29:42 +00:00
Alexander Potapenko 1a10ae0def [MSan] store origins for variadic function parameters in __msan_va_arg_origin_tls
Add the __msan_va_arg_origin_tls TLS array to keep the origins for
variadic function parameters.
Change the instrumentation pass to store parameter origins in this array.

llvm-svn: 341528
2018-09-06 08:50:11 +00:00
David Green e6918ca2b3 [SLC] Add an alignment to CreateGlobalString
Previously the alignment on the newly created global strings was not set,
meaning that DataLayout::getPreferredAlignment was free to overalign it
to 16 bytes. This caused unnecessary code bloat with the padding between
variables.

The main example of this happening was the printf->puts optimisation in
SimplifyLibCalls, but as the change here is made in
IRBuilderBase::CreateGlobalString, other globals using this will now be
aligned too.

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

llvm-svn: 341527
2018-09-06 08:42:17 +00:00
Max Kazantsev 8a9e059e5c Return "[NFC] Add severe validation of InstructionPrecedenceTracking"
This validation patch has been reverted as rL341147 because of conserns raised by
@reames. This revision returns it as is to raise a discussion and address the concerns.

Differential Revision: https://reviews.llvm.org/D51523
Reviewed By: reames

llvm-svn: 341526
2018-09-06 08:33:02 +00:00
Alexander Potapenko d518c5fc87 [MSan] Make sure variadic function arguments do not overflow __msan_va_arg_tls
Turns out that calling a variadic function with too many (e.g. >100 i64's)
arguments overflows __msan_va_arg_tls, which leads to smashing other TLS
data with function argument shadow values.

getShadow() already checks for kParamTLSSize and returns clean shadow if
the argument does not fit, so just skip storing argument shadow for such
arguments.

llvm-svn: 341525
2018-09-06 08:21:54 +00:00
Hsiangkai Wang 0a875b2f15 [DebugInfo] Generate debug information for labels. (Fix PR37395)
Generate DILabel metadata and call llvm.dbg.label after label
statement to associate the metadata with the label.

After fixing PR37395.
After fixing problems in LiveDebugVariables.

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

llvm-svn: 341519
2018-09-06 06:03:36 +00:00
Dean Michael Berris 02f097e122 [XRay] Add a BlockIndexer visitor for FDR Records.
Summary:
This change adds a `BlockIndexer` type which maintains pointers to
records that belong to the same process+thread pairs. The indexing
happens with order of appearance of records as they are visited.

This version of the indexer currently only supports FDR version 3 logs,
which contain `BufferExtent` records. We will add support for v2 and v1
logs in follow-up patches.

This is another part of D50441.

Reviewers: eizan, kpw, mboerger

Reviewed By: mboerger

Subscribers: mboerger, mgorny, hiraditya, llvm-commits

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

llvm-svn: 341518
2018-09-06 05:55:57 +00:00
Max Kazantsev f90154069c Revert "[IndVars] Turn isValidRewrite into an assertion" because it seems wrong
llvm-svn: 341517
2018-09-06 05:52:47 +00:00
Max Kazantsev 51690c4f52 [IndVars] Turn isValidRewrite into an assertion
Function rewriteLoopExitValues contains a check on isValidRewrite which
is needed to make sure that SCEV does not convert the pattern
`gep Base, (&p[n] - &p[0])` into `gep &p[n], Base - &p[0]`. This problem
has been fixed in SCEV long ago, so this check is just obsolete.

This patch converts it into an assertion to make sure that the SCEV will
not mess up this case in the future.

Differential Revision: https://reviews.llvm.org/D51582
Reviewed By: atrick

llvm-svn: 341516
2018-09-06 05:21:25 +00:00
Max Kazantsev eb410f79b3 Revert rL341509 to fix massive failures on buildbots
llvm-svn: 341515
2018-09-06 04:40:49 +00:00