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

102958 Commits

Author SHA1 Message Date
Saleem Abdulrasool
a99163e8ee ARM: partially handle 32-bit relocations for WoA
IMAGE_REL_ARM_MOV32T relocations require that the movw/movt pair-wise
relocation is not split up and reordered. When expanding the mov32imm
pseudo-instruction, create a bundle if the machine operand is referencing an
address.  This helps ensure that the relocatable address load is not reordered
by subsequent passes.

Unfortunately, this only partially handles the case as the Constant Island Pass
occurs after the instructions are unbundled and does not properly handle
bundles.  That is a more fundamental issue with the pass itself and beyond the
scope of this change.

llvm-svn: 207608
2014-04-30 04:54:58 +00:00
Rafael Espindola
cc84bed91a Simplify getSymbolOffset.
We can now use EvaluateAsValue to make it non recursive and remove some code
duplication.

llvm-svn: 207604
2014-04-30 03:06:06 +00:00
Chandler Carruth
077dd8f1b4 [ADT] Provide some helpful static_asserts for using operations of the
wrong iterator category. These aren't comprehensive, but they have
caught the common cases for me and produce much nicer errors.

llvm-svn: 207601
2014-04-30 00:49:32 +00:00
Alexey Samsonov
4460fa769e [DWARF parser] Cleanup code in DWARFDebugLine.
Streamline parsing and dumping line tables:
Prefer composition to multiple inheritance in DWARFDebugLine::ParsingState.
Get rid of the weird concept of "DumpingState" structure.

was:
  DWARFDebugLine::DumpingState state(OS);
  DWARFDebugLine::parseStatementTable(..., state);
now:
  DWARFDebugLine::LineTable LineTable;
  LineTable.parse(...);
  LineTable.dump(OS);

No functionality change.

llvm-svn: 207599
2014-04-30 00:09:19 +00:00
Reid Kleckner
a6d2fff5aa Implement X86 code generation for musttail
Currently, musttail codegen is relying on sibcall optimization, and
reporting a fatal error if fails.  Sibcall optimization fails when stack
arguments need to be modified, which is insufficient for musttail.

The logic for moving arguments in memory safely is already implemented
for GuaranteedTailCallOpt.  This change merely arranges for musttail
calls to use it.

No functional change for GuaranteedTailCallOpt.

Reviewers: espindola

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

llvm-svn: 207598
2014-04-29 23:55:41 +00:00
Reid Kleckner
3bf732b9a9 Fix the build with MSVC 2013 by explicitly requesting llvm::make_unique
MSVC 2013 provides std::make_unique, which it finds with ADL when one of
the parameters is std::unique_ptr, leading to an ambiguous overload.

llvm-svn: 207597
2014-04-29 23:54:52 +00:00
Benjamin Kramer
b1deb46708 Another missing include for MSVC.
llvm-svn: 207596
2014-04-29 23:46:48 +00:00
David Blaikie
b630e434da Fix some 80 cols violations committed in r207539
Caught by Eric Christopher in post-commit review.

llvm-svn: 207595
2014-04-29 23:43:06 +00:00
Benjamin Kramer
bcec9153e8 Try to fix the msvc build.
llvm-svn: 207594
2014-04-29 23:37:02 +00:00
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