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

88668 Commits

Author SHA1 Message Date
NAKAMURA Takumi
c305122653 lit/ShUtil.py: Deprecate '!' in shell expression. It is not sh-compatible.
llvm-svn: 173421
2013-01-25 06:30:36 +00:00
Andrew Trick
5050a667f4 SchedDFS: Initial support for nested subtrees.
This is mostly refactoring, along with adding an instruction count
within the subtrees and ensuring we only look at data edges.

llvm-svn: 173420
2013-01-25 06:02:44 +00:00
Chandler Carruth
0e2f6c4f00 Switch this code away from Value::isUsedInBasicBlock. That code either
loops over instructions in the basic block or the use-def list of the
value, neither of which are really efficient when repeatedly querying
about values in the same basic block.

What's more, we already know that the CondBB is small, and so we can do
a much more efficient test by counting the uses in CondBB, and seeing if
those account for all of the uses.

Finally, we shouldn't blanket fail on any such instruction, instead we
should conservatively assume that those instructions are part of the
cost.

Note that this actually fixes a bug in the pass because
isUsedInBasicBlock has a really terrible bug in it. I'll fix that in my
next commit, but the fix for it would make this code suddenly take the
compile time hit I thought it already was taking, so I wanted to go
ahead and migrate this code to a faster & better pattern.

The bug in isUsedInBasicBlock was also causing other tests to test the
wrong thing entirely: for example we weren't actually disabling
speculation for floating point operations as intended (and tested), but
the test passed because we failed to speculate them due to the
isUsedInBasicBlock failure.

llvm-svn: 173417
2013-01-25 05:40:09 +00:00
Andrew Trick
e163ac7185 MISched: Add SchedDFSResult to ScheduleDAGMI to formalize the
interface and allow other strategies to select it.

llvm-svn: 173413
2013-01-25 04:01:04 +00:00
Jack Carter
26eec3af74 This patch implements parsing the .word
directive for the Mips assembler.

Contributer: Vladimir Medic
 
llvm-svn: 173407
2013-01-25 01:31:34 +00:00
Akira Hatanaka
6866b6da71 [mips] Set flag neverHasSideEffects flag on some of the floating point instructions.
llvm-svn: 173401
2013-01-25 00:20:39 +00:00
Andrew Trick
098ac42244 SchedDFS: Refactor and tweak the subtree selection criteria.
For sanity, create a root when NumDataSuccs >= 4. Splitting large
subtrees will no longer be detrimental after my next checkin to handle
nested tree. A magic number of 4 is fine because single subtrees
seldom rejoin more than this. It makes subtrees easier to visualize
and heuristics more sane.

llvm-svn: 173399
2013-01-25 00:12:57 +00:00
Andrew Trick
d312d40b4c SchedDFS: Constify interface.
llvm-svn: 173398
2013-01-25 00:12:55 +00:00
Jakob Stoklund Olesen
708eb476f0 Avoid creating duplicate CFG edges in the IfConversion pass.
Patch by Stefan Hepp.

llvm-svn: 173395
2013-01-24 23:59:08 +00:00
Renato Golin
efde585fc3 Moving Cost Tables up to share with other targets
llvm-svn: 173382
2013-01-24 23:01:00 +00:00
Michael Gottesman
fd9cebe07d Added comment to ObjCARC elaborating what is meant by the term 'Provenance' in 'Provenance Analysis'.
llvm-svn: 173374
2013-01-24 21:35:00 +00:00
Hal Finkel
217b711226 Start cleanup of PPC register definitions using foreach loops.
No functionality change intended.

This captures the first two cases GPR32/64. For the others, we need
an addition operator (if we have one, I've not yet found it).

Based on a suggestion made by Tom Stellard in the AArch64 review!

llvm-svn: 173366
2013-01-24 20:43:18 +00:00
Saleem Abdulrasool
0e70a9950f [bugpoint] make tool selection messages unique
Change messages to help identify which interpreter was actually selected (safe
vs testing).

Signed-off-by: Saleem Abdulrasool <compnerd@compnerd.org>
Reviewed-by: Chandler Carruth <chandlerc@gmail.com>
llvm-svn: 173360
2013-01-24 16:49:14 +00:00
Saleem Abdulrasool
71b0c0fefb [bugpoint] set Message after tool configuration
Set the message returned after the GCC runner has been constructed as otherwise
the message will be overwritten by the construction of the runner, resulting in
misleading messages.

Signed-off-by: Saleem Abdulrasool <compnerd@compnerd.org>
Reviewed-by: Chandler Carruth <chandlerc@gmail.com>
llvm-svn: 173359
2013-01-24 16:49:12 +00:00
Benjamin Kramer
78bb80941e Reapply chandlerc's r173342 now that the miscompile it was triggering is fixed.
Original commit message:
Plug TTI into the speculation logic, giving it a real cost interface
that can be specialized by targets.

The goal here is not to be more aggressive, but to just be more accurate
with very obvious cases. There are instructions which are known to be
truly free and which were not being modeled as such in this code -- see
the regression test which is distilled from an inner loop of zlib.

Everywhere the TTI cost model is insufficiently conservative I've added
explicit checks with FIXME comments to go add proper modelling of these
cost factors.

If this causes regressions, the likely solution is to make TTI even more
conservative in its cost estimates, but test cases will help here.

llvm-svn: 173357
2013-01-24 16:44:25 +00:00
Benjamin Kramer
f95255b370 ConstantFolding: Add a missing folding that leads to a miscompile.
We use constant folding to see if an intrinsic evaluates to the same value as a
constant that we know. If we don't take the undefinedness into account we get a
value that doesn't match the actual implementation, and miscompiled code.

This was uncovered by Chandler's simplifycfg changes.

llvm-svn: 173356
2013-01-24 16:28:28 +00:00
NAKAMURA Takumi
b38e0d46cb unittests/SupportTests/Initialize.MultipleThreads: Enable pthread_attr_setstack(3) only on Linux.
I got blamed on darwin11;
unittests/Support/ManagedStatic.cpp:35: error: 'pthread_attr_setstack' was not declared in this scope

llvm-svn: 173355
2013-01-24 15:29:27 +00:00
NAKAMURA Takumi
a9a3c17cd4 unittests/SupportTests/Initialize.MultipleThreads: Appease --vg-leak to allocate stack explicitly for glibc.
llvm-svn: 173350
2013-01-24 14:44:02 +00:00
NAKAMURA Takumi
da80f60bac lli/RecordingMemoryManager: Free allocated sections in the destructor to satisfy --vg-leak!
FIXME: It could be generalized in MemoryManager.
llvm-svn: 173349
2013-01-24 14:12:12 +00:00
Chandler Carruth
a1525efea7 Revert r173342 temporarily. It appears to cause a very late miscompile
of stage2 in a bootstrap. Still investigating....

llvm-svn: 173343
2013-01-24 13:24:24 +00:00
Chandler Carruth
b10553145f Plug TTI into the speculation logic, giving it a real cost interface
that can be specialized by targets.

The goal here is not to be more aggressive, but to just be more accurate
with very obvious cases. There are instructions which are known to be
truly free and which were not being modeled as such in this code -- see
the regression test which is distilled from an inner loop of zlib.

Everywhere the TTI cost model is insufficiently conservative I've added
explicit checks with FIXME comments to go add proper modelling of these
cost factors.

If this causes regressions, the likely solution is to make TTI even more
conservative in its cost estimates, but test cases will help here.

llvm-svn: 173342
2013-01-24 12:39:29 +00:00
Chandler Carruth
fd4cbdd2c2 Address a large chunk of this FIXME by accumulating the cost for
unfolded constant expressions rather than checking each one
independently.

llvm-svn: 173341
2013-01-24 12:05:17 +00:00
Chandler Carruth
bc67fc9f93 Switch the constant expression speculation cost evaluation away from
a cost fuction that seems both a bit ad-hoc and also poorly suited to
evaluating constant expressions.

Notably, it is missing any support for trivial expressions such as
'inttoptr'. I could fix this routine, but it isn't clear to me all of
the constraints its other users are operating under.

The core protection that seems relevant here is avoiding the formation
of a select instruction wich a further chain of select operations in
a constant expression operand. Just explicitly encode that constraint.

Also, update the comments and organization here to make it clear where
this needs to go -- this should be driven off of real cost measurements
which take into account the number of constants expressions and the
depth of the constant expression tree.

llvm-svn: 173340
2013-01-24 11:53:01 +00:00
Chandler Carruth
3a2e7d9dea Rephrase the speculating scan of the conditional BB to be phrased in
terms of cost rather than hoisting a single instruction.

This does *not* change the cost model! We still set the cost threshold
at 1 here, it's just that we track it by accumulating cost rather than
by storing an instruction.

The primary advantage is that we no longer leave no-op intrinsics in the
basic block. For example, this will now move both debug info intrinsics
and a single instruction, instead of only moving the instruction and
leaving a basic block with nothing bug debug info intrinsics in it, and
those intrinsics now no longer ordered correctly with the hoisted value.

Instead, we now splice the entire conditional basic block's instruction
sequence.

This also places the code for checking the safety of hoisting next to
the code computing the cost.

Currently, the only observable side-effect of this change is that debug
info intrinsics are no longer abandoned. I'm not sure how to craft
a test case for this, and my real goal was the refactoring, but I'll
talk to Dave or Eric about how to add a test case for this.

llvm-svn: 173339
2013-01-24 11:52:58 +00:00
Kostya Serebryany
fb0650e49e [asan] fix 32-bit builds
llvm-svn: 173338
2013-01-24 10:43:50 +00:00
Chandler Carruth
f9694a106c Simplify the PHI node operand rewriting.
Previously, the code would scan the PHI nodes and build up a small
setvector of candidate value pairs in phi nodes to go and rewrite. Once
certain the rewrite could be performed, the code walks the set, and for
each one re-scans the entire PHI node list looking for nodes to rewrite
operands.

Instead, scan the PHI nodes once to check for hazards, and then scan it
a second time to rewrite the operands to selects. No set vector, and
a max of two scans.

The only downside is that we might form identical selects, but
instcombine or anything else should fold those easily, and it seems
unlikely to happen often.

llvm-svn: 173337
2013-01-24 10:40:51 +00:00
Kostya Serebryany
1894f1e464 [asan] adaptive redzones for globals (the larger the global the larger is the redzone)
llvm-svn: 173335
2013-01-24 10:35:40 +00:00
Chandler Carruth
965100a3c9 Give the basic block variables here names based on the if-then-end
structure being analyzed. No functionality changed.

llvm-svn: 173334
2013-01-24 09:59:39 +00:00
Chandler Carruth
71dd2ccc87 Lift a cheap early exit test above loops and other complex early exit
tests. No need to pay the high cost when we're never going to do
anything.

No functionality changed.

llvm-svn: 173331
2013-01-24 08:22:40 +00:00
Chandler Carruth
9287b19a2a Spiff up the comment on this method, making the example a bit more
pretty in doxygen, adding some of the details actually present in
a classic example where this matters (a loop from gzip and many other
compression algorithms), and a cautionary note about the risks inherent
in the transform. This has come up on the mailing lists recently, and
I suspect folks reading this code could benefit from going and looking
at the MI pass that can really deal with these issues.

llvm-svn: 173329
2013-01-24 08:05:06 +00:00
NAKAMURA Takumi
d6161ccf43 MipsISelLowering.cpp: Fill unreachable paths to fix warnings. [-Wsometimes-uninitialized]
FIXME: Could they, unreachable(s), be removed?
FIXME: I could prefer the coding standards...
llvm-svn: 173325
2013-01-24 06:08:06 +00:00
NAKAMURA Takumi
c67d03e39b MipsISelLowering.cpp: Fix a warning, take two. [-Wunused-variable]
...and fix a typo, s/#ifdef/#ifndef/

llvm-svn: 173324
2013-01-24 05:54:23 +00:00
NAKAMURA Takumi
420b657110 MipsISelLowering.cpp: Fix a warning. [-Wunused-variable]
llvm-svn: 173323
2013-01-24 05:47:29 +00:00
Craig Topper
f358937aff Remove trailing whitespace.
llvm-svn: 173322
2013-01-24 05:22:40 +00:00
Richard Trieu
53fe31003c Add asserts to SmallVector so that calls to front() and back() only succeed
if the vector is not empty.  This will ensure that calls to these functions
will reference elements in the vector.

llvm-svn: 173321
2013-01-24 04:29:24 +00:00
Reed Kotler
c2b44a1250 The next phase of Mips16 hard float implementation.
Allow Mips16 routines to call Mips32 routines that have abi requirements
that either arguments or return values are passed in floating point 
registers. This handles only the pic case. We have not done non pic
for Mips16 yet in any form.

The libm functions are Mips32, so with this addition we have a complete
Mips16 hard float implementation.

We still are not able to complete mix Mip16 and Mips32 with hard float.
That will be the next phase which will have several steps. For Mips32
to freely call Mips16 some stub functions must be created.

llvm-svn: 173320
2013-01-24 04:24:02 +00:00
Andrew Trick
11bf0a77ff MachineScheduler: enable biasCriticalPath for all DAGs.
llvm-svn: 173318
2013-01-24 02:09:57 +00:00
Andrew Trick
35ccc52ff0 MIsched: Added biasCriticalPath.
Allow schedulers to order DAG edges by critical path. This makes
DFS-based heuristics more stable and effective.

llvm-svn: 173317
2013-01-24 02:09:55 +00:00
Michael J. Spencer
c731b2e79a [ELF] Add R_X86_64_IRELATIVE.
llvm-svn: 173316
2013-01-24 02:08:25 +00:00
Bill Wendling
8e189381a8 Add a profile for uniquifying the AttributeSet with the AttributeSetNodes.
llvm-svn: 173313
2013-01-24 01:01:34 +00:00
Bill Wendling
76504777f5 Cleanup the AttributeSetNodes that we create.
llvm-svn: 173311
2013-01-24 00:14:46 +00:00
Bill Wendling
1898f7c8a5 Create a new class: AttributeSetNode.
This is a helper class for the AttributeSetImpl class. It holds a set of
attributes that apply to a single element: function, return type, or
parameter.

These are uniqued.

llvm-svn: 173310
2013-01-24 00:06:56 +00:00
Bill Wendling
de48b99148 Push down the conversion of the alignment from the bit mask to a real number into the attribute implementation class.
llvm-svn: 173304
2013-01-23 23:00:05 +00:00
Bill Wendling
2d899a78d1 Remove dead methods.
llvm-svn: 173302
2013-01-23 22:38:33 +00:00
Eli Bendersky
eb5e2ba129 Fix small typo
llvm-svn: 173298
2013-01-23 22:05:19 +00:00
Tom Stellard
71f7e6d926 R600: Add a llvm.R600.store.swizzle intrinsics
This intrinsic is translated to ALLOC_EXPORT_WORD1_SWIZ, hence its
name. It is used to store vs/fs outputs

Patch by: Vincent Lejeune

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 173297
2013-01-23 21:39:49 +00:00
Tom Stellard
4b6c827439 R600: Simplify stream outputs intrinsic
Patch by: Vincent Lejeune

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 173296
2013-01-23 21:39:47 +00:00
Benjamin Kramer
3c16a4df32 ConstantFolding: Tweak r173289, it should evaluate in the intptr type, not the index type.
llvm-svn: 173293
2013-01-23 21:21:24 +00:00
Benjamin Kramer
5ddc9bf246 ConstantFolding: Evaluate GEP indices in the index type.
This fixes some edge cases that we would get wrong with uint64_ts.
PR14986.

llvm-svn: 173289
2013-01-23 20:41:05 +00:00
Richard Osborne
8f90349114 Add instruction encodings / disassembly support for l6r instructions.
llvm-svn: 173288
2013-01-23 20:08:11 +00:00