1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-18 18:42:46 +02:00
Commit Graph

102949 Commits

Author SHA1 Message Date
Benjamin Kramer
4f8fb8ff6c raw_ostream: Forward declare OpenFlags and include FileSystem.h only where necessary.
llvm-svn: 207593
2014-04-29 23:26:49 +00:00
Tom Stellard
3ec8469dc6 R600: Remove duplicate setting of SELECT expansion.
It's already set in AMDGPUISelLowering for all GPUs

Patch By: Jan Vesely

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 207592
2014-04-29 23:12:55 +00:00
Tom Stellard
c58951c37c R600/SI: Custom lower SI_IF and SI_ELSE to avoid machine verifier errors
SI_IF and SI_ELSE are terminators which also produce a value.  For
these instructions ISel always inserts a COPY to move their value
to another basic block.  This COPY ends up between SI_(IF|ELSE)
and the S_BRANCH* instruction at the end of the block.

This breaks MachineBasicBlock::getFirstTerminator() and also the
machine verifier which assumes that terminators are grouped together at
the end of blocks.

To solve this we coalesce the copy away right after ISel to make sure
there are no instructions in between terminators at the end of blocks.

llvm-svn: 207591
2014-04-29 23:12:53 +00:00
Tom Stellard
26a1c5b403 R600/SI: Only select SALU instructions in the entry or exit block
SALU instructions ignore control flow, so it is not always safe to use
them within branches.  This is a partial solution to this problem
until we can come up with something better.

llvm-svn: 207590
2014-04-29 23:12:48 +00:00
Tom Stellard
9112e301ba R600: optimize the UDIVREM 64 algorithm
This is a squash of several optimization commits:
 - calculate DIV_Lo and DIV_Hi separately
 - use BFE_U32 if we are operating on 32bit values
 - use precomputed constants instead of shifting in UDVIREM
 - skip the first 32 iterations of udivrem

v2: Check whether BFE is supported before using it

Patch by: Jan Vesely

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 207589
2014-04-29 23:12:46 +00:00
Tom Stellard
42ce4f9d81 R600: Implement iterative algorithm for udivrem
Initial implementation, rather slow

Patch by: Jan Vesely

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 207588
2014-04-29 23:12:45 +00:00
Tom Stellard
cbed2c43ab R600: Change UDIV/UREM to UDIVREM when legalizing types
When legalizing ops, with UDIV/UREM set to expand, they automatically
expand to UDIVREM (if legal or custom).
We need to do this manually for legalize types.

v2:
  SI should be set to Expand because the type is legal, and it is
    automatically lowered to UDIVREM if UDIVREM is Legal/Custom
  R600 should set to UDIV/UREM to Custom because it needs to lower them
    during type legalization

Patch by: Jan Vesely

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 207587
2014-04-29 23:12:43 +00:00
Tom Stellard
ce760e4826 R600: remove unused variable
Patch by: Jan Vesely

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 207586
2014-04-29 23:12:38 +00:00
Jim Grosbach
c9daf08519 Tidy up.
llvm-svn: 207585
2014-04-29 22:41:58 +00:00
Jim Grosbach
d4614a7a4c Spelling.
llvm-svn: 207584
2014-04-29 22:41:55 +00:00
Jim Grosbach
f4913dabb0 Tidy up whitespace.
llvm-svn: 207583
2014-04-29 22:41:50 +00:00
Rafael Espindola
f399f03ccc Also handle ConstantAggregateZero when optimizing vpermilvar*.
llvm-svn: 207582
2014-04-29 22:20:40 +00:00
David Blaikie
25bbbeb039 Fix MSVC build broken by r207580
Seems MSVC wants to be able to codegen inline-definitions of virtual
functions even in TUs that don't define the key function - and it's well
within its rights to do so.

llvm-svn: 207581
2014-04-29 22:04:55 +00:00
David Blaikie
19fb98da55 PR19553: Memory leak in RuntimeDyldELF::createObjectImageFromFile
This starts in MCJIT::getSymbolAddress where the
unique_ptr<object::Binary> is release()d and (after a cast) passed to a
single caller, MCJIT::addObjectFile.

addObjectFile calls RuntimeDyld::loadObject.
RuntimeDld::loadObject calls RuntimeDyldELF::createObjectFromFile

And the pointer is never owned at this point. I say this point, because
the alternative codepath, RuntimeDyldMachO::createObjectFile certainly
does take ownership, so this seemed like a good hint that this was a/the
right place to take ownership.

llvm-svn: 207580
2014-04-29 21:52:46 +00:00
Alexey Samsonov
7815beb44c [DWARF parser] Cleanup code in DWARFDebugLine.
Move several function definitions into .cpp, unify constructors
and clear() methods (fixing a couple of latent bugs from copy-paste),
turn static function parsePrologue() into Prologue::parse().

More work needed here to untangle weird multiple inheritance
in table parsing and dumping.

No functionality change.

llvm-svn: 207579
2014-04-29 21:28:13 +00:00
Rafael Espindola
b4468db535 Remove tabs.
Sorry, new machine and I forgot to change the editor setting.

llvm-svn: 207578
2014-04-29 21:02:37 +00:00
Rafael Espindola
7372093fcc Two fixes to the vpermilvar optimization.
The instcomine logic to handle vpermilvar's pd and 256 variants was incorrect.
The _256 variants have indexes into the individual 128 bit lanes and in all
cases it also has to mask out unused bits.

llvm-svn: 207577
2014-04-29 20:41:54 +00:00
Andrea Di Biagio
c4686ab272 [Windows] Fix assertion failure when passing 'nul' in input to clang.
Before this patch, if 'nul' was passed in input to clang, function
getStatus() (in Path.inc) always returned an instance of file_status with
field 'nFileSizeHigh' and 'nFileSizeLow' left uninitialized.

This was causing the triggering of an assertion failure in MemoryBuffer.cpp due
to an invalid FileSize for device 'nul'.

This patch fixes the assertion failure modifying the constructors of class
file_status (in llvm/Support/FileSystem.h) so that every field of the class
gets initialized to zero by default.

A clang test will be submitted on a separate patch.

llvm-svn: 207575
2014-04-29 20:17:28 +00:00
Diego Novillo
210bb92cec Fix vectorization remarks.
This patch changes the vectorization remarks to also inform when
vectorization is possible but not beneficial.

Added tests to exercise some loop remarks.

llvm-svn: 207574
2014-04-29 20:06:10 +00:00
Yi Jiang
f658582852 Continue slp vectorization even the BB already has vectorized store radar://16641956
llvm-svn: 207572
2014-04-29 19:37:20 +00:00
Yi Jiang
1c75ac2f65 Add slp vectorization to LTO passes
llvm-svn: 207571
2014-04-29 19:35:39 +00:00
Adam Nemet
109f756317 Reapply r207271 without the testcase
PR19608 was filed to find a suitable testcase.

llvm-svn: 207569
2014-04-29 18:25:28 +00:00
Reed Kotler
35d83f6d01 Add Simple return instruction to Mips fast-isel
Reviewers: dsanders

Reviewed by: dsanders

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

llvm-svn: 207565
2014-04-29 17:57:50 +00:00
Alexey Samsonov
f79fa7ca78 [DWARF parser] Compress DIEMinimal even further, simplify building DIE tree.
DIE doesn't need to store a pointer to its parent: we can traverse the DIE tree
only with functions getFirstChild() and getSibling(). Parents must be known
only when we construct the tree. Rewrite setDIERelations() procedure in a more
straightforward way, and get rid of lots of now unused DIEMinimal methods.

No functionality change.

llvm-svn: 207563
2014-04-29 17:12:42 +00:00
Duncan P. N. Exon Smith
20f3c553c3 SupportTest: Fix test names harder
r207552, r207553 and r207554 all had bad test names.

llvm-svn: 207560
2014-04-29 17:07:45 +00:00
Duncan P. N. Exon Smith
4098e101ab BranchProb: Simplify printing code
llvm-svn: 207559
2014-04-29 17:07:42 +00:00
Daniel Sanders
25e96ccaa5 [mips] Remove two more redundant 'let Predicates = [HasStdEnc]' statements that were missed
Summary:
The InstSE class already initializes Predicates to [HasStdEnc].

No functional change (confirmed by diffing tablegen-erated files before and
after)

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

llvm-svn: 207558
2014-04-29 17:04:30 +00:00
Duncan P. N. Exon Smith
99edeb29f9 Support: Remove out-of-date comments
The code is now shared... no need for a note.

llvm-svn: 207555
2014-04-29 16:47:39 +00:00
Duncan P. N. Exon Smith
dc1467a909 Support: More BlockFrequencyTest => BranchProbabilityTest
llvm-svn: 207554
2014-04-29 16:44:59 +00:00
Duncan P. N. Exon Smith
94500f7bdf Support: Fix test name
llvm-svn: 207553
2014-04-29 16:44:56 +00:00
Duncan P. N. Exon Smith
ceb937b892 Support: BlockFrequencyTest => BranchProbabilityTest
Move a detailed test of `BranchProbability::scale()` from
`BlockFrequencyTest` over to `BranchProbabilityTest`.

llvm-svn: 207552
2014-04-29 16:40:17 +00:00
Daniel Sanders
871eb0c5ab [mips] Remove more redundant 'let Predicates = [HasStdEnc]' statements
Summary:
The InstSE class already initializes Predicates to [HasStdEnc].

No functional change (confirmed by diffing tablegen-erated files before and
after)

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

llvm-svn: 207551
2014-04-29 16:37:01 +00:00
Duncan P. N. Exon Smith
c69dc1873d blockfreq: Defer to BranchProbability::scale() (again)
Change `BlockFrequency` to defer to `BranchProbability::scale()` and
`BranchProbability::scaleByInverse()`.

This removes `BlockFrequency::scale()` from its API (and drops the
ability to see the remainder), but the only user was the unit tests.  If
some code in the future needs an API that exposes the remainder, we can
add something to `BranchProbability`, but I find that unlikely.

llvm-svn: 207550
2014-04-29 16:31:29 +00:00
Daniel Sanders
8283444f69 [mips] Remove redundant 'let Predicates = [HasStdEnc]' statements
Summary:
The MipsPat class already initializes Predicates to [HasStdEnc].

No functional change (confirmed by diffing tablegen-erated files before and
after)

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

llvm-svn: 207548
2014-04-29 16:24:10 +00:00
Duncan P. N. Exon Smith
705fc7169e blockfreq: Defer to BranchProbability::scale()
`BlockMass` can now defer to `BranchProbability::scale()`.

llvm-svn: 207547
2014-04-29 16:20:05 +00:00
Duncan P. N. Exon Smith
cec1cab62a blockfreq: Remove BlockMass*BlockMass
Since `BlockMass` is an implementation detail and there are no current
users of this, delete `BlockMass::operator*=(BlockMass)`.  I might need
this when I try to strip out `UnsignedFloat`, but I can pull it back in
at that point.

llvm-svn: 207546
2014-04-29 16:20:01 +00:00
Duncan P. N. Exon Smith
6272612edf Support: remove unnecessary namespace
llvm-svn: 207545
2014-04-29 16:15:39 +00:00
Duncan P. N. Exon Smith
795a469331 Support: Add BranchProbability::scale() and ::scaleByInverse()
Add API to `BranchProbability` for scaling big integers.  Next job is to
rip the logic out of `BlockMass` and `BlockFrequency`.

llvm-svn: 207544
2014-04-29 16:15:35 +00:00
Dan Liew
7443a54439 Document recently added sphinx documentation options in
CMake.

llvm-svn: 207543
2014-04-29 16:13:27 +00:00
Duncan P. N. Exon Smith
213e011e56 Support: Simplify BranchProbability operators
llvm-svn: 207541
2014-04-29 16:12:16 +00:00
Duncan P. N. Exon Smith
07635528fc Support: Add unit tests for BranchProbability
llvm-svn: 207540
2014-04-29 16:12:13 +00:00
David Blaikie
1fbf8e4869 DwarfDebug: Split the initialization of abstract and non-abstract subprogram DIEs.
These were called from distinct places and had significant distinct
behavior. No need to make that a dynamic check inside the function
rather than just having two functions (refactoring some common code into
a helper function to be called from the two separate functions).

llvm-svn: 207539
2014-04-29 15:58:35 +00:00
NAKAMURA Takumi
87feb9c27d LinkModulesTest.cpp: Reformat.
llvm-svn: 207537
2014-04-29 15:52:46 +00:00
NAKAMURA Takumi
3f665c3db5 [CMake] Enable llvm/unittests/LinkerTests. It had not been enabled since r199354.
llvm-svn: 207536
2014-04-29 15:52:36 +00:00
NAKAMURA Takumi
2342fb5ffb LinkModulesTest.cpp: Use test-specific Ctx instead of getGlobalContext(). The global context might not be free'd. [vg_leak]
llvm-svn: 207535
2014-04-29 15:52:27 +00:00
Tilmann Scheller
d80a396b38 [ARM64] Disable regression tests for the old JIT.
Since the ARM64 backend doesn't implement support for the old JIT those tests are failing when the regression tests are run on an AArch64 host.

llvm-svn: 207530
2014-04-29 15:02:40 +00:00
Daniel Sanders
26318df9b5 [mips][msa] Use CHECK-LABEL in basic_operations*.ll
Differential Revision: http://reviews.llvm.org/D3536

llvm-svn: 207529
2014-04-29 14:28:58 +00:00
Diego Novillo
81a83e3d17 Add optimization remarks to the loop unroller and vectorizer.
Summary:
This calls emitOptimizationRemark from the loop unroller and vectorizer
at the point where they make a positive transformation. For the
vectorizer, it reports vectorization and interleave factors. For the
loop unroller, it reports all the different supported types of
unrolling.

Subscribers: llvm-commits

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

llvm-svn: 207528
2014-04-29 14:27:31 +00:00
Joerg Sonnenberger
2978bd4236 Parse and create GOT_PREL relocations.
llvm-svn: 207526
2014-04-29 13:42:02 +00:00
Daniel Sanders
abb97916be [mips][msa] Fix element extraction where the index is variable.
Summary:
This isn't supported directly so we splat the vector element and extract
the most convenient copy.

Reviewers: matheusalmeida

Reviewed By: matheusalmeida

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

llvm-svn: 207524
2014-04-29 13:31:37 +00:00