30221 Commits

Author SHA1 Message Date
Rafael Espindola
cf230cb30a Support outputting to /dev/null.
When writing to a non regular file we cannot rename to it. Since we
have to write, we may as well create a temporary file to avoid trying
to create an unique file in /dev when trying to write to /dev/null.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291485 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-09 21:52:35 +00:00
Chris Bieneman
67c28b0349 Revert "[ObjectYAML] Support for DWARF line tables"
This reverts commit r291470 due to failing bots:

http://bb.pgr.jp/builders/cmake-llvm-x86_64-linux/builds/47209/steps/test_llvm/logs/stdio

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291471 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-09 20:04:55 +00:00
Chris Bieneman
b7b948cda3 [ObjectYAML] Support for DWARF line tables
This patch adds support for the DWARF debug_lines section. The line table state machine opcodes are preserved, so this can be used to test the state machine evaluation directly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291470 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-09 20:01:37 +00:00
Sanjay Patel
3f06747367 fix comment typos; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291447 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-09 16:27:56 +00:00
Mohammed Agabaria
a2d2e19c17 [IR] Adding const_value_op_iterator for IR/User.h
const value op iterator is missing from User.h class.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291443 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-09 14:00:57 +00:00
Chandler Carruth
f7babeb5d8 [PM] Teach SCEV to invalidate itself when its dependencies become
invalid.

This fixes use-after-free bugs that will arise with any interesting use
of SCEV.

I've added a dedicated test that works diligently to trigger these kinds
of bugs in the new pass manager and also checks for them explicitly as
well as triggering ASan failures when things go squirly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291426 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-09 07:44:34 +00:00
Rui Ueyama
d9a8ccc226 Define sys::path::convert_to_slash
This patch moves convertToUnixPathSeparator from LLD to LLVM.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291414 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-09 01:47:15 +00:00
Lang Hames
c103185b6b [Orc][RPC] Lock the pending results data structure when installing new result
handlers, make abandonPendingResults public API.

This should make installing asynchronous result handlers thread safe.

The abandonPendingResults method is made public so that clients can disconnect
from a remote even if they have asynchronous handlers awaing results from that
remote. The asynchronous handlers will all receive "abandoned result" errors as
their argument.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291399 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-08 20:09:35 +00:00
Lang Hames
b15738d320 [Orc][RPC] Add an APICalls utility for grouping RPC funtions for registration.
APICalls allows groups of functions to be composed into an API that can be
registered as a unit with an RPC endpoint. Doing registration on a-whole API
basis (rather than per-function) allows missing API functions to be detected
early.

APICalls also allows Function membership to be tested at compile-time. This
allows clients to write static assertions that functions to be called are
members of registered APIs.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291380 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-08 01:13:47 +00:00
Lang Hames
f83ef1736f [Orc][RPC] Add a class-method version of addHandler to MultiThreadedRPCEndpoint.
This brings MultiThreadedRPCEndpoint's addHandler API in-line with
SingleThreadedRPCEndpoint's.

This will be tested in an up-coming unit-test for MultiThreadedRPCEndpoint.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291376 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-08 00:18:51 +00:00
Lang Hames
2caf90de45 [Orc][RPC] Rename Single/MultiThreadedRPC to Single/MultithreadedRPCEndpoint.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291374 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-07 22:48:12 +00:00
Lang Hames
5cc5534752 [Orc][RPC] Remove a redundant 'if' statement.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291373 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-07 22:27:52 +00:00
Peter Collingbourne
260cfbc963 LowerTypeTests: Thread summary and action from the API and command line into the pass.
Also move command line handling out of the pass constructor and into
a separate function.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291323 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-07 01:17:24 +00:00
Mehdi Amini
9cb6a18769 Remove useless Forward Declaration from header (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291321 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-07 00:57:43 +00:00
Quentin Colombet
d87ddcb9f0 [MachineBasicBlock] Add a non-assert live-in accessor for debug mode.
With r291169, it is now not possible to access the live-in information
when the liveness is not properly tracked. Although this is want we want
in general, for debugging purpose we may want to still be able to
traverse this information even if it may not be accurate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291317 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-07 00:46:30 +00:00
Jacob Gravelle
da319ede9a Test commit. Comment formatting, it's -> its.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291312 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-07 00:22:31 +00:00
Peter Collingbourne
64d3b81d23 ModuleSummaryIndexYAML: Make a few fields optional to make it easier to write tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291307 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-07 00:00:22 +00:00
Justin Lebar
41b68ffb50 [PM] Edit comments on PM Proxy and utility classes.
Reviewers: chandlerc

Subscribers: mehdi_amini, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291301 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 23:32:02 +00:00
Zachary Turner
ef3cdbf49f Convert MSF Stream iterators to use llvm iterator facade.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291290 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 22:05:12 +00:00
Lang Hames
5d6908ca72 [Orc][RPC] Fix an obvious locking-order bug in RawByteChannel::startSendMessage.
The lock needs to be acquired before the data is sent, not afterwards. This
think-o slipped in during the refactor in r286620, but went unnoticed as the
resulting bug only manifests in multi-threaded clients (of which there are none
in-tree).

No unit test as the bug depends on thread scheduling.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291216 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 06:22:31 +00:00
Rui Ueyama
fd456e365e Add a class to create a tar archive file.
In LLD, we create cpio archive files for --reproduce command.
cpio was not a bad choice because it is very easy to create, but
it was sometimes hard to use because people are not familiar with
cpio command.

I noticed that creating a tar archive isn't as hard as I thought.
So I implemented it in this patch.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291209 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 02:29:48 +00:00
Peter Collingbourne
d99c988733 LowerTypeTests: Split the pass in two: a resolution phase and a lowering phase.
This change separates how type identifiers are resolved from how intrinsic
calls are lowered. All information required to lower an intrinsic call
is stored in a new TypeIdLowering data structure. The idea is that this
data structure can either be initialized using the module itself during
regular LTO, or using the module summary in ThinLTO backends.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291205 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 02:22:47 +00:00
Greg Clayton
d1f6d693d6 Add iterator support to DWARFDie to allow child DIE iteration.
Differential Revision: https://reviews.llvm.org/D28303



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291194 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-05 23:47:37 +00:00
Teresa Johnson
a4ca999339 ThinLTO: add early "dead-stripping" on the Index
Summary:
Using the linker-supplied list of "preserved" symbols, we can compute
the list of "dead" symbols, i.e. the one that are not reachable from
a "preserved" symbol transitively on the reference graph.
Right now we are using this information to mark these functions as
non-eligible for import.

The impact is two folds:
- Reduction of compile time: we don't import these functions anywhere
  or import the function these symbols are calling.
- The limited number of import/export leads to better internalization.

Patch originally by Mehdi Amini.

Reviewers: mehdi_amini, pcc

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291177 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-05 21:34:18 +00:00
Joerg Sonnenberger
44b0ebe8a3 PR 31534: When emitting both DWARF unwind tables and debug information,
do not use .cfi_sections. This requires checking if any non-declaration
function in the module needs an unwind table.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291172 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-05 20:55:28 +00:00
Matthias Braun
4700463eb1 CodeGen: Assert that liveness is up to date when reading block live-ins.
Add an assert that checks whether liveins are up to date before they are
used.

- Do not print liveins into .mir files anymore in situations where they
  are out of date anyway.
- The assert in the RegisterScavenger is superseded by the new one in
  livein_begin().
- Skip parts of the liveness updating logic in IfConversion.cpp when
  liveness isn't tracked anymore (just enough to avoid hitting the new
  assert()).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291169 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-05 20:01:19 +00:00
Simon Pilgrim
281d15cdbf Wdocumentation fix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291114 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-05 14:58:54 +00:00
Teresa Johnson
05a63063fd [ThinLTO] Update new ModuleSummaryIndexYAML.h for r291108
Should fix bot failures due to r291108 which happened due to a
change required in ModuleSummaryIndexYAML.h which was just added in
r291069.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291111 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-05 14:40:15 +00:00
Teresa Johnson
e4e6279a08 [ThinLTO] Subsume all importing checks into a single flag
Summary:
This adds a new summary flag NotEligibleToImport that subsumes
several existing flags (NoRename, HasInlineAsmMaybeReferencingInternal
and IsNotViableToInline). It also subsumes the checking of references
on the summary that was being done during the thin link by
eligibleForImport() for each candidate. It is much more efficient to
do that checking once during the per-module summary build and record
it in the summary.

Reviewers: mehdi_amini

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291108 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-05 14:32:16 +00:00
Mohammed Agabaria
6bf7471dbc Currently isLikelyComplexAddressComputation tries to figure out if the given stride seems to be 'complex' and need some extra cost for address computation handling.
This code seems to be target dependent which may not be the same for all targets.
Passed the decision whether the given stride is complex or not to the target by sending stride information via SCEV to getAddressComputationCost instead of 'IsComplex'.

Specifically at X86 targets we dont see any significant address computation cost in case of the strided access in general.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291106 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-05 14:03:41 +00:00
Kristof Beyls
3c2073e562 [GlobalISel] Add support for switch statements
This commit does this using a trivial chain of conditional branches.  In the
future, we probably want to reuse the optimized switch lowering used in
SelectionDAG.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291099 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-05 11:28:51 +00:00
Saleem Abdulrasool
50116a25c6 MC: support passing search paths to the IAS
This is needed to support inclusion in inline assembly via the
`.include` directive.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291085 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-05 05:56:39 +00:00
Peter Collingbourne
87a14201c5 Tentative fix for modules build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291079 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-05 04:40:09 +00:00
Peter Collingbourne
0e1ad99844 Fix build bots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291073 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-05 04:00:09 +00:00
Peter Collingbourne
405b044247 IR: Module summary representation for type identifiers; summary test scaffolding for lowertypetests.
Set up basic YAML I/O support for module summaries, plumb the summary into
the pass and add a few command line flags to test YAML I/O support. Bitcode
support to come separately, as will the code in LowerTypeTests that actually
uses the summary. Also add a couple of tests that pass by virtue of the pass
doing nothing with the summary (which happens to be the correct thing to do
for those tests).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291069 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-05 03:39:00 +00:00
Chandler Carruth
4125a9aec7 [PM] Fix a typo in a comment that Davide spotted in another code review.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291066 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-05 03:10:26 +00:00
Justin Lebar
9b6443b451 [PM] Edit comments in PassManager.h.
Summary:
This covers most of PassManager.h, up to the introduction of inner/outer
analysis proxies.

If there's a theme to these changes, it's simplifying the language.  For
example:

  * PreservedAnalyses is a "set of analyses", not an "abstract set".
    "Abstract" doesn't have any particular meaning here.

  * "Build types for the concept types" becomes "define the concept types".

  * Instead of "data structures optimized for pointer-like types using
    the alignment-provided low bits", say "data structures that use the
    low bits of pointers."

  * "Clear the map pointing into the results list" becomes
    "Delete the map entries that point into the results list."

This patch also fixes a few places where we referred to "function" and
"module" pass/analysis managers, instead of the more abstract "IRUnitT"
PM/AMs we have now.

Subscribers: mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291040 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-05 00:12:51 +00:00
Mehdi Amini
d0ad0ebd88 Change BitstreamCursor::skipRecord to return the record code (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291026 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-04 22:54:14 +00:00
David Blaikie
253e6b65d4 Fixup some header includes from recent IntrusiveRefCntPtr cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291024 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-04 22:52:00 +00:00
David Blaikie
0581f9f375 Reapply "Make BitCodeAbbrev ownership explicit using shared_ptr rather than IntrusiveRefCntPtr""
If this is a problem for anyone (shared_ptr is two pointers in size,
whereas IntrusiveRefCntPtr is 1 - and the ref count control block that
make_shared adds is probably larger than the one int in RefCountedBase)
I'd prefer to address this by adding a lower-overhead version of
shared_ptr (possibly refactoring IntrusiveRefCntPtr into such a thing)
to avoid the intrusiveness - this allows memory ownership to remain
orthogonal to types and at least to me, seems to make code easier to
understand (since no implicit ownership acquisition can happen).

This recommits 291006, reverted in r291007.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291016 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-04 22:36:33 +00:00
David Blaikie
4e9e4f277a Fix some buildbot issues with const objects with default ctors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291013 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-04 21:59:22 +00:00
David Blaikie
23e393fa4d Revert "Make BitCodeAbbrev ownership explicit using shared_ptr rather than IntrusiveRefCntPtr"
Breaks Clang's use of bitcode. Reverting until I have a fix to go with
it there.

This reverts commit r291006.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291007 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-04 21:19:28 +00:00
David Blaikie
fe94ca2934 Make BitCodeAbbrev ownership explicit using shared_ptr rather than IntrusiveRefCntPtr
If this is a problem for anyone (shared_ptr is two pointers in size,
whereas IntrusiveRefCntPtr is 1 - and the ref count control block that
make_shared adds is probably larger than the one int in RefCountedBase)
I'd prefer to address this by adding a lower-overhead version of
shared_ptr (possibly refactoring IntrusiveRefCntPtr into such a thing)
to avoid the intrusiveness - this allows memory ownership to remain
orthogonal to types and at least to me, seems to make code easier to
understand (since no implicit ownership acquisition can happen).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291006 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-04 21:13:35 +00:00
David Blaikie
9e836572ec Remove unnecessary intrusive ref counting in favor of std::shared_ptr/make_shared
The intrusive nature of the reference counting is not required/used
here, so simplify the ownership model to make the code easier to
understand.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291005 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-04 21:13:28 +00:00
Peter Collingbourne
7108b15810 YAML: Remove Input::MapHNode::isValidKey(), use llvm::is_contained() instead. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290999 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-04 20:10:43 +00:00
David Blaikie
d4b95bb307 ADT: IntrusiveRefCntPtr: Broaden the definition of correct usage of RefCountedBase
This roughly matches the semantics of std::enable_shared_from_this - that it
does not dictate the ownership model of all users, but constrains those users
taking advantage of the intrusive nature to do so only when there's a guarantee
that that's the ownership model being used for the object being passed.

Reviewers: jlebar

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290987 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-04 18:57:31 +00:00
Sanjay Patel
6aec022dd7 fix comment formatting; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290980 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-04 18:16:43 +00:00
Jan Vesely
bf64cb107c AMDGPU/SI: Implement sendmsghalt intrinsic
v2: expose using amdgcn prefix

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290977 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-04 18:06:55 +00:00
Chandler Carruth
da53be3666 [ADT] Speculative attempt to fix build bot issues with r290952.
This just removes the usage of llvm::reverse and llvm::seq. That makes
it harder to handle the empty case correctly and so I've also added
a test there.

This is just a shot in the dark at what might be behind the buildbot
failures. I can't reproduce any issues locally including with ASan...
I feel like I'm missing something...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290954 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-04 11:40:18 +00:00
Chandler Carruth
564b1d1f44 [ADT] Enhance the PriorityWorklist to support bulk insertion.
This is both convenient and more efficient as we can skip any
intermediate reallocation of the vector.

This usage pattern came up in a subsequent patch on the pass manager,
but it seems generically useful so I factored it out and added unittests
here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290952 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-04 11:13:11 +00:00