1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00
Commit Graph

9384 Commits

Author SHA1 Message Date
Clement Courbet
c7da651e62 [llvm-exegesis][NFC] Cleanup useless braces.
llvm-svn: 336076
2018-07-02 06:39:55 +00:00
Paul Semel
6837964f75 Revert "[llvm-readobj] Fix printing format"
There is a problem with the formatting on windows build.
I need to investigate on this.

llvm-svn: 336061
2018-07-01 11:54:09 +00:00
Paul Semel
406504e4b7 [llvm-readobj] Fix printing format
We were printing every character, even those that weren't printable. It
doesn't really make sense for this option.

The string content was sticked to its address, added two spaces in
between.

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

llvm-svn: 336058
2018-07-01 09:51:59 +00:00
Jonas Devlieghere
548fff58d8 [dsymutil] Rename conflicting declaration
Using MemoryBuffer as member name clashed with the llvm::MemoryBuffer
class.

llvm-svn: 335995
2018-06-29 17:11:34 +00:00
Jonas Devlieghere
59f7e40dac [dsymutil] Make the CachedBinaryHolder the default
Replaces all uses of the old binary holder with its cached variant.

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

llvm-svn: 335991
2018-06-29 16:51:52 +00:00
Jonas Devlieghere
077fd2e850 [dsymutil] Introduce a new CachedBinaryHolder
The original binary holder has an optimization where it caches a static
library (archive) between consecutive calls to GetObjects. However, the
actual memory buffer wasn't cached between calls.

This made sense when dsymutil was processing objects one after each
other, but when processing them in parallel, several binaries have to be
in memory at the same time. For this reason, every link context
contained a binary holder.

Having one binary holder per context is problematic, because the same
static archive was cached for every object file. Luckily, when the file
is mmap'ed, this was only costing us virtual memory.

This patch introduces a new BinaryHolder variant that is fully cached,
for all the object files it load, as well as the static archives. This
way, we don't have to give up on this optimization of bypassing the
file system.

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

llvm-svn: 335990
2018-06-29 16:50:41 +00:00
Andrea Di Biagio
a5b30c5c97 [llvm-mca] Remove field HasReadAdvanceEntries from class ReadDescriptor.
This simplifies the logic that updates RAW dependencies in the DispatchStage.
There is no advantage in storing that flag in the ReadDescriptor; we should
simply rely on the call to `STI.getReadAdvanceCycles()` to obtain the
ReadAdvance cycles. If there are no read-advance entries, then method
`getReadAdvanceCycles()` quickly returns 0.

No functional change intended.

llvm-svn: 335977
2018-06-29 14:24:46 +00:00
Jake Ehrlich
5a896e10ed [llvm-readobj] Add experimental support for SHT_RELR sections
This change adds experimental support for SHT_RELR sections, proposed
here: https://groups.google.com/forum/#!topic/generic-abi/bX460iggiKg

Definitions for the new ELF section type and dynamic array tags, as well
as the encoding used in the new section are all under discussion and are
subject to change. Use with caution!

Author: rahulchaudhry

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

llvm-svn: 335922
2018-06-28 21:07:34 +00:00
Sterling Augustine
825ac91b87 Handle absolute symbols as branch targets in disassembly.
https://reviews.llvm.org/D48554

llvm-svn: 335903
2018-06-28 18:57:13 +00:00
Vedant Kumar
812e30f156 [Debugify] Do not report line 0 locations as errors
The checking logic should not treat artificial locations as being
somehow problematic. Producing these locations can be the desired
behavior of some passes.

See llvm.org/PR37961.

llvm-svn: 335897
2018-06-28 18:21:11 +00:00
Matt Davis
50390608b5 [llvm-mca] Delete Pipeline's copy ctor and assignement operator.
Prevent copying of the Pipeline.

llvm-svn: 335885
2018-06-28 17:33:24 +00:00
Andrea Di Biagio
e6cf14997b [llvm-mca] Use a WriteRef to describe register writes in class RegisterFile.
This patch introduces a new class named WriteRef. A WriteRef is used by the
RegisterFile to keep track of register definitions. Internally it wraps a
WriteState, as well as the source index of the defining instruction.

This patch allows the tool to propagate additional information to support future
analysis on data dependencies.

llvm-svn: 335867
2018-06-28 15:50:26 +00:00
Jonas Devlieghere
0235d49a69 [dsymutil] Use UnitListTy consistently (NFC)
Use the UnitListTy typedef consistently throughout the Dwarf linker and
pass it by const reference where possible.

llvm-svn: 335860
2018-06-28 15:01:42 +00:00
Andrea Di Biagio
1a03456a00 [llvm-mca] Refactor method RegisterFile::collectWrites(). NFCI
Rather than calling std::find in a loop, just sort the vector and remove
duplicate entries at the end of the function.

Also, move the debug print at the end of the function, and query the
MCRegisterInfo to print register names rather than physreg IDs.

No functional change intended.

llvm-svn: 335837
2018-06-28 11:20:14 +00:00
Clement Courbet
68d7181227 [llvm-exegesis] Add partial X87 support.
Summary:
This enables the X86-specific X86FloatingPointStackifierPass, and allow
llvm-exegesis to generate and measure X87 latency/uops for some FP ops.

Reviewers: gchatelet

Subscribers: tschuett, llvm-commits

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

llvm-svn: 335815
2018-06-28 07:41:16 +00:00
Alex Lorenz
fc76bbc06d [cmake][xcode-toolchain] add support for major Xcode version >= 10
The regex that extracts the Xcode version should support major versions with two
digits.

rdar://41465184

llvm-svn: 335801
2018-06-28 00:39:09 +00:00
Fangrui Song
ca4ba5cdc7 [llvm-objdump] Add -x --all-headers options
Reviewers: paulsemel, echristo

Subscribers: llvm-commits

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

llvm-svn: 335785
2018-06-27 20:45:11 +00:00
Jonas Devlieghere
f589dab5bf [dsymutil] Move abstractions into separate files (NFC)
This patch splits off some abstractions used by dsymutil's dwarf linker
and moves them into separate header and implementation files. This
almost halves the number of LOC in DwarfLinker.cpp and makes it a lot
easier to understand what functionality lives where.

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

llvm-svn: 335749
2018-06-27 16:13:40 +00:00
Matt Davis
92f0c6b4ce [llvm-mca] Register listeners with stages; remove Pipeline dependency from Stage.
Summary:
This patch removes a few callbacks from Pipeline.  It comes at the cost of
registering Listeners with all Stages.  Not all stages need listeners or issue
callbacks, this registration is a bit redundant.  However, as we build-out the
API, this redundancy can disappear.

The main purpose here is to move callback code from the Pipeline and into the
stages that actually issue those callbacks. This removes the back-pointer to
the Pipeline that was put into a few Stage subclasses.

Reviewers: andreadb, courbet, RKSimon

Reviewed By: andreadb, courbet

Subscribers: tschuett, gbedwell, llvm-commits

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

llvm-svn: 335748
2018-06-27 16:09:33 +00:00
Andrea Di Biagio
bb10807000 [llvm-mca] Avoid calling method update() on instructions that are already in the IS_READY state. NFCI
When promoting instructions from the wait queue to the ready queue, we should
check if an instruction has already reached the IS_READY state before
calling method update().

llvm-svn: 335722
2018-06-27 11:17:07 +00:00
Matt Davis
7c9f26f009 [llvm-mca] Add a comment to Stage::execute and fix a spelling error. NFC.
llvm-svn: 335697
2018-06-27 00:54:11 +00:00
Vedant Kumar
8c93d49cb8 [Debugify] Handle failure to get fragment size when checking dbg.values
It's not possible to get the fragment size of some dbg.values. Teach the
mis-sized dbg.value diagnostic to detect this scenario and bail out.

Tested with:
$ find test/Transforms -print -exec opt -debugify-each -instcombine {} \;

llvm-svn: 335695
2018-06-27 00:47:52 +00:00
Vedant Kumar
9b42ff11c0 [Debugify] Diagnose mis-sized dbg.values
Report an error in -check-debugify when the size of a dbg.value operand
doesn't match up with the size of the variable it describes.

Eventually this check should be moved into the IR verifier. For the
moment, it's useful to include the check in -check-debugify as a means
of catching regressions and finding existing bugs.

Here are some instances of bugs the new check finds in the -O2 pipeline
(all in InstCombine):

1) A float is used where a double is expected:

ERROR: dbg.value operand has size 32, but its variable has size 64:
call void @llvm.dbg.value(metadata float %expf, metadata !12, metadata
!DIExpression()), !dbg !15

2) An i8 is used where an i32 is expected:

ERROR: dbg.value operand has size 8, but its variable has size 32:
call void @llvm.dbg.value(metadata i8 %t4, metadata !14, metadata
!DIExpression()), !dbg !24

3) A <4 x i32> is used where something twice as large is expected
(perhaps a <4 x i64>, I haven't double-checked):

ERROR: dbg.value operand has size 128, but its variable has size 256:
call void @llvm.dbg.value(metadata <4 x i32> %4, metadata !40, metadata
!DIExpression()), !dbg !95

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

llvm-svn: 335682
2018-06-26 22:46:41 +00:00
Lang Hames
857b27372d [ORC] Add LLJIT and LLLazyJIT, and replace OrcLazyJIT in LLI with LLLazyJIT.
LLJIT is a prefabricated ORC based JIT class that is meant to be the go-to
replacement for MCJIT. Unlike OrcMCJITReplacement (which will continue to be
supported) it is not API or bug-for-bug compatible, but targets the same
use cases: Simple, non-lazy compilation and execution of LLVM IR.

LLLazyJIT extends LLJIT with support for function-at-a-time lazy compilation,
similar to what was provided by LLVM's original (now long deprecated) JIT APIs.

This commit also contains some simple utility classes (CtorDtorRunner2,
LocalCXXRuntimeOverrides2, JITTargetMachineBuilder) to support LLJIT and
LLLazyJIT.

Both of these classes are works in progress. Feedback from JIT clients is very
welcome!

llvm-svn: 335670
2018-06-26 21:35:48 +00:00
Vedant Kumar
6431dad8b9 [Debugify] Don't treat missing dbg.values as an error (PR37942)
When checking the debug info in a module, don't treat a missing
dbg.value as an error. The dbg.value may simply have been DCE'd, in
which case the debugger has enough information to display the variable
as <optimized out>.

llvm-svn: 335647
2018-06-26 18:54:10 +00:00
Teresa Johnson
5393f3b3d0 [ThinLTO] Parse module summary index from assembly
Summary:
Adds assembly parsing support for the module summary index (follow on
to r333335 which added the assembly writing support).

I added support to llvm-as to invoke the index parsing, so that it can
create either a bitcode file with a Module and a per-module index, or
a combined index without a Module.

I will send follow on patches soon to do the following:
- add support to tools such as llvm-lto2 to parse the per-module indexes
from assembly instead of bitcode when testing the thin link.
- verification support.

Depends on D47844 and D47842.

Reviewers: pcc, dexonsmith, mehdi_amini

Subscribers: inglorion, eraman, steven_wu, llvm-commits

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

llvm-svn: 335602
2018-06-26 13:56:49 +00:00
Andrea Di Biagio
95b54979b5 [llvm-mca] Removed wrong NDEBUG guards introduced by my last commit.
This partially reverts r335589.

llvm-svn: 335592
2018-06-26 11:00:21 +00:00
Clement Courbet
82967e1456 [llvm-exegesis][NFC] Fix windows warning in rL335465.
llvm-svn: 335591
2018-06-26 10:52:41 +00:00
Andrea Di Biagio
a58b32e07f [llvm-mca] Remove unused header files and correctly guard some include headers under NDEBUG. NFC
llvm-svn: 335589
2018-06-26 10:44:12 +00:00
Clement Courbet
6b7cfabf55 [llvm-exegesis] Get the BenchmarkRunner from the ExegesisTarget.
Summary:
This allows targets to override code generation for some instructions.
As an example of override, this also moves ad-hoc instruction filtering
for X86 into the X86 ExegesisTarget.

Reviewers: gchatelet

Subscribers: mgorny, tschuett, llvm-commits

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

llvm-svn: 335582
2018-06-26 08:49:30 +00:00
Matt Davis
12a71b7b2e [llvm-mca] Rename Backend to Pipeline. NFC.
Summary:
This change renames the Backend and BackendPrinter to Pipeline and PipelinePrinter respectively. 
Variables and comments have also been updated to reflect this change.

The reason for this rename, is to be slightly more correct about what MCA is modeling.  MCA models a Pipeline, which implies some logical sequence of stages. 

Reviewers: andreadb, courbet, RKSimon

Reviewed By: andreadb, courbet

Subscribers: mgorny, javed.absar, tschuett, gbedwell, llvm-commits

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

llvm-svn: 335496
2018-06-25 16:53:00 +00:00
Clement Courbet
90aa12f893 [llvm-exegesis][NFC] Remove unnecessary member variables.
llvm-svn: 335470
2018-06-25 13:44:27 +00:00
Clement Courbet
4267839df1 [llvm-exegesis] Fix warning in r22752: Initialize IsSnippetSetupComplete.
llvm-svn: 335467
2018-06-25 13:39:50 +00:00
Clement Courbet
3af012a962 [llvm-exegesis] Generate snippet setup code.
Summary:
This ensures that the snippet always sees the same values for registers,
making measurements reproducible.
This will also allow exploring different values.

Reviewers: gchatelet

Subscribers: tschuett, llvm-commits

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

llvm-svn: 335465
2018-06-25 13:12:02 +00:00
Clement Courbet
7abf7b7157 [llvm-exegesis][NFC] Simplify BenchmarkRunner ctor.
llvm-svn: 335456
2018-06-25 11:44:29 +00:00
Clement Courbet
30b11759a0 [llvm-exegesis][NFC] clang-format
llvm-svn: 335452
2018-06-25 11:22:23 +00:00
Clement Courbet
8f523d739b [llvm-exegesis][NFC] Fix Operand class comments.
llvm-svn: 335450
2018-06-25 11:12:30 +00:00
Brad Smith
8aefa759a7 [CMake] Support building shared library for OpenBSD
llvm-svn: 335424
2018-06-23 21:26:44 +00:00
Jonas Devlieghere
e287e69ef8 [llc] Fix sanitizer failure.
Store the string on the stack rather than just the StringRef.

Fix sanitizer bots:

  http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/19948
  http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap-msan/builds/5500

llvm-svn: 335423
2018-06-23 19:04:10 +00:00
Jonas Devlieghere
7e849faa90 [llc] Use WithColor for printing errors/warnings
Use the WithColor helper from support to print errors and warnings.

llvm-svn: 335418
2018-06-23 16:51:10 +00:00
Jonas Devlieghere
738806ef2e [llvm-config] Use WithColor for printing errors.
Use the WithColor helper from support to print errors.

llvm-svn: 335417
2018-06-23 16:50:09 +00:00
Jonas Devlieghere
d68f8db2e1 [llvm-mt] Use WithColor for printing errors.
Use the WithColor helper from support to print errors.

llvm-svn: 335416
2018-06-23 16:49:07 +00:00
Fangrui Song
b467e3df92 [llvm-size] Make global variables static
llvm-svn: 335397
2018-06-22 22:20:10 +00:00
Matt Davis
e6c725e139 [llvm-mca] Remove unnecessary include and forward decl in RCU. NFC.
The DispatchUnit is no longer a dependency of RCU, so this patch removes a
stale include and forward decl.  This patch also cleans up some comments.

llvm-svn: 335392
2018-06-22 21:35:26 +00:00
Andrea Di Biagio
fa489a9fd0 [llvm-mca] Remove redundant call. NFC
llvm-svn: 335368
2018-06-22 17:03:40 +00:00
Andrea Di Biagio
6a1ca757a7 [llvm-mca] Set the operand ID for implicit register reads/writes. NFC
Also, move the definition of InstRef at the end of Instruction.h to avoid a
forward declaration.

llvm-svn: 335363
2018-06-22 16:37:05 +00:00
Matt Davis
85ee56f371 [llvm-mca] Introduce a sequential container of Stages
Summary:
Remove explicit stages and introduce a list of stages.

A pipeline should be composed of an arbitrary list of stages, and not any
 predefined list of stages in the Backend.  The Backend should not know of any
 particular stage, rather it should only be concerned that it has a list of
 stages, and that those stages will fulfill the contract of what it means to be
 a Stage (namely pre/post/execute a given instruction).

For now, we leave the original set of stages defined in the Backend ctor;
however, I imagine these will be moved out at a later time.

This patch makes an adjustment to the semantics of Stage::isReady.
Specifically, what the Backend really needs to know is if a Stage has
unfinished work.  With that said, it is more appropriately renamed
Stage::hasWorkToComplete().  This change will clean up the check in
Backend::run(), allowing us to query each stage to see if there is unfinished
work, regardless of what subclass a stage might be.  I feel that this change
simplifies the semantics too, but that's a subjective statement.

Given how RetireStage and ExecuteStage handle data in their preExecute(), I've
had to change the order of Retire and Execute in our stage list.  Retire must
complete any of its preExecute actions before ExecuteStage's preExecute can
take control.  This is mainly because both stages utilize the RCU.  In the
meantime, I want to see if I can adjust that or remove that coupling.

Reviewers: andreadb, RKSimon, courbet

Reviewed By: andreadb

Subscribers: tschuett, gbedwell, llvm-commits

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

llvm-svn: 335361
2018-06-22 16:17:26 +00:00
Jonas Devlieghere
b92270b149 [dsymutil] Force mmap'ing of binaries
After the recent refactoring that introduced parallel handling of
different object, the binary holder became unique per object file. This
defeats its optimization of caching archives, leading to an archive
being opened for every binary it contains. This is obviously unfortunate
and will need to be refactored soon.

Luckily in practice, the impact of this is limited as most files are
mmap'ed instead of memcopy'd. There's a caveat however: when the memory
buffer requires a null terminator and it's a multiple of the page size,
we allocate instead of mmap'ing. If this happens for a static archive,
we end up with N copies of it in memory, where N is the number of
objects in the archive, leading to exuberant memory usage. This provided
a stopgap solution to ensure that all the files it loads are mmap in
memory by removing the requirement for a terminating null byte.

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

llvm-svn: 335293
2018-06-21 21:37:53 +00:00
Clement Courbet
fec24f4c46 [llvm-exegesis][NFC] Simplify BenchmarkRunner.
Get rid of createExecutableFunction().

llvm-svn: 335240
2018-06-21 14:49:04 +00:00
Clement Courbet
38982ae99f [llvm-exegesis][NFC] Simplify LLVMState.
Summary: Pretty much everything we need is in llvm::TargetMachine.

Reviewers: gchatelet

Subscribers: llvm-commits, tschuett

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

llvm-svn: 335237
2018-06-21 14:11:09 +00:00