platform/upstream/llvm.git
5 years agoRemove CodeGen dependencies on Sema.
Richard Trieu [Thu, 6 Dec 2018 06:12:20 +0000 (06:12 +0000)]
Remove CodeGen dependencies on Sema.

Move diagnostics from Sema to Frontend (or Common) so that CodeGen no longer
needs to include the Sema diagnostic IDs.

llvm-svn: 348458

5 years ago[LoopSimplifyCFG] Delete dead in-loop blocks
Max Kazantsev [Thu, 6 Dec 2018 05:45:02 +0000 (05:45 +0000)]
[LoopSimplifyCFG] Delete dead in-loop blocks

This patch teaches LoopSimplifyCFG to delete loop blocks that have
become unreachable after terminator folding has been done.

Differential Revision: https://reviews.llvm.org/D54023
Reviewed By: anna

llvm-svn: 348457

5 years agoInstCombine: Add some missing tests for scalarization
Matt Arsenault [Thu, 6 Dec 2018 03:32:50 +0000 (03:32 +0000)]
InstCombine: Add some missing tests for scalarization

llvm-svn: 348456

5 years agoRevert "[XRay] Move-only Allocator, FunctionCallTrie, and Array"
Dean Michael Berris [Thu, 6 Dec 2018 03:28:57 +0000 (03:28 +0000)]
Revert "[XRay] Move-only Allocator, FunctionCallTrie, and Array"

This reverts commits r348438, r348445, and r348449 due to breakages with
gcc-4.8 builds.

llvm-svn: 348455

5 years agoARM, AArch64: support `__attribute__((__swiftcall__))`
Saleem Abdulrasool [Thu, 6 Dec 2018 03:28:37 +0000 (03:28 +0000)]
ARM, AArch64: support `__attribute__((__swiftcall__))`

Support the Swift calling convention on Windows ARM and AArch64.  Both
of these conform to the AAPCS, AAPCS64 calling convention, and LLVM has
been adjusted to account for the register usage.  Ensure that the
frontend passes this into the backend.  This allows the swift runtime to
be built for Windows.

llvm-svn: 348454

5 years ago[XRay] Use a local lvalue as arg to AppendEmplace(...)
Dean Michael Berris [Thu, 6 Dec 2018 02:55:47 +0000 (02:55 +0000)]
[XRay] Use a local lvalue as arg to AppendEmplace(...)

This is a follow-up to D54989.

Further work-around gcc-4.8 failing to handle brace-init with temporaries.

llvm-svn: 348449

5 years ago[darwin] remove version number check when enabling -fobjc-subscripting-legacy-runtime
Alex Lorenz [Thu, 6 Dec 2018 02:44:23 +0000 (02:44 +0000)]
[darwin] remove version number check when enabling -fobjc-subscripting-legacy-runtime

This subscripting feature actually works on older OS versions anyway.

rdar://36287065

llvm-svn: 348448

5 years agoReapply fix from r348062 to fix test on Windows.
Douglas Yung [Thu, 6 Dec 2018 02:13:09 +0000 (02:13 +0000)]
Reapply fix from r348062 to fix test on Windows.

llvm-svn: 348447

5 years ago[llvm-objcopy] Change --only-keep to --only-section
Jake Ehrlich [Thu, 6 Dec 2018 02:03:53 +0000 (02:03 +0000)]
[llvm-objcopy] Change --only-keep to --only-section

I just hard core goofed when I wrote this and created a different name
for no good reason. I'm failry aware of most "fresh" users of llvm-objcopy
(that is, users which are not using it as a drop in replacement for GNU
objcopy) and can say that only "-j" is being used by such people so this
patch should strictly increase compatibility and not remove it.

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

llvm-svn: 348446

5 years ago[XRay] Use default-constructed struct as argument to Append(...)
Dean Michael Berris [Thu, 6 Dec 2018 01:56:27 +0000 (01:56 +0000)]
[XRay] Use default-constructed struct as argument to Append(...)

This is a follow-up to D54989.

Work-around gcc-4.8 failing to handle brace-init for structs to imply
default-construction of an aggregate, and treats it as an initialiser
list instead.

llvm-svn: 348445

5 years agoAArch64: Fix invalid CCMP emission
Matthias Braun [Thu, 6 Dec 2018 01:40:23 +0000 (01:40 +0000)]
AArch64: Fix invalid CCMP emission

The code emitting AND-subtrees used to check whether any of the operands
was an OR in order to figure out if the result needs to be negated.
However the OR could be hidden in further subtrees and not immediately
visible.

Change the code so that canEmitConjunction() determines whether the
result of the generated subtree needs to be negated. Cleanup emission
logic to use this. I also changed the code a bit to make all negation
decisions early before we actually emit the subtrees.

This fixes http://llvm.org/PR39550

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

llvm-svn: 348444

5 years ago[attributes] Add more tests for os_returns_retained
George Karpenkov [Thu, 6 Dec 2018 01:21:38 +0000 (01:21 +0000)]
[attributes] Add more tests for os_returns_retained

llvm-svn: 348443

5 years ago[Sema/Attribute] Check for noderef attribute
Leonard Chan [Thu, 6 Dec 2018 01:05:54 +0000 (01:05 +0000)]
[Sema/Attribute] Check for noderef attribute

This patch adds the noderef attribute in clang and checks for dereferences of
types that have this attribute. This attribute is currently used by sparse and
would like to be ported to clang.

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

llvm-svn: 348442

5 years agoAdd objc.* ARC intrinsics and codegen them to their runtime methods.
Pete Cooper [Thu, 6 Dec 2018 00:52:54 +0000 (00:52 +0000)]
Add objc.* ARC intrinsics and codegen them to their runtime methods.

Reviewers: erik.pilkington, ahatanak

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

llvm-svn: 348441

5 years agoAdd a unit test for ArchSpec matching to document how it behaves (and test it).
Adrian Prantl [Thu, 6 Dec 2018 00:43:55 +0000 (00:43 +0000)]
Add a unit test for ArchSpec matching to document how it behaves (and test it).

llvm-svn: 348440

5 years ago[MachineOutliner][NFC] Move yet another std::vector out of a loop
Jessica Paquette [Thu, 6 Dec 2018 00:26:21 +0000 (00:26 +0000)]
[MachineOutliner][NFC] Move yet another std::vector out of a loop

Once again, following the wisdom of the LLVM Programmer's Manual.

I think that's enough refactoring for today. :)

llvm-svn: 348439

5 years agoRe-land r348335 "[XRay] Move-only Allocator, FunctionCallTrie, and Array"
Dean Michael Berris [Thu, 6 Dec 2018 00:25:56 +0000 (00:25 +0000)]
Re-land r348335 "[XRay] Move-only Allocator, FunctionCallTrie, and Array"

Continuation of D54989.

Additional changes:

  - Use `.AppendEmplace(...)` instead of `.Append(Type{...})` to appease
    GCC 4.8 with confusion on when an initializer_list is used as
    opposed to a temporary aggregate initialized object.

llvm-svn: 348438

5 years ago[libcxx] Mark some tests as failing on macosx 10.14
Louis Dionne [Thu, 6 Dec 2018 00:25:15 +0000 (00:25 +0000)]
[libcxx] Mark some tests as failing on macosx 10.14

llvm-svn: 348437

5 years ago[libcxx] Don't depend on availability markup to provide the streams in the dylib
Louis Dionne [Thu, 6 Dec 2018 00:24:58 +0000 (00:24 +0000)]
[libcxx] Don't depend on availability markup to provide the streams in the dylib

Whether an explicit instantiation declaration should be provided is not
a matter of availability markup.

This problem is exemplified by the fact that some tests were incorrectly
marked as XFAIL when they should instead have been using the definition
of streams from the headers, and hence passing, and that, regardless of
whether visibility annotations are enabled.

llvm-svn: 348436

5 years ago[lldbsuite] Disable TestStopPCs when there's no XML support
Stella Stamenova [Thu, 6 Dec 2018 00:11:17 +0000 (00:11 +0000)]
[lldbsuite] Disable TestStopPCs when there's no XML support

The test relies on xml support to setup the correct registers. If there's no XML support, the test is going to fail.

llvm-svn: 348435

5 years ago[Sema] Push and Pop Expression Evaluation Context Records at the start and end of...
Leonard Chan [Thu, 6 Dec 2018 00:10:36 +0000 (00:10 +0000)]
[Sema] Push and Pop Expression Evaluation Context Records at the start and end of function definitions

This patch creates a new context for every function definition we enter.
Currently we do not push and pop on these, usually working off of the global
context record added in the Sema constructor, which never gets popped.

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

llvm-svn: 348434

5 years ago[MachineOutliner][NFC] Move std::vector out of loop
Jessica Paquette [Thu, 6 Dec 2018 00:04:03 +0000 (00:04 +0000)]
[MachineOutliner][NFC] Move std::vector out of loop

See http://llvm.org/docs/ProgrammersManual.html#vector

llvm-svn: 348433

5 years ago[MachineOutliner][NFC] Remove IntegerInstructionMap from InstructionMapper
Jessica Paquette [Thu, 6 Dec 2018 00:01:51 +0000 (00:01 +0000)]
[MachineOutliner][NFC] Remove IntegerInstructionMap from InstructionMapper

Refactoring.

This map was only used when we used a string of integers to output the outlined
sequence. Since it's no longer used for anything, there's no reason to keep it
around.

llvm-svn: 348432

5 years agoFix title underlines being too short after r348429
Pete Cooper [Thu, 6 Dec 2018 00:01:44 +0000 (00:01 +0000)]
Fix title underlines being too short after r348429

llvm-svn: 348431

5 years ago[GlobalISel] Introduce G_BUILD_VECTOR, G_BUILD_VECTOR_TRUNC and G_CONCAT_VECTOR opcodes.
Amara Emerson [Wed, 5 Dec 2018 23:53:30 +0000 (23:53 +0000)]
[GlobalISel] Introduce G_BUILD_VECTOR, G_BUILD_VECTOR_TRUNC and G_CONCAT_VECTOR opcodes.

These opcodes are intended to subsume some of the capability of G_MERGE_VALUES,
as it was too powerful and thus complex to add deal with throughout the GISel
pipeline.

G_BUILD_VECTOR creates a vector value from a sequence of uniformly typed
scalar values. G_BUILD_VECTOR_TRUNC is a special opcode for handling scalar
operands which are larger than the destination vector element type, and
therefore does an implicit truncate.

G_CONCAT_VECTOR creates a vector by concatenating smaller, uniformly typed,
vectors together.

These will be used in a subsequent commit. This commit just adds the initial
infrastructure.

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

llvm-svn: 348430

5 years agoUpdate ARC docs as objc_storeStrong returns void not id
Pete Cooper [Wed, 5 Dec 2018 23:49:52 +0000 (23:49 +0000)]
Update ARC docs as objc_storeStrong returns void not id

llvm-svn: 348429

5 years ago[MachineOutliner][NFC] Remove buildCandidateList and replace with findCandidates
Jessica Paquette [Wed, 5 Dec 2018 23:39:07 +0000 (23:39 +0000)]
[MachineOutliner][NFC] Remove buildCandidateList and replace with findCandidates

More refactoring.

Since the pruning logic has changed, and the candidate list is gone,
everything can be sunk into findCandidates.

We no longer need to keep track of the length of the longest substring, so we
can drop all of that logic as well.

After this, we just find all of the candidates and move to outlining.

llvm-svn: 348428

5 years ago[MachineOutliner][NFC] Candidates don't need to be shared_ptrs anymore
Jessica Paquette [Wed, 5 Dec 2018 23:24:22 +0000 (23:24 +0000)]
[MachineOutliner][NFC] Candidates don't need to be shared_ptrs anymore

More refactoring.

After the changes to the pruning logic, and removing CandidateList, there's
no reason for Candiates to be shared_ptrs (or pointers at all).

std::shared_ptr<Candidate> -> Candidate.

llvm-svn: 348427

5 years agoRevert r347934 "[SCEV] Guard movement of insertion point for loop-invariants"
David L. Jones [Wed, 5 Dec 2018 23:13:50 +0000 (23:13 +0000)]
Revert r347934 "[SCEV] Guard movement of insertion point for loop-invariants"

This change caused SEGVs in instcombine. (The r347934 change seems to me to be a
precipitating cause, not a root cause. Details are on the llvm-commits thread
for r347934.)

llvm-svn: 348426

5 years agoFix test change from r348365 to deal with Windows paths correctly.
Douglas Yung [Wed, 5 Dec 2018 23:10:14 +0000 (23:10 +0000)]
Fix test change from r348365 to deal with Windows paths correctly.

llvm-svn: 348425

5 years ago[WebAssembly] Change event section code to 13
Heejin Ahn [Wed, 5 Dec 2018 23:10:09 +0000 (23:10 +0000)]
[WebAssembly] Change event section code to 13

Summary:
We decided to change the event section code from 12 to 13 as new
`DataCount` section in the bulk memory operations proposal will take the
code 12 instead.

Reviewers: sbc100

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

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

llvm-svn: 348424

5 years ago[InstCombine] remove dead code from visitExtractElement
Sanjay Patel [Wed, 5 Dec 2018 23:09:33 +0000 (23:09 +0000)]
[InstCombine] remove dead code from visitExtractElement

Extracting from a splat constant is always handled by InstSimplify.
Move the test for this from InstCombine to InstSimplify to make
sure that stays true.

llvm-svn: 348423

5 years ago[MachineOutliner][NFC] Remove CandidateList, since it's now unused.
Jessica Paquette [Wed, 5 Dec 2018 22:50:26 +0000 (22:50 +0000)]
[MachineOutliner][NFC] Remove CandidateList, since it's now unused.

After removing the pruning logic, there's no reason to populate a list of
Candidates. Remove CandidateList and update comments.

llvm-svn: 348422

5 years agoFix buildbot capture warning
Jessica Paquette [Wed, 5 Dec 2018 22:47:25 +0000 (22:47 +0000)]
Fix buildbot capture warning

A bot didn't like my lambda. This ought to fix it.

Example:

http://lab.llvm.org:8011/builders/lld-x86_64-win7/builds/30139/steps/build%20lld/logs/stdio

error C3493: 'AlreadyRemoved' cannot be implicitly captured because no default
capture mode has been specified

llvm-svn: 348421

5 years ago[MachineOutliner][NFC] Simplify and unify pruning/outlining logic
Jessica Paquette [Wed, 5 Dec 2018 22:27:38 +0000 (22:27 +0000)]
[MachineOutliner][NFC] Simplify and unify pruning/outlining logic

Since we're now performing outlining per OutlinedFunction rather than per
Candidate, we can simply outline each candidate as it shows up.

Instead of having a pruning phase, instead, we'll outline entire functions.
Then we'll update the UnsignedVec we mapped to reflect the deletion. If any
candidate is in a space that's marked dirty, then we'll drop it.

This lets us remove the pruning logic entirely, and greatly simplifies the
code.

llvm-svn: 348420

5 years ago[Hexagon] Add intrinsics for Hexagon V66
Krzysztof Parzyszek [Wed, 5 Dec 2018 22:03:04 +0000 (22:03 +0000)]
[Hexagon] Add intrinsics for Hexagon V66

llvm-svn: 348419

5 years ago[InstCombine] reduce duplication in visitExtractElementInst; NFC
Sanjay Patel [Wed, 5 Dec 2018 21:57:51 +0000 (21:57 +0000)]
[InstCombine] reduce duplication in visitExtractElementInst; NFC

llvm-svn: 348418

5 years ago[InstCombine] add/move tests for extractelement; NFC
Sanjay Patel [Wed, 5 Dec 2018 21:56:13 +0000 (21:56 +0000)]
[InstCombine] add/move tests for extractelement; NFC

llvm-svn: 348417

5 years agoThinLTO: Do not import debug info for imported global constants
David Blaikie [Wed, 5 Dec 2018 21:42:17 +0000 (21:42 +0000)]
ThinLTO: Do not import debug info for imported global constants

It looks like this isn't necessary (in any tests I've done, it results
in the global being described with no location or value in the imported
side - while it's still fully described in the place it's imported from)
& results in significant/pathological debug info growth to home these
location-less global variable descriptions on the import side.

This is a rather pressing/important issue to address - this regressed
executable size for one example I'm looking at by 15%, object size is probably
similar though I haven't measured it, and a 22x increase in the number of CUs
in the cu_index in split DWARF DWP files, creating a similarly large regression
in the time it takes llvm-symbolizer to run on such binaries.

Reviewers: tejohnson, evgeny777

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

llvm-svn: 348416

5 years ago[Hexagon] Add support for Hexagon V66
Krzysztof Parzyszek [Wed, 5 Dec 2018 21:38:35 +0000 (21:38 +0000)]
[Hexagon] Add support for Hexagon V66

llvm-svn: 348415

5 years ago[MachineOutliner] Outline functions by order of benefit
Jessica Paquette [Wed, 5 Dec 2018 21:36:04 +0000 (21:36 +0000)]
[MachineOutliner] Outline functions by order of benefit

Mostly NFC, only change is the order of outlined function names.

Loop over the outlined functions instead of walking the candidate list.

This is a bit easier to understand. It's far more natural to create a function,
then replace all of its occurrences with calls than the other way around.

The functions outlined after this do not change, but their names will be
decided by their benefit. E.g, OUTLINED_FUNCTION_0 will now always be the
most beneficial function, rather than the first one seen.

This makes it easier to enforce an ordering on the outlined functions. So,
this also adds a test to make sure that the ordering works as expected.

llvm-svn: 348414

5 years ago[Hexagon] Add intrinsics for Hexagon V66
Krzysztof Parzyszek [Wed, 5 Dec 2018 21:14:51 +0000 (21:14 +0000)]
[Hexagon] Add intrinsics for Hexagon V66

llvm-svn: 348413

5 years agoNFC: Extract TextNodeDumper class
Stephen Kelly [Wed, 5 Dec 2018 21:12:39 +0000 (21:12 +0000)]
NFC: Extract TextNodeDumper class

Summary:
Start by moving some utilities to it. It will eventually house dumping
of individual nodes (after indentation etc has already been accounted
for).

Reviewers: aaron.ballman

Subscribers: cfe-commits

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

llvm-svn: 348412

5 years ago[Hexagon] Add instruction definitions for Hexagon V66
Krzysztof Parzyszek [Wed, 5 Dec 2018 21:01:07 +0000 (21:01 +0000)]
[Hexagon] Add instruction definitions for Hexagon V66

llvm-svn: 348411

5 years agoNFC: Extract TextTreeStructure class
Stephen Kelly [Wed, 5 Dec 2018 20:53:14 +0000 (20:53 +0000)]
NFC: Extract TextTreeStructure class

Reviewers: aaron.ballman

Subscribers: cfe-commits

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

llvm-svn: 348410

5 years agoNFC: Inline handling of DependentSizedArrayType
Stephen Kelly [Wed, 5 Dec 2018 20:34:07 +0000 (20:34 +0000)]
NFC: Inline handling of DependentSizedArrayType

Summary:
Re-order handling of getElementType and getBracketsRange. It is
necessary to perform all printing before any traversal to child nodes.

This causes no change in the output of ast-dump-array.cpp due to the way
child nodes are printed with a delay.  This new order of the code is
also the order that produces the expected output anyway.

Subscribers: cfe-commits

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

llvm-svn: 348409

5 years agoAdd dump tests for inherited default template parameters
Stephen Kelly [Wed, 5 Dec 2018 20:21:13 +0000 (20:21 +0000)]
Add dump tests for inherited default template parameters

llvm-svn: 348408

5 years ago[Hexagon] Foundation of support for Hexagon V66
Krzysztof Parzyszek [Wed, 5 Dec 2018 20:18:09 +0000 (20:18 +0000)]
[Hexagon] Foundation of support for Hexagon V66

llvm-svn: 348407

5 years ago[GISel]: Provide standard interface to observe changes in GISel passes
Aditya Nandakumar [Wed, 5 Dec 2018 20:14:52 +0000 (20:14 +0000)]
[GISel]: Provide standard interface to observe changes in GISel passes

https://reviews.llvm.org/D54980

This provides a standard API across GISel passes to observe and notify
passes about changes (insertions/deletions/mutations) to MachineInstrs.
This patch also removes the recordInsertion method in MachineIRBuilder
and instead provides method to setObserver.

Reviewed by: vkeles.

llvm-svn: 348406

5 years ago[CodeExtractor] Do not marked outlined calls which may resume EH as noreturn
Vedant Kumar [Wed, 5 Dec 2018 19:35:37 +0000 (19:35 +0000)]
[CodeExtractor] Do not marked outlined calls which may resume EH as noreturn

Treat terminators which resume exception propagation as returning instructions
(at least, for the purposes of marking outlined functions `noreturn`). This is
to avoid inserting traps after calls to outlined functions which unwind.

rdar://46129950

llvm-svn: 348404

5 years ago[X86][SSE] Fix a copy+paste typo that was folding the sext/zext of partial vectors
Simon Pilgrim [Wed, 5 Dec 2018 19:32:19 +0000 (19:32 +0000)]
[X86][SSE] Fix a copy+paste typo that was folding the sext/zext of partial vectors

llvm-svn: 348403

5 years agoRevert "[RISCV] Mark unit tests as "requires: riscv-registered-target""
Mandeep Singh Grang [Wed, 5 Dec 2018 19:19:38 +0000 (19:19 +0000)]
Revert "[RISCV] Mark unit tests as "requires: riscv-registered-target""

This reverts commit 8908dd12e7bbfc74e264233e900206ad31e285f0.

llvm-svn: 348402

5 years agoDo not use a hash table to uniquify mergeable strings.
Rui Ueyama [Wed, 5 Dec 2018 19:13:31 +0000 (19:13 +0000)]
Do not use a hash table to uniquify mergeable strings.

Previously, we have a hash table containing strings and their offsets
to manage mergeable strings. Technically we can live without that, because
we can do binary search on a vector of mergeable strings to find a mergeable
strings.

We did have both the hash table and the binary search because we thought
that that is faster.

We recently observed that lld tend to consume more memory than gold when
building an output with debug info. A few percent of memory is consumed by
the hash table. So, we needed to reevaluate whether or not having the extra
hash table is a good CPU/memory tradeoff. I run a few benchmarks with and
without the hash table.

I got a mixed result for the benchmark. We observed a regression for some
programs by removing the hash table (that's what we expected), but we also
observed that performance imrpovements for some programs. This is perhaps
due to reduced memory usage.

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

llvm-svn: 348401

5 years agoDo not check for parameters shadowing fields in function declarations.
Aaron Ballman [Wed, 5 Dec 2018 18:56:57 +0000 (18:56 +0000)]
Do not check for parameters shadowing fields in function declarations.

We would issue a false-positive diagnostic for parameters in function declarations shadowing fields; we now only issue the diagnostic on a function definition instead.

llvm-svn: 348400

5 years agoAdding tests for -ast-dump; NFC.
Aaron Ballman [Wed, 5 Dec 2018 18:53:57 +0000 (18:53 +0000)]
Adding tests for -ast-dump; NFC.

This adds tests for various function and class template declarations.

llvm-svn: 348399

5 years ago[AArch64] Reword description of feature (NFC)
Evandro Menezes [Wed, 5 Dec 2018 18:42:57 +0000 (18:42 +0000)]
[AArch64] Reword description of feature (NFC)

Reword the description of the feature that enables custom handling of cheap
instructions.

llvm-svn: 348398

5 years agoHonor -fdebug-prefix-map when creating function names for the debug info.
Adrian Prantl [Wed, 5 Dec 2018 18:37:44 +0000 (18:37 +0000)]
Honor -fdebug-prefix-map when creating function names for the debug info.

This adds a callback to PrintingPolicy to allow CGDebugInfo to remap
file paths according to -fdebug-prefix-map. Otherwise the debug info
(particularly function names for C++ lambdas) may contain paths that
should have been remapped in the debug info.

<rdar://problem/46128056>

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

llvm-svn: 348397

5 years ago[analyzer] Attribute for RetainCountChecker for OSObject should propagate with inheri...
George Karpenkov [Wed, 5 Dec 2018 18:34:54 +0000 (18:34 +0000)]
[analyzer] Attribute for RetainCountChecker for OSObject should propagate with inheritance

rdar://46388388

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

llvm-svn: 348396

5 years ago[llvm-mca] Simplify test (NFC)
Evandro Menezes [Wed, 5 Dec 2018 18:34:51 +0000 (18:34 +0000)]
[llvm-mca] Simplify test (NFC)

llvm-svn: 348395

5 years agoMention changes to libc++ include dir lookup in release notes.
Ilya Biryukov [Wed, 5 Dec 2018 18:32:05 +0000 (18:32 +0000)]
Mention changes to libc++ include dir lookup in release notes.

Summary: The change itself landed as r348365, see the comment for more details.

Reviewers: arphaman, EricWF

Reviewed By: arphaman

Subscribers: cfe-commits

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

llvm-svn: 348394

5 years ago[llvm-mca] Sort test run lines (NFC)
Evandro Menezes [Wed, 5 Dec 2018 18:30:06 +0000 (18:30 +0000)]
[llvm-mca] Sort test run lines (NFC)

llvm-svn: 348393

5 years ago[MachineOutliner][NFC] Use getOccurrenceCount() in getNotOutlinedCost()
Jessica Paquette [Wed, 5 Dec 2018 18:17:40 +0000 (18:17 +0000)]
[MachineOutliner][NFC] Use getOccurrenceCount() in getNotOutlinedCost()

Some more gardening.

llvm-svn: 348392

5 years ago[MachineOutliner][NFC] Make getters in MachineOutliner.h const
Jessica Paquette [Wed, 5 Dec 2018 18:12:52 +0000 (18:12 +0000)]
[MachineOutliner][NFC] Make getters in MachineOutliner.h const

Just some refactoring. A few of the getters in OutlinedFunction weren't const.

llvm-svn: 348391

5 years ago[MachineOutliner][NFC] Don't create outlined sequence from integer mapping
Jessica Paquette [Wed, 5 Dec 2018 17:57:33 +0000 (17:57 +0000)]
[MachineOutliner][NFC] Don't create outlined sequence from integer mapping

Some gardening/refactoring.

It's cleaner to copy the instructions into the MachineFunction using the first
candidate instead of going to the mapper.

Also, by doing this we can remove the Seq member from OutlinedFunction entirely.

llvm-svn: 348390

5 years ago[gold-plugin] allow function/data sections to be toggleable
Nick Desaulniers [Wed, 5 Dec 2018 17:46:24 +0000 (17:46 +0000)]
[gold-plugin] allow function/data sections to be toggleable

Summary:
r336838 allowed these to be toggleable.
r336858 reverted r336838.
r336943 made the generation of these sections conditional on LDPO_REL.

This commit brings back the toggle-ability.  You can specify:
-plugin-opt=-function-sections
-plugin-opt=-data-sections
For your linker flags to disable the changes made in r336943.

Without toggling r336943 off, arm64 linux kernels linked with gold-plugin
see significant boot time regressions, but with r336943 outright reverted
x86_64 linux kernels linked with gold-plugin fail to boot.

Reviewers: pcc, void

Reviewed By: pcc

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

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

llvm-svn: 348389

5 years agoAddress a post-commit review comment on r348325.
Erik Pilkington [Wed, 5 Dec 2018 17:43:26 +0000 (17:43 +0000)]
Address a post-commit review comment on r348325.

llvm-svn: 348388

5 years ago[CodeComplete] Fix a crash in access checks of inner classes
Ilya Biryukov [Wed, 5 Dec 2018 17:38:39 +0000 (17:38 +0000)]
[CodeComplete] Fix a crash in access checks of inner classes

Summary: The crash was introduced in r348135.

Reviewers: kadircet

Reviewed By: kadircet

Subscribers: cfe-commits

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

llvm-svn: 348387

5 years ago[PDB] Make PDB lit tests use the new builder
Aleksandr Urakov [Wed, 5 Dec 2018 17:35:30 +0000 (17:35 +0000)]
[PDB] Make PDB lit tests use the new builder

Reviewers: zturner, stella.stamenova

Reviewed By: zturner

Tags: #lldb

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

llvm-svn: 348386

5 years agoAMDGPU: Fix using old address spaces in some tests
Matt Arsenault [Wed, 5 Dec 2018 17:34:59 +0000 (17:34 +0000)]
AMDGPU: Fix using old address spaces in some tests

llvm-svn: 348385

5 years ago[Basic] Cleanups in IdentifierInfo following the removal of PTH
Bruno Ricci [Wed, 5 Dec 2018 17:16:55 +0000 (17:16 +0000)]
[Basic] Cleanups in IdentifierInfo following the removal of PTH

The Entry pointer in IdentifierInfo was only null for IdentifierInfo
created from a PTH. Now that PTH support has been removed we can remove
some PTH specific code in IdentifierInfo::getLength and
IdentifierInfo::getNameStart.

Also make the constructor of IdentifierInfo private to make sure that
they are only created by IdentifierTable, and move it to the header so
that it can be inlined in IdentifierTable::get and IdentifierTable::getOwn.

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

Reviewed By: erichkeane

llvm-svn: 348384

5 years ago[DAGCombiner] don't try to extract a fraction of a vector binop and crash (PR39893)
Sanjay Patel [Wed, 5 Dec 2018 17:10:30 +0000 (17:10 +0000)]
[DAGCombiner] don't try to extract a fraction of a vector binop and crash (PR39893)

Because we're potentially peeking through a bitcast in this transform,
we need to use overall bitwidths rather than number of elements to
determine when it's safe to proceed.

Should fix:
https://bugs.llvm.org/show_bug.cgi?id=39893

llvm-svn: 348383

5 years ago[OpenCL] Diagnose conflicting address spaces in templates.
Anastasia Stulova [Wed, 5 Dec 2018 17:02:22 +0000 (17:02 +0000)]
[OpenCL] Diagnose conflicting address spaces in templates.

Added new diagnostic when templates are instantiated with
different address space from the one provided in its definition.

This also prevents deducing generic address space in pointer
type of templates to allow giving them concrete address space
during instantiation.

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

llvm-svn: 348382

5 years agoAllow norecurse attribute on functions that have debug infos.
Christian Bruel [Wed, 5 Dec 2018 16:48:00 +0000 (16:48 +0000)]
Allow norecurse attribute on functions that have debug infos.

Summary: debug intrinsics might be marked norecurse to enable the caller function to be norecurse and optimized if needed. This avoids code gen optimisation differences when -g is used, as in globalOpt.cpp:processInternalGlobal checks.

Reviewers: chandlerc, jmolloy, aprantl

Reviewed By: aprantl

Subscribers: aprantl, llvm-commits

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

llvm-svn: 348381

5 years ago[X86] Add test case to show missed opportunity to combine a concat_vector into a...
Andrea Di Biagio [Wed, 5 Dec 2018 16:23:27 +0000 (16:23 +0000)]
[X86] Add test case to show missed opportunity to combine a concat_vector into a scalar_to_vector. NFC

This is a test for D55274.

llvm-svn: 348380

5 years ago[NFC] Use clang-format on PrintingPolicy::PrintingPolicy() after fd5c386f743
Jan Korous [Wed, 5 Dec 2018 16:19:49 +0000 (16:19 +0000)]
[NFC] Use clang-format on PrintingPolicy::PrintingPolicy() after fd5c386f743

The white-space change was causing conflicts downstream.

rdar://problem/46486841

llvm-svn: 348379

5 years agoRemove XFAIL in get_module_and_offset_for_pc.cc for NetBSD-MSan
Kamil Rytarowski [Wed, 5 Dec 2018 16:05:25 +0000 (16:05 +0000)]
Remove XFAIL in get_module_and_offset_for_pc.cc for NetBSD-MSan

After updating GET_LINK_MAP_BY_DLOPEN_HANDLE() for recent NetBSD
this test no longer fails.

llvm-svn: 348378

5 years ago[Sanitizer] nl_langinfo forgotten bit.
David Carlier [Wed, 5 Dec 2018 16:02:26 +0000 (16:02 +0000)]
[Sanitizer] nl_langinfo forgotten bit.

M    lib/sanitizer_common/sanitizer_platform_interceptors.h

llvm-svn: 348377

5 years ago[Sanitizer] expand nl_langinfo interception to FreeBSD
David Carlier [Wed, 5 Dec 2018 16:01:22 +0000 (16:01 +0000)]
[Sanitizer] expand nl_langinfo interception to FreeBSD

Reviewers: krytarowski

Reviewed By: krytarowski

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

llvm-svn: 348376

5 years agoRevert "[IR] Add NODISCARD to attribute functions"
Brian Gesiak [Wed, 5 Dec 2018 15:56:09 +0000 (15:56 +0000)]
Revert "[IR] Add NODISCARD to attribute functions"

Revert https://reviews.llvm.org/D55217 due to warnings-turned-into-errors in
AMGPU targets. I'll fix the warnings first, then re-commit this patch.

llvm-svn: 348375

5 years ago[SLH] Fix a nasty bug in SLH.
Chandler Carruth [Wed, 5 Dec 2018 15:42:11 +0000 (15:42 +0000)]
[SLH] Fix a nasty bug in SLH.

Whenever we effectively take the address of a basic block we need to
manually update that basic block to reflect that fact or later passes
such as tail duplication and tail merging can break the invariants of
the code. =/ Sadly, there doesn't appear to be any good way of
automating this or even writing a reasonable assert to catch it early.

The change seems trivially and obviously correct, but sadly the only
really good test case I have is 1000s of basic blocks. I've tried
directly writing a test case that happens to make tail duplication do
something that crashes later on, but this appears to require an
*amazingly* complex set of conditions that I've not yet reproduced.

The change is technically covered by the tests because we mark the
blocks as having their address taken, but that doesn't really count as
properly testing the functionality.

llvm-svn: 348374

5 years ago[SLH] Regenerate tests with --no_x86_scrub_rip to restore the higher
Chandler Carruth [Wed, 5 Dec 2018 15:41:13 +0000 (15:41 +0000)]
[SLH] Regenerate tests with --no_x86_scrub_rip to restore the higher
fidelity checking of RIP-based references to basic blocks and other
labels.

These labels are super important for SLH tests so we should keep them
readable in the test cases.

llvm-svn: 348373

5 years ago[IR] Add NODISCARD to attribute functions
Brian Gesiak [Wed, 5 Dec 2018 15:33:55 +0000 (15:33 +0000)]
[IR] Add NODISCARD to attribute functions

Summary:
Many functions on `llvm::AttributeList` and `llvm::AttributeSet` are
documented with "returns a new {list,set} because attribute
{lists,sets} are immutable." This documentation can be aided by the
addition of an attribute, `LLVM_NODISCARD`. Adding this prevents
unsuspecting users of the API from expecting
`AttributeList::setAttributes` from modifying the underlying list.

At the very least, it would have saved me a few hours of debugging, since I
had been doing just that! I had a bug in my program where I was calling
`setAttributes` but then passing in the unmutated `AttributeList`.
I tried adding LLVM_NODISCARD and confirmed that it would have made my bug
immediately obvious.

Reviewers: rnk, javed.absar

Reviewed By: rnk

Subscribers: llvm-commits

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

llvm-svn: 348372

5 years ago[AMDGPU]: Turn on the DPP combiner by default
Valery Pykhtin [Wed, 5 Dec 2018 15:21:17 +0000 (15:21 +0000)]
[AMDGPU]: Turn on the DPP combiner by default

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

llvm-svn: 348371

5 years agoAdd a new interceptor for modctl(2) from NetBSD
Kamil Rytarowski [Wed, 5 Dec 2018 15:13:20 +0000 (15:13 +0000)]
Add a new interceptor for modctl(2) from NetBSD

Summary:
modctl - controls loadable kernel modules.

Skip tests as this call uses privileged operations.

Reviewers: vitalybuka, joerg

Reviewed By: vitalybuka

Subscribers: kubamracek, llvm-commits, mgorny, #sanitizers

Tags: #sanitizers

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

llvm-svn: 348370

5 years agoAdd a new interceptor for nl_langinfo(3) from NetBSD
Kamil Rytarowski [Wed, 5 Dec 2018 15:06:53 +0000 (15:06 +0000)]
Add a new interceptor for nl_langinfo(3) from NetBSD

Summary:
nl_langinfo - gets locale information.

Add a dedicated test.

Reviewers: vitalybuka, joerg

Reviewed By: vitalybuka

Subscribers: kubamracek, llvm-commits, mgorny, #sanitizers

Tags: #sanitizers

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

llvm-svn: 348369

5 years ago[Haiku] Support __float128 for x86 and x86_64
Kristina Brooks [Wed, 5 Dec 2018 15:05:06 +0000 (15:05 +0000)]
[Haiku] Support __float128 for x86 and x86_64

This patch addresses a compilation error with clang when
running in Haiku being unable to compile code using
float128 (throws compilation error such as 'float128 is
not supported on this target').

Patch by kallisti5 (Alexander von Gluck IV)

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

llvm-svn: 348368

5 years ago[InstCombine] simplify icmps with same operands based on dominating cmp
Sanjay Patel [Wed, 5 Dec 2018 15:04:00 +0000 (15:04 +0000)]
[InstCombine] simplify icmps with same operands based on dominating cmp

The tests here are based on the motivating cases from D54827.

More background:
1. We don't get these cases in general with SimplifyCFG because the root
   of the pattern match is an icmp, not a branch. I'm not sure how often
   we encounter this pattern vs. the seemingly more likely case with
   branches, but I don't see evidence to leave the minimal pattern
   unoptimized.

2. This has a chance of increasing compile-time because we're using a
   ValueTracking call to handle the match. The motivating cases could be
   handled with a simpler pair of calls to isImpliedTrueByMatchingCmp/
   isImpliedFalseByMatchingCmp, but I saw that we have a more
   comprehensive wrapper around those, so we might as well use it here
   unless there's evidence that it's significantly slower.

3. Ideally, we'd handle the fold to constants in InstSimplify, but as
   with the existing code here, we could extend this to handle cases
   where the result is not a constant, but a new combined predicate.
   That would mean splitting the logic across the 2 passes and possibly
   duplicating the pattern-matching cost.

4. As mentioned in D54827, this seems like the kind of thing that should
   be handled in Correlated Value Propagation, but that pass is currently
   limited to dealing with instructions with constant operands, so extending
   this bit of InstCombine is the smallest/easiest way to get these patterns
   optimized.

llvm-svn: 348367

5 years ago[X86][SSE] Begun adding modulo rotate support to LowerRotate
Simon Pilgrim [Wed, 5 Dec 2018 14:46:37 +0000 (14:46 +0000)]
[X86][SSE] Begun adding modulo rotate support to LowerRotate

Prep work for PR38243 - mainly adding comments on where we need to add modulo support (doing so at the moment causes massive codegen regressions).

I've also consistently added support for modulo folding for uniform constants (although at the moment we have no way to trigger this) and removed the old assertions.

llvm-svn: 348366

5 years agoMove detection of libc++ include dirs to Driver on MacOS
Ilya Biryukov [Wed, 5 Dec 2018 14:24:14 +0000 (14:24 +0000)]
Move detection of libc++ include dirs to Driver on MacOS

Summary:
The intention is to make the tools replaying compilations from 'compile_commands.json'
(clang-tidy, clangd, etc.) find the same standard library as the original compiler
specified in 'compile_commands.json'.

Previously, the library detection logic was in the frontend (InitHeaderSearch.cpp) and relied
on the value of resource dir as an approximation of the compiler install dir. The new logic
uses the actual compiler install dir and is performed in the driver. This is consistent with
the C++ standard library detection on other platforms and allows to override the resource dir
in the tools using the compile_commands.json without altering the
standard library detection mechanism. The tools have to override the resource dir to make sure
they use a consistent version of the builtin headers.

There is still logic in InitHeaderSearch that attemps to add the absolute includes for the
the C++ standard library, so we keep passing the -stdlib=libc++ from the driver to the frontend
via cc1 args to avoid breaking that. In the long run, we should move this logic to the driver too,
but it could potentially break the library detection on other systems, so we don't tackle it in this
patch to keep its scope manageable.

This is a second attempt to fix the issue, first one was commited in r346652 and reverted in r346675.
The original fix relied on an ad-hoc propagation (bypassing the cc1 flags) of the install dir from the
driver to the frontend's HeaderSearchOptions. Unsurpisingly, the propagation was incomplete, it broke
the libc++ detection in clang itself, which caused LLDB tests to break.

The LLDB tests pass with new fix.

Reviewers: JDevlieghere, arphaman, EricWF

Reviewed By: arphaman

Subscribers: mclow.lists, ldionne, dexonsmith, ioeric, christof, kadircet, cfe-commits

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

llvm-svn: 348365

5 years agoRevert: Honor -fdebug-prefix-map when creating function names for the debug info.
Renato Golin [Wed, 5 Dec 2018 13:56:26 +0000 (13:56 +0000)]
Revert: Honor -fdebug-prefix-map when creating function names for the debug info.

This commit reverts r348060 and r348062 due to it breaking the AArch64 Full
buildbot: https://bugs.llvm.org/show_bug.cgi?id=39892

llvm-svn: 348364

5 years ago[llvm-rc] Support not expressions.
Martin Storsjo [Wed, 5 Dec 2018 13:22:56 +0000 (13:22 +0000)]
[llvm-rc] Support not expressions.

Patch by Jacek Caban!

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

llvm-svn: 348363

5 years ago[TargetLowering] Remove ISD::ANY_EXTEND/ANY_EXTEND_VECTOR_INREG opcodes from Simplify...
Simon Pilgrim [Wed, 5 Dec 2018 12:20:05 +0000 (12:20 +0000)]
[TargetLowering] Remove ISD::ANY_EXTEND/ANY_EXTEND_VECTOR_INREG opcodes from SimplifyDemandedVectorElts

These have no test coverage and the KnownZero flags can't be guaranteed unlike SIGN/ZERO_EXTEND cases.

llvm-svn: 348361

5 years ago[CMake] Fix side-effect from LLDB_VERSION change in r346668 for framework-enabled...
Stefan Granitz [Wed, 5 Dec 2018 12:18:44 +0000 (12:18 +0000)]
[CMake] Fix side-effect from LLDB_VERSION change in r346668 for framework-enabled builds

llvm-svn: 348360

5 years ago[clangd] Dont provide locations for non-existent files.
Kadir Cetinkaya [Wed, 5 Dec 2018 11:57:15 +0000 (11:57 +0000)]
[clangd] Dont provide locations for non-existent files.

Summary:
We were getting assertion errors when we had bad file names, instead we
should skip those.

Reviewers: hokein

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

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

llvm-svn: 348359

5 years ago[DAG] Add fshl/fshr tblgen opcodes
Simon Pilgrim [Wed, 5 Dec 2018 11:55:33 +0000 (11:55 +0000)]
[DAG] Add fshl/fshr tblgen opcodes

Missed off from https://reviews.llvm.org/D54698

llvm-svn: 348358

5 years agoFix compilation error when using clang 3.6.0
Mikael Holmen [Wed, 5 Dec 2018 11:29:27 +0000 (11:29 +0000)]
Fix compilation error when using clang 3.6.0

llvm-svn: 348357

5 years ago[test] Disable Modules/prune.m on NetBSD as it requires 'touch -a'
Michal Gorny [Wed, 5 Dec 2018 11:17:50 +0000 (11:17 +0000)]
[test] Disable Modules/prune.m on NetBSD as it requires 'touch -a'

llvm-svn: 348356

5 years ago[test] Skip ThinLTO cache tests requiring atime setting on NetBSD
Michal Gorny [Wed, 5 Dec 2018 11:15:50 +0000 (11:15 +0000)]
[test] Skip ThinLTO cache tests requiring atime setting on NetBSD

Skip the ThinLTO cache tests on NetBSD.  They require 'touch' being
able to alter atime of files, while NetBSD inhibits atime updates
when filesystem is mounted noatime.

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

llvm-svn: 348355

5 years ago[test] Split strip-preserve-time.test, and skip atime test on NetBSD
Michal Gorny [Wed, 5 Dec 2018 11:15:46 +0000 (11:15 +0000)]
[test] Split strip-preserve-time.test, and skip atime test on NetBSD

Split timestamp preservation tests into atime and mtime test, and skip
the former on NetBSD.  When the filesystem is mounted noatime, NetBSD
not only inhibits implicit atime updates but also prevents setting atime
via utime(), causing the test to fail.

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

llvm-svn: 348354

5 years ago[SelectionDAG] Initial support for FSHL/FSHR funnel shift opcodes (PR39467)
Simon Pilgrim [Wed, 5 Dec 2018 11:12:12 +0000 (11:12 +0000)]
[SelectionDAG] Initial support for FSHL/FSHR funnel shift opcodes (PR39467)

This is an initial patch to add a minimum level of support for funnel shifts to the SelectionDAG and to begin wiring it up to the X86 SHLD/SHRD instructions.

Some partial legalization code has been added to handle the case for 'SlowSHLD' where we want to expand instead and I've added a few DAG combines so we don't get regressions from the existing DAG builder expansion code.

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

llvm-svn: 348353