1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00
Commit Graph

24650 Commits

Author SHA1 Message Date
Rafael Espindola
c04851c1d4 Revert "[Orc] Directly emit machine code for the x86 resolver block and trampolines."
This reverts commit r251933.

It broke the build of examples/Kaleidoscope/Orc/fully_lazy/toy.cpp.

llvm-svn: 251937
2015-11-03 16:25:20 +00:00
Lang Hames
f8e78a5c05 [Orc] Directly emit machine code for the x86 resolver block and trampolines.
Bypassing LLVM for this has a number of benefits:

1) Laziness support becomes asm-syntax agnostic (previously lazy jitting didn't
   work on Windows as the resolver block was in Darwin asm).

2) For cross-process JITs, it allows resolver blocks and trampolines to be
   emitted directly in the target process, reducing cross process traffic.

3) It should be marginally faster.

llvm-svn: 251933
2015-11-03 16:10:18 +00:00
Michael Kuperstein
5991145dd5 [X86] Generate .cfi_adjust_cfa_offset correctly when pushing arguments
When push instructions are being used to pass function arguments on
the stack, and either EH or debugging are enabled, we need to generate
.cfi_adjust_cfa_offset directives appropriately. For (synch) EH, it is
enough for the CFA offset to be correct at every call site, while
for debugging we want to be correct after every push.

Darwin does not support this well, so don't use pushes whenever it
would be required.

Differential Revision: http://reviews.llvm.org/D13767

llvm-svn: 251904
2015-11-03 08:17:25 +00:00
Matthias Braun
a75cf73a70 ScheduleDAGInstrs: Remove IsPostRA flag; NFC
ScheduleDAGInstrs doesn't behave differently before or after register
allocation. It was only used in a method of MachineSchedulerBase which
behaved differently in MachineScheduler/PostMachineScheduler. Change
this to let MachineScheduler/PostMachineScheduler just pass in a
parameter to that function.

The order of the LiveIntervals* and bool RemoveKillFlags paramters have
been switched to make out-of-tree code fail instead of unintentionally
passing a value intended for the IsPostRA flag to the (previously
following and default initialized) RemoveKillFlags.

Differential Revision: http://reviews.llvm.org/D14245

llvm-svn: 251883
2015-11-03 01:53:29 +00:00
Rafael Espindola
703dd2fb10 This never returns end(), simplify to use Child instead of iterator. NFC.
llvm-svn: 251876
2015-11-03 01:20:44 +00:00
Teresa Johnson
90b0eac682 Restore "Support for ThinLTO function importing and symbol linking."
This restores commit r251837, with the new library dependence added to
llvm-link/Makefile to address bot failures.

llvm-svn: 251866
2015-11-03 00:14:15 +00:00
David Blaikie
0eb4964368 Fix the build I just broke
llvm-svn: 251854
2015-11-02 23:10:52 +00:00
David Blaikie
aec8d8648f Orc: Drop some else-after-return, reflow a few spots, and avoid use of pointee types
llvm-svn: 251853
2015-11-02 23:09:38 +00:00
Teresa Johnson
077216c4b1 Revert "Support for ThinLTO function importing and symbol linking."
This reverts commit r251837, due to a number of bot failures of the form:

/home/grosser/buildslave/perf-x86_64-penryn-O3-polly-fast/llvm.obj/tools/llvm-link/Release+Asserts/llvm-link.o:llvm-link.cpp:function
loadIndex(llvm::LLVMContext&, llvm::Module const*): error: undefined
reference to
'llvm::object::FunctionIndexObjectFile::create(llvm::MemoryBufferRef,
llvm::LLVMContext&, llvm::Module const*, bool)'
/home/grosser/buildslave/perf-x86_64-penryn-O3-polly-fast/llvm.obj/tools/llvm-link/Release+Asserts/llvm-link.o:llvm-link.cpp:function
loadIndex(llvm::LLVMContext&, llvm::Module const*): error: undefined
reference to 'llvm::object::FunctionIndexObjectFile::takeIndex()'

I'm not sure why these are happening - I added Object to the requred
libraries in tools/llvm-link/LLVMBuild.txt and the LLVM_LINK_COMPONENTS
in tools/llvm-link/CMakeLists.txt. Confirmed for my build that these
symbols come out of libLLVMObject.a. What am I missing?

llvm-svn: 251841
2015-11-02 22:17:32 +00:00
Teresa Johnson
30954fb923 Support for ThinLTO function importing and symbol linking.
Summary:
Support for necessary linkage changes and symbol renaming during
ThinLTO function importing.

Also includes llvm-link support for manually importing functions
and associated llvm-link based tests.

Note that this does not include support for intelligently importing
metadata, which is currently imported duplicate times. That support will
be in the follow-on patch, and currently is ignored by the tests.

Reviewers: dexonsmith, joker.eph, davidxl

Subscribers: tobiasvk, tejohnson, llvm-commits

Differential Revision: http://reviews.llvm.org/D13515

llvm-svn: 251837
2015-11-02 21:39:10 +00:00
Reid Kleckner
84ff637db7 [Support] Assert that reported key+data lenghts match reality
This found a bug in Clang's PTH implementation.

llvm-svn: 251829
2015-11-02 20:49:29 +00:00
David Blaikie
a98b9cfa54 StringRef-ify DiagnosticInfoSampleProfile::Filename
llvm-svn: 251823
2015-11-02 20:01:13 +00:00
Rafael Espindola
12412f318b ELF can handle some relocations of the form -sym + constant.
Remove code that was assuming that this would never work.

Thanks to Colin LeMahie for finding and diagnosing the bug.

llvm-svn: 251818
2015-11-02 19:13:59 +00:00
Teresa Johnson
1cf56803da Clang format a few prior patches (NFC)
I had clang formatted my earlier patches using the wrong style.
Reformatted with the LLVM style.

llvm-svn: 251812
2015-11-02 18:02:11 +00:00
Artur Pilipenko
0dd1f670a9 Preserve load alignment and dereferenceable metadata during some transformations
Reviewed By: hfinkel

Differential Revision: http://reviews.llvm.org/D13953

llvm-svn: 251809
2015-11-02 17:53:51 +00:00
Silviu Baranga
439f20d646 Add missing override statements in ScalarEvolution.h. NFC
llvm-svn: 251805
2015-11-02 15:29:49 +00:00
Silviu Baranga
ab8c77a47d [SCEV][LV] Add SCEV Predicates and use them to re-implement stride versioning
Summary:
SCEV Predicates represent conditions that typically cannot be derived from
static analysis, but can be used to reduce SCEV expressions to forms which are
usable for different optimizers.

ScalarEvolution now has the rewriteUsingPredicate method which can simplify a
SCEV expression using a SCEVPredicateSet. The normal workflow of a pass using
SCEVPredicates would be to hold a SCEVPredicateSet and every time assumptions
need to be made a new SCEV Predicate would be created and added to the set.
Each time after calling getSCEV, the user will call the rewriteUsingPredicate
method.

We add two types of predicates
SCEVPredicateSet - implements a set of predicates
SCEVEqualPredicate - tests for equality between two SCEV expressions

We use the SCEVEqualPredicate to re-implement stride versioning. Every time we
version a stride, we will add a SCEVEqualPredicate to the context.
Instead of adding specific stride checks, LoopVectorize now adds a more
generic SCEV check.

We only need to add support for this in the LoopVectorizer since this is the
only pass that will do stride versioning.

Reviewers: mzolotukhin, anemet, hfinkel, sanjoy

Subscribers: sanjoy, hfinkel, rengolin, jmolloy, llvm-commits

Differential Revision: http://reviews.llvm.org/D13595

llvm-svn: 251800
2015-11-02 14:41:02 +00:00
James Molloy
bcb542b66c [PatternMatch] Switch to use ValueTracking::matchSelectPattern
Instead of rolling our own min/max matching code (which is notoriously
hard to get completely right), use ValueTracking's instead.

llvm-svn: 251785
2015-11-02 09:54:00 +00:00
Pawel Bylica
669b84345b [Support] Extend sys::path with user_cache_directory function.
Summary:
The new function sys::path::user_cache_directory tries to discover
a directory suitable for cache storage for current system user.

On Windows and Darwin it returns a path to system-specific user cache directory.

On Linux it follows XDG Base Directory Specification, what is:
- use non-empty $XDG_CACHE_HOME env var,
- use $HOME/.cache.

Reviewers: chapuni, aaron.ballman, rafael

Subscribers: rafael, aaron.ballman, llvm-commits

Differential Revision: http://reviews.llvm.org/D13801

llvm-svn: 251784
2015-11-02 09:49:17 +00:00
Igor Breger
dd070c17bb AVX512: Implemented encoding and intrinsics for VBROADCASTI32x2 and VBROADCASTF32x2 instructions.
Differential Revision: http://reviews.llvm.org/D14216

llvm-svn: 251781
2015-11-02 07:39:36 +00:00
Craig Topper
4f55fa704b Fix a -Wpessimizing-move warning.
llvm-svn: 251773
2015-11-02 05:24:28 +00:00
Xinliang David Li
1ef7153d55 [PGO] Value profiling (index format) code cleanup and testing
1. Added a set of public interfaces in InstrProfRecord
    class to access (read/write) value profile data.
 2. Changed IndexedProfile reader and writer code to 
    use the newly defined interfaces and hide implementation
    details.
 3. Added a couple of unittests for value profiling:
   - Test new interfaces to get and set value profile data
   - Test value profile data merging with various scenarios.

 No functional change is expected. The new interfaces will also
 make it possible to change on-disk format of value prof data
 to be more compact (to be submitted). 

llvm-svn: 251771
2015-11-02 05:08:23 +00:00
Rafael Espindola
38d8e625e7 Use Child instead of child_iterator in the archive writer.
We never need to pass end(). This will also remove some complication
once we start adding error checking.

llvm-svn: 251758
2015-11-01 00:10:37 +00:00
Rafael Espindola
52f24bb108 Don't store a Child to the first regular member.
This is a bit ugly, but has a few advantages:
* Archive is now easy to copy since there is no Archive -> Child -> Archive
  loop.
* It makes it clear that we already checked for errors when finding the Child
  data.

llvm-svn: 251750
2015-10-31 21:44:42 +00:00
Rafael Espindola
d268dd1895 Delete dead code.
llvm-svn: 251749
2015-10-31 21:16:01 +00:00
Rafael Espindola
5f017c0eef Simplify handling of archive Symbol tables.
We only need to store a StringRef.

llvm-svn: 251748
2015-10-31 21:03:29 +00:00
Rafael Espindola
f0f9bc5a37 Simplify the handling of the archive string table.
We only need to store a StringRef

llvm-svn: 251746
2015-10-31 20:06:13 +00:00
Lang Hames
885f548700 Add a sys::OwningMemoryBlock class, which is a sys::MemoryBlock that owns its
underlying memory, and will automatically release it on destruction.

Use this to tidy up the orc::IndirectStubsInfo class.

llvm-svn: 251731
2015-10-31 00:55:32 +00:00
Justin Bogner
4a77d84be2 [PM] Port StripDeadPrototypes to the new pass manager
This is a really straightforward port. Also adds a test for the pass,
since it only seemed to be tested tangentially before.

llvm-svn: 251726
2015-10-30 23:28:12 +00:00
Justin Bogner
cc016f8933 [PM] Port ADCE to the new pass manager
llvm-svn: 251725
2015-10-30 23:13:18 +00:00
Justin Bogner
7d746e1b5b Whitespace. NFC
llvm-svn: 251724
2015-10-30 23:02:38 +00:00
Justin Bogner
5c07f819b9 PM: Print the IR unit's name in debug output. NFC
llvm-svn: 251723
2015-10-30 22:58:15 +00:00
Davide Italiano
48bdd477c4 [MC] Make another header NDEBUG-free.
llvm-svn: 251679
2015-10-30 01:25:50 +00:00
Alexey Samsonov
0b64fb3077 Let the users of LLVMSymbolizer decide whether they want to symbolize inlined frames.
Introduce LLVMSymbolizer::symbolizeInlinedCode() instead of switching
on PrintInlining option passed to the constructor. This will be needed
once we retrun structured data (instead of std::string) from
LLVMSymbolizer and move printing logic out.

llvm-svn: 251675
2015-10-30 00:40:20 +00:00
NAKAMURA Takumi
09526908d4 llvm/ExecutionEngine/Orc/LogicalDylib.h: Satisfy Modules.
llvm-svn: 251674
2015-10-30 00:38:01 +00:00
Alexey Samsonov
45cf1faf58 [LLVMSymbolize] Simplify SymbolizableObjectFile::symbolizeInlinedCode(). NFC.
llvm-svn: 251672
2015-10-30 00:02:55 +00:00
Alexey Samsonov
f597981cd2 [LLVMSymbolize] Move printing the description of a global into a separate function. NFC.
llvm-svn: 251669
2015-10-29 23:49:19 +00:00
Alexey Samsonov
e99709ea57 [LLVMSymbolize] Move ModuleInfo into a separate class (SymbolizableModule).
Summary:
This is mostly NFC. It is a first step in cleaning up LLVMSymbolize
library. It removes "ModuleInfo" class which bundles together ObjectFile
and its debug info context in favor of:
  * abstract SymbolizableModule in public headers;
  * SymbolizableObjectFile subclass in implementation.

Additionally, SymbolizableObjectFile is now created via factory, so we
can properly detect object parsing error at this stage instead of keeping
the broken half-parsed object. As a next step, we would be able to
propagate the error all the way back to the library user.

Further improvements might include:
  * factoring out the logic of finding appropriate file with debug info
    for a given object file, and caching all parsed object files into a
    separate class [A].
  * factoring out DILineInfo rendering [B].
This would make what is now a heavyweight "LLVMSymbolizer" a relatively
straightforward class, that calls into [A] to turn filepath into a
SymbolizableModule, delegates actual symbolization to concrete SymbolizableModule
implementation, and lets [C] render the result.

Reviewers: dblaikie, echristo, rafael

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D14099

llvm-svn: 251662
2015-10-29 22:21:37 +00:00
Lang Hames
943a5001e8 [Orc] Teach IndirectStubsManager to manage an expandable pool of stubs, rather
than a pre-allocated slab of stubs. Also add a convenience method for creating a
single stub, rather than a whole block a time.

llvm-svn: 251658
2015-10-29 22:04:22 +00:00
Lang Hames
fb1fbdd1de [Orc] Rename IndirectStubsManagerBase method 'init' to 'createStubs'.
llvm-svn: 251641
2015-10-29 18:36:27 +00:00
Matthias Braun
75235b7d5c Revert "ScheduleDAGInstrs: Remove IsPostRA flag"
It broke 3 arm testcases.

This reverts commit r251608.

llvm-svn: 251615
2015-10-29 05:06:41 +00:00
Matthias Braun
2ae11dd8a3 ScheduleDAGInstrs: Remove IsPostRA flag
This was a layering violation in ScheduleDAGInstrs (and
MachineSchedulerBase) they both shouldn't know directly whether they are
used by the PostMachineScheduler or the MachineScheduler.

llvm-svn: 251608
2015-10-29 03:57:24 +00:00
Lang Hames
5d4b1fd0d0 [Orc] Add support for RuntimeDyld::setProcessAllSections.
llvm-svn: 251604
2015-10-29 03:52:58 +00:00
Tim Northover
544933526b ARM: add watchOS default version support function.
It's useful for Clang's Driver faff.

llvm-svn: 251574
2015-10-28 22:57:14 +00:00
Tim Northover
ad54d63ab6 ARM: add support for WatchOS's compact unwind information.
llvm-svn: 251573
2015-10-28 22:56:36 +00:00
Tim Northover
829dfee297 ARM: support .watchos_version_min and .tvos_version_min.
These MachO file directives are used by linkers and other tools to provide
compatibility information, much like the existing .ios_version_min and
.macosx_version_min.

llvm-svn: 251569
2015-10-28 22:36:05 +00:00
Hal Finkel
6916956d7a Revert "r251451 - [AliasSetTracker] Use mod/ref information for UnknownInstr"
It looks like this broke the stage 2 builder:
  http://lab.llvm.org:8080/green/job/clang-stage2-configure-Rlto/6989/

Original commit message:

AliasSetTracker does not need to convert the access mode to ModRefAccess if the
new visited UnknownInst has only 'REF' modrefinfo to existing pointers in the
sets.

Patch by Andrew Zhogin!

llvm-svn: 251562
2015-10-28 22:13:41 +00:00
Lang Hames
405b433136 [Orc] Remove the 'takeOwnershipOfBuffers' kludge.
Keno Fischer fixed the underlying issue that necessitated this in r236341.

llvm-svn: 251560
2015-10-28 22:10:27 +00:00
Sanjoy Das
5aa51e5247 [SCEV] Compute max backedge count for loops with "shift ivs"
This teaches SCEV to compute //max// backedge taken counts for loops
like

    for (int i = k; i != 0; i >>>= 1)
      whatever();

SCEV yet cannot represent the exact backedge count for these loops, and
this patch does not change that.  This is really geared towards teaching
SCEV that loops like the above are *not* infinite.

llvm-svn: 251558
2015-10-28 21:27:14 +00:00
Xinliang David Li
a9583eda4e [PGO] RawProf Reader code cleanup
Add a couple of helper methods to make the primary
raw profile reader interface's implementation more
readable. It also hides more format details. This
patch has no functional change.

llvm-svn: 251546
2015-10-28 19:34:04 +00:00