OSDN Git Service
Andrew Trick [Fri, 25 Jan 2013 06:33:57 +0000 (06:33 +0000)]
MIsched: Improve the interface to SchedDFS analysis (subtrees).
Allow the strategy to select SchedDFS. Allow the results of SchedDFS
to affect initialization of the scheduler state.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173425
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Fri, 25 Jan 2013 06:33:52 +0000 (06:33 +0000)]
ArrayRef reverse iterators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173424
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Fri, 25 Jan 2013 06:33:50 +0000 (06:33 +0000)]
whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173423
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Fri, 25 Jan 2013 06:30:36 +0000 (06:30 +0000)]
lit/ShUtil.py: Deprecate '!' in shell expression. It is not sh-compatible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173421
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Fri, 25 Jan 2013 06:02:44 +0000 (06:02 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173420
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 25 Jan 2013 05:40:09 +0000 (05:40 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173417
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Fri, 25 Jan 2013 04:01:04 +0000 (04:01 +0000)]
MISched: Add SchedDFSResult to ScheduleDAGMI to formalize the
interface and allow other strategies to select it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173413
91177308-0d34-0410-b5e6-
96231b3b80d8
Jack Carter [Fri, 25 Jan 2013 01:31:34 +0000 (01:31 +0000)]
This patch implements parsing the .word
directive for the Mips assembler.
Contributer: Vladimir Medic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173407
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Fri, 25 Jan 2013 00:20:39 +0000 (00:20 +0000)]
[mips] Set flag neverHasSideEffects flag on some of the floating point instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173401
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Fri, 25 Jan 2013 00:12:57 +0000 (00:12 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173399
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Fri, 25 Jan 2013 00:12:55 +0000 (00:12 +0000)]
SchedDFS: Constify interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173398
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Thu, 24 Jan 2013 23:59:08 +0000 (23:59 +0000)]
Avoid creating duplicate CFG edges in the IfConversion pass.
Patch by Stefan Hepp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173395
91177308-0d34-0410-b5e6-
96231b3b80d8
Renato Golin [Thu, 24 Jan 2013 23:01:00 +0000 (23:01 +0000)]
Moving Cost Tables up to share with other targets
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173382
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Gottesman [Thu, 24 Jan 2013 21:35:00 +0000 (21:35 +0000)]
Added comment to ObjCARC elaborating what is meant by the term 'Provenance' in 'Provenance Analysis'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173374
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Thu, 24 Jan 2013 20:43:18 +0000 (20:43 +0000)]
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!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173366
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Thu, 24 Jan 2013 16:49:14 +0000 (16:49 +0000)]
[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>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173360
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Thu, 24 Jan 2013 16:49:12 +0000 (16:49 +0000)]
[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>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173359
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Thu, 24 Jan 2013 16:44:25 +0000 (16:44 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173357
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Thu, 24 Jan 2013 16:28:28 +0000 (16:28 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173356
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Thu, 24 Jan 2013 15:29:27 +0000 (15:29 +0000)]
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173355
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Thu, 24 Jan 2013 14:44:02 +0000 (14:44 +0000)]
unittests/SupportTests/Initialize.MultipleThreads: Appease --vg-leak to allocate stack explicitly for glibc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173350
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Thu, 24 Jan 2013 14:12:12 +0000 (14:12 +0000)]
lli/RecordingMemoryManager: Free allocated sections in the destructor to satisfy --vg-leak!
FIXME: It could be generalized in MemoryManager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173349
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Thu, 24 Jan 2013 13:24:24 +0000 (13:24 +0000)]
Revert r173342 temporarily. It appears to cause a very late miscompile
of stage2 in a bootstrap. Still investigating....
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173343
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Thu, 24 Jan 2013 12:39:29 +0000 (12:39 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173342
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Thu, 24 Jan 2013 12:05:17 +0000 (12:05 +0000)]
Address a large chunk of this FIXME by accumulating the cost for
unfolded constant expressions rather than checking each one
independently.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173341
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Thu, 24 Jan 2013 11:53:01 +0000 (11:53 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173340
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Thu, 24 Jan 2013 11:52:58 +0000 (11:52 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173339
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Thu, 24 Jan 2013 10:43:50 +0000 (10:43 +0000)]
[asan] fix 32-bit builds
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173338
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Thu, 24 Jan 2013 10:40:51 +0000 (10:40 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173337
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Thu, 24 Jan 2013 10:35:40 +0000 (10:35 +0000)]
[asan] adaptive redzones for globals (the larger the global the larger is the redzone)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173335
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Thu, 24 Jan 2013 09:59:39 +0000 (09:59 +0000)]
Give the basic block variables here names based on the if-then-end
structure being analyzed. No functionality changed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173334
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Thu, 24 Jan 2013 08:22:40 +0000 (08:22 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173331
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Thu, 24 Jan 2013 08:05:06 +0000 (08:05 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173329
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Thu, 24 Jan 2013 06:08:06 +0000 (06:08 +0000)]
MipsISelLowering.cpp: Fill unreachable paths to fix warnings. [-Wsometimes-uninitialized]
FIXME: Could they, unreachable(s), be removed?
FIXME: I could prefer the coding standards...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173325
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Thu, 24 Jan 2013 05:54:23 +0000 (05:54 +0000)]
MipsISelLowering.cpp: Fix a warning, take two. [-Wunused-variable]
...and fix a typo, s/#ifdef/#ifndef/
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173324
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Thu, 24 Jan 2013 05:47:29 +0000 (05:47 +0000)]
MipsISelLowering.cpp: Fix a warning. [-Wunused-variable]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173323
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 24 Jan 2013 05:22:40 +0000 (05:22 +0000)]
Remove trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173322
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Trieu [Thu, 24 Jan 2013 04:29:24 +0000 (04:29 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173321
91177308-0d34-0410-b5e6-
96231b3b80d8
Reed Kotler [Thu, 24 Jan 2013 04:24:02 +0000 (04:24 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173320
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Thu, 24 Jan 2013 02:09:57 +0000 (02:09 +0000)]
MachineScheduler: enable biasCriticalPath for all DAGs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173318
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Thu, 24 Jan 2013 02:09:55 +0000 (02:09 +0000)]
MIsched: Added biasCriticalPath.
Allow schedulers to order DAG edges by critical path. This makes
DFS-based heuristics more stable and effective.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173317
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael J. Spencer [Thu, 24 Jan 2013 02:08:25 +0000 (02:08 +0000)]
[ELF] Add R_X86_64_IRELATIVE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173316
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Thu, 24 Jan 2013 01:01:34 +0000 (01:01 +0000)]
Add a profile for uniquifying the AttributeSet with the AttributeSetNodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173313
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Thu, 24 Jan 2013 00:14:46 +0000 (00:14 +0000)]
Cleanup the AttributeSetNodes that we create.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173311
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Thu, 24 Jan 2013 00:06:56 +0000 (00:06 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173310
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Wed, 23 Jan 2013 23:00:05 +0000 (23:00 +0000)]
Push down the conversion of the alignment from the bit mask to a real number into the attribute implementation class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173304
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Wed, 23 Jan 2013 22:38:33 +0000 (22:38 +0000)]
Remove dead methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173302
91177308-0d34-0410-b5e6-
96231b3b80d8
Eli Bendersky [Wed, 23 Jan 2013 22:05:19 +0000 (22:05 +0000)]
Fix small typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173298
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Wed, 23 Jan 2013 21:39:49 +0000 (21:39 +0000)]
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>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173297
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Wed, 23 Jan 2013 21:39:47 +0000 (21:39 +0000)]
R600: Simplify stream outputs intrinsic
Patch by: Vincent Lejeune
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173296
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Wed, 23 Jan 2013 21:21:24 +0000 (21:21 +0000)]
ConstantFolding: Tweak r173289, it should evaluate in the intptr type, not the index type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173293
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Wed, 23 Jan 2013 20:41:05 +0000 (20:41 +0000)]
ConstantFolding: Evaluate GEP indices in the index type.
This fixes some edge cases that we would get wrong with uint64_ts.
PR14986.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173289
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Osborne [Wed, 23 Jan 2013 20:08:11 +0000 (20:08 +0000)]
Add instruction encodings / disassembly support for l6r instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173288
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Wed, 23 Jan 2013 19:32:37 +0000 (19:32 +0000)]
Initialize SSPBufferSize. PR14999. Patch by Vinson Lee.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173285
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Wed, 23 Jan 2013 19:06:01 +0000 (19:06 +0000)]
Remove unused methods and ivars.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173284
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Wed, 23 Jan 2013 17:52:29 +0000 (17:52 +0000)]
Revert "InstCombine: Clean up weird code that talks about a modulus that's long gone."
This causes crashes during the build of compiler-rt during selfhost. Add a
testcase for coverage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173279
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Wed, 23 Jan 2013 17:16:22 +0000 (17:16 +0000)]
InstCombine: Clean up weird code that talks about a modulus that's long gone.
This does the right thing unless the multiplication overflows, but the old code
didn't handle that case either.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173276
91177308-0d34-0410-b5e6-
96231b3b80d8
Eli Bendersky [Wed, 23 Jan 2013 17:12:15 +0000 (17:12 +0000)]
Fix powerpc test failure - forgot to initialize stack slot size for PPCLinuxMCAsmInfo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173275
91177308-0d34-0410-b5e6-
96231b3b80d8
Eli Bendersky [Wed, 23 Jan 2013 16:22:04 +0000 (16:22 +0000)]
Clean up assignment of CalleeSaveStackSlotSize: get rid of the default and explicitly set this in every target that needs to change it from the default.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173270
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Wed, 23 Jan 2013 15:21:44 +0000 (15:21 +0000)]
NVPTX: Stop leaking memory by using a managed constant instead of a new Argument.
This is still an egregious hack since we don't have a nice interface for this
kind of thing but should help the valgrind leak check buildbot to become green.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173267
91177308-0d34-0410-b5e6-
96231b3b80d8
Anton Korobeynikov [Wed, 23 Jan 2013 15:03:08 +0000 (15:03 +0000)]
Make sure metarenamer won't rename special stuff (intrinsics and explicitly renamed stuff).
Otherwise this might hide the problems.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173265
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Wed, 23 Jan 2013 12:54:55 +0000 (12:54 +0000)]
[asan] use ADD instead of OR when applying shadow offset of PowerPC. See gcc.gnu.org/bugzilla/show_bug.cgi?id=55975 for details
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173258
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Wed, 23 Jan 2013 09:09:50 +0000 (09:09 +0000)]
Initialize the components of this class. Otherwise GCC thinks that Array may be
used uninitialized, since it fails to understand that Array is only used when
SingleValue is not, and outputs a warning. It also seems generally safer given
that the constructor is non-trivial and has plenty of early exits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173242
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Wed, 23 Jan 2013 08:33:13 +0000 (08:33 +0000)]
llvm/unittests: Use OwningPtr to fix --vg-leak.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173240
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Wed, 23 Jan 2013 08:33:05 +0000 (08:33 +0000)]
IRTests/WaymarkTest.cpp: Fix in --vg-leak.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173239
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Wed, 23 Jan 2013 08:31:28 +0000 (08:31 +0000)]
IRTests/IRBuilderTest.cpp: GetIntTy: Delete DL at yourself since it is not linked.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173238
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Wed, 23 Jan 2013 08:30:39 +0000 (08:30 +0000)]
IRTests/IRBuilderTest.cpp: Let GV added to the module.
It fixes --vg-leak.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173237
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Wed, 23 Jan 2013 08:30:26 +0000 (08:30 +0000)]
IRTests/ConstantsTest.cpp: AsInstructionsTest: Delete each instruction immediately if it is not linked.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173236
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Wed, 23 Jan 2013 08:30:21 +0000 (08:30 +0000)]
Untabify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173235
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Wed, 23 Jan 2013 08:30:15 +0000 (08:30 +0000)]
Whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173234
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Wed, 23 Jan 2013 08:30:10 +0000 (08:30 +0000)]
DominatorTreeTest.cpp: Add the file header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173233
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Wed, 23 Jan 2013 06:43:53 +0000 (06:43 +0000)]
Add the heuristic to differentiate SSPStrong from SSPRequired.
The requirements of the strong heuristic are:
* A Protector is required for functions which contain an array, regardless of
type or length.
* A Protector is required for functions which contain a structure/union which
contains an array, regardless of type or length. Note, there is no limit to
the depth of nesting.
* A protector is required when the address of a local variable (i.e., stack
based variable) is exposed. (E.g., such as through a local whose address is
taken as part of the RHS of an assignment or a local whose address is taken as
part of a function argument.)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173231
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Wed, 23 Jan 2013 06:41:41 +0000 (06:41 +0000)]
Add the IR attribute 'sspstrong'.
SSPStrong applies a heuristic to insert stack protectors in these situations:
* A Protector is required for functions which contain an array, regardless of
type or length.
* A Protector is required for functions which contain a structure/union which
contains an array, regardless of type or length. Note, there is no limit to
the depth of nesting.
* A protector is required when the address of a local variable (i.e., stack
based variable) is exposed. (E.g., such as through a local whose address is
taken as part of the RHS of an assignment or a local whose address is taken as
part of a function argument.)
This patch implements the SSPString attribute to be equivalent to
SSPRequired. This will change in a subsequent patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173230
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Wed, 23 Jan 2013 06:14:59 +0000 (06:14 +0000)]
Remove the last of uses that use the Attribute object as a collection of attributes.
Collections of attributes are handled via the AttributeSet class now. This
finally frees us up to make significant changes to how attributes are structured.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173228
91177308-0d34-0410-b5e6-
96231b3b80d8
Sean Silva [Wed, 23 Jan 2013 03:21:41 +0000 (03:21 +0000)]
docs: Update title of external tutorial.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173224
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Wed, 23 Jan 2013 02:09:06 +0000 (02:09 +0000)]
R600: rework handling of the constants
Remove Cxxx registers, add new special register - "ALU_CONST" and new
operand for each alu src - "sel". ALU_CONST is used to designate that the
new operand contains the value to override src.sel, src.kc_bank, src.chan
for constants in the driver.
Patch by: Vadim Girlin
Vincent Lejeune:
- Use pointers for constants
- Fold CONST_ADDRESS when possible
Tom Stellard:
- Give CONSTANT_BUFFER_0 its own address space
- Use integer types for constant loads
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173222
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Wed, 23 Jan 2013 02:09:03 +0000 (02:09 +0000)]
R600: Add a CONST_ADDRESS node to model constant buf read
Patch by: Vincent Lejeune
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173221
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Wed, 23 Jan 2013 02:09:01 +0000 (02:09 +0000)]
R600: Factorise VTX_WORD0 and VTX_WORD1 in tblgen def
Patch by: Vincent Lejeune
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173220
91177308-0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Wed, 23 Jan 2013 01:35:00 +0000 (01:35 +0000)]
Add support for reverse pointer induction variables. These are loops that contain pointers that count backwards.
For example, this is the hot loop in BZIP:
do {
m = *--p;
*p = ( ... );
} while (--n);
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173219
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Wed, 23 Jan 2013 00:45:55 +0000 (00:45 +0000)]
Use the AttributeSet when removing multiple attributes. Use Attribute::AttrKind
when removing one attribute. This further encapsulates the use of the attributes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173214
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael J. Spencer [Wed, 23 Jan 2013 00:22:30 +0000 (00:22 +0000)]
[Support][ErrorOr] Don't use nullptr :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173212
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Wed, 23 Jan 2013 00:20:53 +0000 (00:20 +0000)]
Use the AttributeSet when adding multiple attributes and an Attribute::AttrKind
when adding a single attribute to the function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173210
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael J. Spencer [Wed, 23 Jan 2013 00:18:31 +0000 (00:18 +0000)]
[Support][ErrorOr] Add optimized specialization of ErrorOr<void>.
ErrorOr<void> represents an operation that returns nothing, but can still fail.
It should be used in cases where you need the aditional user data that ErrorOr
provides over error_code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173209
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Osborne [Tue, 22 Jan 2013 22:55:04 +0000 (22:55 +0000)]
Add instruction encodings / disassembly support for u10 / lu10 instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173204
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael J. Spencer [Tue, 22 Jan 2013 22:48:46 +0000 (22:48 +0000)]
[Support][ErrorOr] Make old gcc happy.
Apparently this is how C++98 worked pre-DR. (Thanks Richard).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173203
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Gottesman [Tue, 22 Jan 2013 21:53:43 +0000 (21:53 +0000)]
Fixed typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173202
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Gottesman [Tue, 22 Jan 2013 21:49:00 +0000 (21:49 +0000)]
[ObjCARC] Refactored out the inner most 2-loops from PerformCodePlacement into the method ConnectTDBUTraversals.
The method PerformCodePlacement was doing too much (i.e. 3x loops, lots of
different checking). This refactoring separates the analysis section of the
method into a separate function while leaving the actual code placement and
analysis preparation in PerformCodePlacement.
*NOTE* Really this part of ObjCARC should be refactored out of the main pass
class into its own seperate class/struct. But, it is not time to make that
change yet though (don't want to make such an invasive change without fixing all
of the bugs first).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173201
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Liao [Tue, 22 Jan 2013 21:47:38 +0000 (21:47 +0000)]
Fix an issue of pseudo atomic instruction DAG schedule
- Add list of physical registers clobbered in pseudo atomic insts
Physical registers are clobbered when pseudo atomic instructions are
expanded. Add them in clobber list to prevent DAG scheduler to
mis-schedule them after these insns are declared side-effect free.
- Add test case from Michael Kuperstein <michael.m.kuperstein@intel.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173200
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Enderby [Tue, 22 Jan 2013 21:44:53 +0000 (21:44 +0000)]
Add a warning when there is a macro defintion that has named parameters but
the body does not use them and it appears the body has positional parameters.
This can cause unexpected results as in the added test case. As the darwin
version of gas(1) which only supported positional parameters, happened to
ignore the named parameters. Now that we want to support both styles of
macros we issue a warning in this specific case.
rdar://
12861644
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173199
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Tue, 22 Jan 2013 21:34:25 +0000 (21:34 +0000)]
[mips] Implement MipsRegisterInfo::getRegPressureLimit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173197
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Tue, 22 Jan 2013 21:15:51 +0000 (21:15 +0000)]
More encapsulation work.
Use the AttributeSet when we're talking about more than one attribute. Add a
function that adds a single attribute. No functionality change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173196
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Enderby [Tue, 22 Jan 2013 21:09:20 +0000 (21:09 +0000)]
Have the integrated assembler give an error if $1 is used as an identifier in
an expression. Currently this bug causes the line to be ignored in a
release build and an assert in a debug build.
rdar://
13062484
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173195
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Tue, 22 Jan 2013 20:05:56 +0000 (20:05 +0000)]
[mips] Clean up code in MipsTargetLowering::LowerCall. No functional change
intended
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173189
91177308-0d34-0410-b5e6-
96231b3b80d8
Eli Bendersky [Tue, 22 Jan 2013 18:52:39 +0000 (18:52 +0000)]
Add forgotten test case for the x32 commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173181
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Tue, 22 Jan 2013 18:05:59 +0000 (18:05 +0000)]
X86: Make sure we account for the FMA4 register immediate value, otherwise rip-rel relocations will be off by one byte.
PR15040.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173176
91177308-0d34-0410-b5e6-
96231b3b80d8
Eli Bendersky [Tue, 22 Jan 2013 18:02:49 +0000 (18:02 +0000)]
Initial patch for x32 ABI support.
Add the x32 environment kind to the triple, and separate the concept of
pointer size and callee save stack slot size, since they're not equal
on x32.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173175
91177308-0d34-0410-b5e6-
96231b3b80d8
Dmitri Gribenko [Tue, 22 Jan 2013 14:39:21 +0000 (14:39 +0000)]
Tests: rewrite 'opt ... %s' to 'opt ... < %s' so that opt does not emit a ModuleID
This is done to avoid odd test failures, like the one fixed in r171243.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173163
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Samsonov [Tue, 22 Jan 2013 14:21:19 +0000 (14:21 +0000)]
llvm-symbolizer: factor out bits of the tool into separate LLVMSymbolize.{h,cpp} files. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173159
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Tue, 22 Jan 2013 13:26:53 +0000 (13:26 +0000)]
[msan] Export the value of msan-keep-going flag for the runtime.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173156
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Tue, 22 Jan 2013 12:30:52 +0000 (12:30 +0000)]
[msan] Do not insert check on volatile store.
Volatile bitfields can cause valid stores of uninitialized bits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173153
91177308-0d34-0410-b5e6-
96231b3b80d8