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

59018 Commits

Author SHA1 Message Date
Richard Osborne
373bdcfeb5 [XCore] Add missing l2rus instructions.
These instructions are not targeted by the compiler but they are
needed for the MC layer.

llvm-svn: 173634
2013-01-27 22:28:30 +00:00
Bill Wendling
c1f9afeb84 Privitize some the copy c'tor and assignment operator of uniquified objects.
llvm-svn: 173632
2013-01-27 21:38:03 +00:00
Bill Wendling
4f0a1bba14 Add some helpful comments.
llvm-svn: 173631
2013-01-27 21:32:11 +00:00
Richard Osborne
72f31f9da6 [XCore] Add missing l2r instructions.
These instructions are not targeted by the compiler but they are
needed for the MC layer.

llvm-svn: 173629
2013-01-27 21:26:02 +00:00
Bill Wendling
bc0a92c4bd s/AttrList/pImpl/g in AttributeSet. No functionality change.
llvm-svn: 173628
2013-01-27 21:23:46 +00:00
Bill Wendling
2b431a6fb5 Start using more of the AttrNode in the AttributeSetImpl class.
Also add some asserts.

llvm-svn: 173627
2013-01-27 21:20:06 +00:00
Benjamin Kramer
6107b802a9 Legalizer: Reword comment again, per Duncan's suggestion.
llvm-svn: 173625
2013-01-27 21:02:52 +00:00
Richard Osborne
70183ce54a [XCore] Add missing 1r instructions.
These instructions are not targeted by the compiler but they are
needed for the MC layer.

llvm-svn: 173624
2013-01-27 20:46:21 +00:00
Richard Osborne
be996a5261 [XCore] Add missing 0r instructions.
These instructions are not targeted by the compiler but they are
needed for the MC layer.

llvm-svn: 173623
2013-01-27 20:42:57 +00:00
Hal Finkel
115cffae92 BBVectorize: Better use of TTI->getShuffleCost
When flipping the pair of subvectors that form a vector, if the
vector length is 2, we can use the SK_Reverse shuffle kind to get
more-accurate cost information. Also we can use the SK_ExtractSubvector
shuffle kind to get accurate subvector extraction costs.

The current cost model implementations don't yet seem complex enough
for this to make a difference (thus, there are no test cases with this
commit), but it should help in future.

Depending on how the various targets optimize and combine shuffles in
practice, we might be able to get more-accurate costs by combining the
costs of multiple shuffle kinds. For example, the cost of flipping the
subvector pairs could be modeled as two extractions and two subvector
insertions. These changes, however, should probably be motivated
by specific test cases.

llvm-svn: 173621
2013-01-27 20:07:01 +00:00
Benjamin Kramer
1e8d008612 Legalizer: Add an assert and tweak a comment to clarify the assumptions this code makes.
llvm-svn: 173620
2013-01-27 15:04:43 +00:00
Bill Wendling
a298631a83 In the AttributeSetImpl c'tor, fill in the AttrNodes data structure with the attributes being passed in.
llvm-svn: 173618
2013-01-27 12:50:02 +00:00
Benjamin Kramer
a19aee8b53 When the legalizer is splitting vector shifts, the result may not have the right shift amount type.
Fix that by adding a cast to the shift expander. This came up with vector shifts
on sse-less X86 CPUs.

   <2 x i64>       = shl <2 x i64> <2 x i64>
-> i64,i64         = shl i64 i64; shl i64 i64
-> i32,i32,i32,i32 = shl_parts i32 i32 i64; shl_parts i32 i32 i64

Now we cast the last two i64s to the right type. Fixes the crash in PR14668.

llvm-svn: 173615
2013-01-27 11:19:11 +00:00
Bill Wendling
8e66ee6471 Fix miscompile. Add back the use of the ArrayRef version of the ::get method.
llvm-svn: 173613
2013-01-27 10:28:39 +00:00
Bill Wendling
920cb6d54f Remove dead methods.
llvm-svn: 173611
2013-01-27 09:55:44 +00:00
Chandler Carruth
ce01d44307 Re-revert r173342, without losing the compile time improvements, flat
out bug fixes, or functionality preserving refactorings.

llvm-svn: 173610
2013-01-27 06:42:03 +00:00
Michael Gottesman
307107e1ea Renamed function IsPotentialUse to IsPotentialRetainableObjPtr.
This name change does the following:

1. Causes the function name to use proper ARC terminology.
2. Makes it clear what the function truly does.

llvm-svn: 173609
2013-01-27 06:19:48 +00:00
Bill Wendling
44dbdbefec Use the AttributeSet instead of AttributeWithIndex.
In the future, AttributeWithIndex won't be used anymore. Besides, it exposes the
internals of the AttributeSet to outside users, which isn't goodness.

llvm-svn: 173603
2013-01-27 02:24:02 +00:00
Bill Wendling
e901c4cf0a Use the AttributeSet instead of AttributeWithIndex.
In the future, AttributeWithIndex won't be used anymore. Besides, it exposes the
internals of the AttributeSet to outside users, which isn't goodness.

llvm-svn: 173602
2013-01-27 02:08:22 +00:00
Bill Wendling
4e3857f416 Use the AttributeSet instead of AttributeWithIndex.
In the future, AttributeWithIndex won't be used anymore. Besides, it exposes the
internals of the AttributeSet to outside users, which isn't goodness.

llvm-svn: 173601
2013-01-27 01:57:28 +00:00
Bill Wendling
2fc9ade11d Use the AttributeSet instead of AttributeWithIndex.
In the future, AttributeWithIndex won't be used anymore. Besides, it exposes the
internals of the AttributeSet to outside users, which isn't goodness.

llvm-svn: 173600
2013-01-27 01:44:34 +00:00
Bill Wendling
3900a8b876 Convert the CPP backend to use the AttributeSet instead of AttributeWithIndex.
Further removal of the introspective AttributeWithIndex thing. Also fix the #includes.

llvm-svn: 173599
2013-01-27 01:22:51 +00:00
Bill Wendling
dcb8db2b6a Use the AttributeSet instead of AttributeWithIndex object.
llvm-svn: 173598
2013-01-27 00:36:48 +00:00
Hal Finkel
9882e8c083 BBVectorize: Add a additional comment about the cost computation
llvm-svn: 173580
2013-01-26 16:49:04 +00:00
Hal Finkel
2d9bc41033 BBVectorize: Fix anomalous capital letter in comment
llvm-svn: 173579
2013-01-26 16:49:03 +00:00
Benjamin Kramer
b7b4734d8b X86: Decode PALIGN operands so I don't have to do it in my head.
llvm-svn: 173572
2013-01-26 13:31:37 +00:00
Benjamin Kramer
f6126f19f4 X86: Do splat promotion later, so the optimizer can chew on it first.
This catches many cases where we can emit a more efficient shuffle for a
specific mask or when the mask contains undefs. Once the splat is lowered to
unpacks we can't do that anymore.

There is a possibility of moving the promotion after pshufb matching, but I'm
not sure if pshufb with a mask loaded from memory is faster than 3 shuffles, so
I avoided that for now.

llvm-svn: 173569
2013-01-26 11:44:21 +00:00
Reed Kotler
bcf0501249 fix use of std::std. it's ordered set.
llvm-svn: 173563
2013-01-26 06:58:35 +00:00
NAKAMURA Takumi
731f502bbd DWARFDebugLine.cpp: Fix true path. Did you forget "return true" here?
llvm-svn: 173552
2013-01-26 01:45:06 +00:00
Andrew Kaylor
2677c75e5d Add DIContext::getLineInfoForAddressRange() function and test. This function allows a caller to obtain a table of line information for a function using the function's address and size.
llvm-svn: 173537
2013-01-26 00:28:05 +00:00
Bill Wendling
d5b4c9438f Convert BuildLibCalls.cpp to using the AttributeSet methods instead of AttributeWithIndex.
llvm-svn: 173536
2013-01-26 00:03:11 +00:00
Dmitri Gribenko
6dac0bf1a2 Remove unused variables, silences -Wunused-variable
llvm-svn: 173526
2013-01-25 23:17:21 +00:00
Bill Wendling
46a6a632dc Remove dead method.
llvm-svn: 173524
2013-01-25 23:14:36 +00:00
Bill Wendling
47efd8b988 Remove some introspection functions.
The 'getSlot' function and its ilk allow introspection into the AttributeSet
class. However, that class should be opaque. Allow access through accessor
methods instead.

llvm-svn: 173522
2013-01-25 23:09:36 +00:00
Hal Finkel
ab240a9015 Initial implementation of PPCTargetTransformInfo
This provides a place to add customized operation cost information and
control some other target-specific IR-level transformations.

The only non-trivial logic in this checkin assigns a higher cost to
unaligned loads and stores (covered by the included test case).

llvm-svn: 173520
2013-01-25 23:05:59 +00:00
Nadav Rotem
78ccedd76a Fix a warning in the new DWARFheader. Add a new line at the end of the file.
llvm-svn: 173518
2013-01-25 22:57:05 +00:00
Andrew Kaylor
c9fa0590eb Add support for applying in-memory relocations to the .debug_line section and, in the case of ELF files, using symbol addresses when available for relocations to the .debug_info section. Also extending the llvm-rtdyld tool to add the ability to dump line number information for testing purposes.
llvm-svn: 173517
2013-01-25 22:50:58 +00:00
Eli Bendersky
391ff99738 In this patch, we teach X86_64TargetMachine that it has a ILP32
(defined by the x32 ABI) mode, in which case its pointers are 32-bits
in size. This knowledge is also added to X86RegisterInfo that now
returns the appropriate registers in getPointerRegClass.

There are many outcomes to this change. In order to keep the patches
separate and manageable, we start by focusing on some simple testable
cases. The patch adds a test with passing a pointer to a function -
focusing on the difference between the two data models for x86-64.
Another test is added for handling of 'sret' arguments (and
functionality is added in X86ISelLowering to make it work).

A note on naming: the "x32 ABI" document refers to the AMD64
architecture (in LLVM it's distinguished by being is64Bits() in the
x86 subtarget) with two variations: the LP64 (default) data model, and
the ILP32 data model. This patch adds predicates to the subtarget
which are consistent with this naming scheme.

llvm-svn: 173503
2013-01-25 22:07:43 +00:00
Richard Osborne
32d4ba5aeb Add instruction encodings / disassembly support for l4r instructions.
llvm-svn: 173501
2013-01-25 21:55:32 +00:00
Nadav Rotem
80f2c07dc3 LoopVectorize: Refactor the code that vectorizes loads/stores to remove duplication.
llvm-svn: 173500
2013-01-25 21:47:42 +00:00
Bill Wendling
c5e0fb9b77 Use the new 'getSlotIndex' method to retrieve the attribute's slot index.
llvm-svn: 173499
2013-01-25 21:46:52 +00:00
Jakub Staszak
4fa9ef00c4 Use const reference instead of vector copying.
llvm-svn: 173497
2013-01-25 21:44:27 +00:00
Bill Wendling
4e9de7c89b Add an accessor method to get the slot's index. This will limit the use of AttributeWithIndex.
llvm-svn: 173495
2013-01-25 21:30:53 +00:00
Richard Osborne
065cd10bb5 Use the correct format in the STW / SETPSC instruction names.
llvm-svn: 173494
2013-01-25 21:25:12 +00:00
Richard Osborne
e119783a82 Fix order of operands for crc8_l4r
The order in which operands appear in the encoded instruction is different
to order in which they appear in assembly. This changes the XCore backend to
use the instruction encoding order.

llvm-svn: 173493
2013-01-25 21:20:28 +00:00
Eli Bendersky
87e2fa1583 When encountering an unknown file format, ObjectFile::createObjectFile should
politely report it instead of running into llvm_unreachable.

Also patch llvm-dwarfdump to actually check whether the file it's attempting to
dump is a valid object file.

llvm-svn: 173489
2013-01-25 20:53:41 +00:00
Eli Bendersky
1b58747212 Add command-line flags for DWARF dumping.
Flags for dumping specific DWARF sections added in lib/DebugInfo and
llvm-dwarfdump.

llvm-svn: 173480
2013-01-25 20:26:43 +00:00
Richard Osborne
4269c34e3d Add instruction encodings / disassembly support for l5r instructions.
llvm-svn: 173479
2013-01-25 20:20:07 +00:00
Richard Osborne
73533fb821 Fix order of operands for l5r instructions.
With this change the operands order matches the order in which the operands
are encoded in the instruction.

llvm-svn: 173477
2013-01-25 20:16:00 +00:00
Richard Osborne
bc9a485488 Use correct mnemonic / instruction name for ldivu.
llvm-svn: 173476
2013-01-25 20:11:26 +00:00
Benjamin Kramer
3f37f1a557 LoopVectorize: Simplify code. No functionality change.
llvm-svn: 173475
2013-01-25 19:43:15 +00:00
Pedro Artigas
b745dc373a added ability to dynamically change the ExportList of an already
created InternalizePass (useful for pass reuse)

llvm-svn: 173474
2013-01-25 19:41:03 +00:00
Nadav Rotem
1d462abb9a LoopVectorizer: Refactor more code to use the IRBuilder.
llvm-svn: 173471
2013-01-25 19:26:23 +00:00
Nadav Rotem
df96d1dffb Refactor some code to use the IRBuilder.
llvm-svn: 173467
2013-01-25 18:34:09 +00:00
Benjamin Kramer
429ac6dc9a APFloat: Make sure that we get a well-formed x87 NaN when converting from a smaller type.
Fixes PR15054.

llvm-svn: 173459
2013-01-25 17:01:00 +00:00
Reid Kleckner
3ad597372e Fix MSVC 2012 warning about a 32-bit shift that should be 64-bit
llvm-svn: 173454
2013-01-25 15:35:56 +00:00
Evgeniy Stepanov
cf78433efb [msan] A comment on ICmp handling logic.
llvm-svn: 173453
2013-01-25 15:35:29 +00:00
Evgeniy Stepanov
2c975362ac [msan] Implement exact shadow propagation for relational ICmp.
Only for integers, pointers, and vectors of those. No floats.
Instrumentation seems very heavy, and may need to be replaced
with some approximation in the future.

llvm-svn: 173452
2013-01-25 15:31:10 +00:00
Preston Gurd
0c7e9fd1dd This patch aims to reduce compile time in LegalizeTypes by using SmallDenseMap,
with an initial number of elements,  instead of DenseMap, which has
zero initial elements, in order to avoid the copying of elements
when the size changes and to avoid allocating space every time
LegalizeTypes is run. This patch will not affect the memory footprint,
because DenseMap will increase the element size to 64
when the first element is added.

Patch by Wan Xiaofei.

llvm-svn: 173448
2013-01-25 15:18:54 +00:00
Hal Finkel
29d9da9d49 More cleanup of PPC register definitions.
Uses the new !add TableGen operator to do more cleanup of the
PPC register definitions.

llvm-svn: 173446
2013-01-25 14:49:10 +00:00
Hal Finkel
4279c8573b Add an addition operator to TableGen
This adds an !add(a, b) operator to tablegen; this will be used
to cleanup the PPC register definitions.

llvm-svn: 173445
2013-01-25 14:49:08 +00:00
Silviu Baranga
e74bc9b8dc Fixed the condition codes for the atomic64 min/umin code generation on ARM. If the sutraction of the higher 32 bit parts gives a 0 result, we need to do the store operation.
llvm-svn: 173437
2013-01-25 10:39:49 +00:00
Bill Wendling
b6edc80cfc Use the AttributeSet query instead of the Attribute query.
llvm-svn: 173434
2013-01-25 08:08:54 +00:00
Andrew Trick
f0375135ec MIsched: Print block name. No functionality.
llvm-svn: 173433
2013-01-25 07:45:31 +00:00
Andrew Trick
efbba4d345 MachineScheduler support for viewGraph.
llvm-svn: 173432
2013-01-25 07:45:29 +00:00
Andrew Trick
8da14ff342 ScheduleDAG: colorize the DOT graph and improve formatting.
llvm-svn: 173431
2013-01-25 07:45:25 +00:00
Andrew Trick
1e8e17b0f3 ScheduleDAG: Added isBoundaryNode to conveniently detect a common corner case.
This fixes DAG subtree analysis at the boundary.

llvm-svn: 173427
2013-01-25 06:52:30 +00:00
Andrew Trick
85e176ca5c SchedDFS: Complete support for nested subtrees.
Maintain separate per-node and per-tree book-keeping.
Track all instructions above a DAG node including nested subtrees.
Seperately track instructions within a subtree.
Record subtree parents.

llvm-svn: 173426
2013-01-25 06:52:27 +00:00
Andrew Trick
d1ee804aa3 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.

llvm-svn: 173425
2013-01-25 06:33:57 +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
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
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
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
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
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
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
Benjamin Kramer
90ac6c1a88 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.

llvm-svn: 173279
2013-01-23 17:52:29 +00:00
Benjamin Kramer
cb0126b7dc 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.

llvm-svn: 173276
2013-01-23 17:16:22 +00:00
Eli Bendersky
57102d235e Fix powerpc test failure - forgot to initialize stack slot size for PPCLinuxMCAsmInfo
llvm-svn: 173275
2013-01-23 17:12:15 +00:00
Eli Bendersky
9e87cb51e6 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.
llvm-svn: 173270
2013-01-23 16:22:04 +00:00
Benjamin Kramer
7cbfce9f41 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.

llvm-svn: 173267
2013-01-23 15:21:44 +00:00
Anton Korobeynikov
753fed104a Make sure metarenamer won't rename special stuff (intrinsics and explicitly renamed stuff).
Otherwise this might hide the problems.

llvm-svn: 173265
2013-01-23 15:03:08 +00:00
Kostya Serebryany
c1d5734eb0 [asan] use ADD instead of OR when applying shadow offset of PowerPC. See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55975 for details
llvm-svn: 173258
2013-01-23 12:54:55 +00:00
Duncan Sands
4c9216412c 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.

llvm-svn: 173242
2013-01-23 09:09:50 +00:00
Bill Wendling
fd64018774 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.)

llvm-svn: 173231
2013-01-23 06:43:53 +00:00
Bill Wendling
9e0064d80b 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.

llvm-svn: 173230
2013-01-23 06:41:41 +00:00
Bill Wendling
c31f99d129 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.

llvm-svn: 173228
2013-01-23 06:14:59 +00:00
Tom Stellard
f62a46f5e9 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>
llvm-svn: 173222
2013-01-23 02:09:06 +00:00
Tom Stellard
48aa269492 R600: Add a CONST_ADDRESS node to model constant buf read
Patch by: Vincent Lejeune

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 173221
2013-01-23 02:09:03 +00:00
Tom Stellard
8899509f04 R600: Factorise VTX_WORD0 and VTX_WORD1 in tblgen def
Patch by: Vincent Lejeune

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 173220
2013-01-23 02:09:01 +00:00
Nadav Rotem
52f5279653 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);

llvm-svn: 173219
2013-01-23 01:35:00 +00:00
Bill Wendling
e11164c08d Use the AttributeSet when removing multiple attributes. Use Attribute::AttrKind
when removing one attribute. This further encapsulates the use of the attributes.

llvm-svn: 173214
2013-01-23 00:45:55 +00:00
Bill Wendling
627f56935c Use the AttributeSet when adding multiple attributes and an Attribute::AttrKind
when adding a single attribute to the function.

llvm-svn: 173210
2013-01-23 00:20:53 +00:00
Richard Osborne
6453bd631a Add instruction encodings / disassembly support for u10 / lu10 instructions.
llvm-svn: 173204
2013-01-22 22:55:04 +00:00
Michael Gottesman
1b1c476a4c Fixed typo.
llvm-svn: 173202
2013-01-22 21:53:43 +00:00
Michael Gottesman
8eb9360a37 [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).

llvm-svn: 173201
2013-01-22 21:49:00 +00:00
Michael Liao
f1ce1e547c 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>

llvm-svn: 173200
2013-01-22 21:47:38 +00:00
Kevin Enderby
042547700a 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

llvm-svn: 173199
2013-01-22 21:44:53 +00:00
Akira Hatanaka
80ebf0332e [mips] Implement MipsRegisterInfo::getRegPressureLimit.
llvm-svn: 173197
2013-01-22 21:34:25 +00:00
Bill Wendling
82711f5390 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.

llvm-svn: 173196
2013-01-22 21:15:51 +00:00
Kevin Enderby
8bfddfebbb 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

llvm-svn: 173195
2013-01-22 21:09:20 +00:00
Akira Hatanaka
390115c18e [mips] Clean up code in MipsTargetLowering::LowerCall. No functional change
intended

llvm-svn: 173189
2013-01-22 20:05:56 +00:00
Benjamin Kramer
f2fc27452c X86: Make sure we account for the FMA4 register immediate value, otherwise rip-rel relocations will be off by one byte.
PR15040.

llvm-svn: 173176
2013-01-22 18:05:59 +00:00
Eli Bendersky
36076df691 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.

llvm-svn: 173175
2013-01-22 18:02:49 +00:00
Evgeniy Stepanov
576e5906c5 [msan] Export the value of msan-keep-going flag for the runtime.
llvm-svn: 173156
2013-01-22 13:26:53 +00:00
Evgeniy Stepanov
b64d00f355 [msan] Do not insert check on volatile store.
Volatile bitfields can cause valid stores of uninitialized bits.

llvm-svn: 173153
2013-01-22 12:30:52 +00:00
Chandler Carruth
e7f6a7e82e Begin fleshing out an interface in TTI for modelling the costs of
generic function calls and intrinsics. This is somewhat overlapping with
an existing intrinsic cost method, but that one seems targetted at
vector intrinsics. I'll merge them or separate their names and use cases
in a separate commit.

This sinks the test of 'callIsSmall' down into TTI where targets can
control it. The whole thing feels very hack-ish to me though. I've left
a FIXME comment about the fundamental design problem this presents. It
isn't yet clear to me what the users of this function *really* care
about. I'll have to do more analysis to figure that out. Putting this
here at least provides it access to proper analysis pass tools and other
such. It also allows us to more cleanly implement the baseline cost
interfaces in TTI.

With this commit, it is now theoretically possible to simplify much of
the inline cost analysis's handling of calls by calling through to this
interface. That conversion will have to happen in subsequent commits as
it requires more extensive restructuring of the inline cost analysis.

The CodeMetrics class is now really only in the business of running over
a block of code and aggregating the metrics on that block of code, with
the actual cost evaluation done entirely in terms of TTI.

llvm-svn: 173148
2013-01-22 11:26:02 +00:00
Tim Northover
52ba1e77cb Make APFloat constructor require explicit semantics.
Previously we tried to infer it from the bit width size, with an added
IsIEEE argument for the PPC/IEEE 128-bit case, which had a default
value. This default value allowed bugs to creep in, where it was
inappropriate.

llvm-svn: 173138
2013-01-22 09:46:31 +00:00
Daniel Dunbar
26348eb62c [MC/Mach-O] Load commands are supposed to 8-byte aligned on 64-bit.
llvm-svn: 173120
2013-01-22 03:42:49 +00:00
Bill Wendling
695b24a4e3 Add a new method that adds the AttributeSet at the given index. No functional change.
llvm-svn: 173109
2013-01-22 00:53:12 +00:00
Bill Wendling
b5cdca5e71 Add the attributes that are passed in instead of the ones we're merging into.
llvm-svn: 173108
2013-01-22 00:41:33 +00:00
Bill Wendling
300c7f03d7 Use AttributeSet instead of Attribute to verify things.
llvm-svn: 173101
2013-01-21 23:03:18 +00:00
Bill Wendling
f8c0d4f9cd Have AttributeSet::getRetAttributes() return an AttributeSet instead of Attribute.
This further restricts the use of the Attribute class to the Attribute family of
classes.

llvm-svn: 173098
2013-01-21 22:44:49 +00:00
Bill Wendling
991cef6573 Make AttributeSet::getFnAttributes() return an AttributeSet instead of an Attribute.
This is more code to isolate the use of the Attribute class to that of just
holding one attribute instead of a collection of attributes.

llvm-svn: 173094
2013-01-21 21:57:28 +00:00
Paul Redmond
3d611dcda9 Transform (sub 0, (zext bool to A)) to (sext bool to A) and
(sub 0, (sext bool to A)) to (zext bool to A).

Patch by Muhammad Ahmad
Reviewed by Duncan Sands

llvm-svn: 173093
2013-01-21 21:57:20 +00:00
Richard Osborne
9599bb34e9 Fix some incorrectly named u10 / lu10 instructions.
llvm-svn: 173090
2013-01-21 21:12:30 +00:00
Richard Osborne
fe2c8cca9d Remove unused multiclass.
llvm-svn: 173087
2013-01-21 20:50:54 +00:00