Commit Graph

13670 Commits

Author SHA1 Message Date
Benjamin Kramer
d9b0b02561 Fix typos found by http://github.com/lyda/misspell-check
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157885 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-02 10:20:22 +00:00
Stepan Dyatkovskiy
43eb31bfae PR1255: case ranges.
IntRange converted from struct to class. So main change everywhere is replacement of ".Low/High" with ".getLow/getHigh()"



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157884 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-02 09:42:43 +00:00
Stepan Dyatkovskiy
4319a552ac PR1255: case ranges.
IntegersSubsetGeneric, IntegersSubsetMapping: added IntTy template parameter, that allows use either APInt or IntItem. This change allows to write unittest for these classes.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157880 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-02 07:26:00 +00:00
Akira Hatanaka
55a105160d Fix a bug in the code which custom-lowers truncating stores in LegalizeDAG.
Check that the SDValue TargetLowering::LowerOperation returns is not null
before replacing the original node with the returned node.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157873 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-02 01:10:34 +00:00
Jakob Stoklund Olesen
396618b43a Switch all register list clients to the new MC*Iterator interface.
No functional change intended.

Sorry for the churn. The iterator classes are supposed to help avoid
giant commits like this one in the future. The TableGen-produced
register lists are getting quite large, and it may be necessary to
change the table representation.

This makes it possible to do so without changing all clients (again).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157854 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-01 23:28:30 +00:00
Jakob Stoklund Olesen
0984461dfb Remove physreg support from adjustCopiesBackFrom and removeCopyByCommutingDef.
After physreg coalescing was disabled, these functions can't do anything
useful with physregs anyway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157849 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-01 22:38:19 +00:00
Jakob Stoklund Olesen
8c70ea47fa Simplify some more getAliasSet callers.
MCRegAliasIterator can include Reg itself in the list.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157848 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-01 22:38:17 +00:00
Jakob Stoklund Olesen
f152fe8d48 Switch some getAliasSet clients to MCRegAliasIterator.
MCRegAliasIterator can optionally visit the register itself, allowing
for simpler code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157837 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-01 20:36:54 +00:00
Manman Ren
68f25571e7 ARM: properly handle alignment for struct byval.
Factor out the expansion code into a function.
This change is to be enabled in clang.

rdar://9877866


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157830 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-01 19:33:18 +00:00
Stepan Dyatkovskiy
6bb5c0074d PR1255: case ranges.
IntegersSubset devided into IntegersSubsetGeneric and into IntegersSubset itself. The first has no references to ConstantInt and works with IntItem only.
IntegersSubsetMapping also made generic. Here added second template parameter "IntegersSubsetTy" that allows to use on of two IntegersSubset types described below.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157815 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-01 16:17:57 +00:00
Chris Lattner
74ee0ef6a7 quick fix for PR13006, will check in testcase later.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157813 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-01 15:02:52 +00:00
Chris Lattner
f59e4e3452 enhance the logic for looking through tailcalls to look through transparent casts
in multiple-return value scenarios, like what happens on X86-64 when returning
small structs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157800 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-01 05:29:15 +00:00
Chris Lattner
5b0d946537 enhance getNoopInput to know about vector<->vector bitcasts of legal
types, as well as int<->ptr casts.  This allows us to tailcall functions
with some trivial casts between the call and return (i.e. because the
return types disagree).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157798 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-01 05:16:33 +00:00
Chris Lattner
cd6015cc8a rearrange some logic, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157796 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-01 05:01:15 +00:00
Eric Christopher
fc4199bf4a Add support for enum forward declarations.
Part of rdar://11570854

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157786 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-01 00:22:32 +00:00
Manman Ren
91c5346d91 X86: replace SUB with CMP if possible
This patch will optimize the following
        movq    %rdi, %rax
        subq    %rsi, %rax
        cmovsq  %rsi, %rdi
        movq    %rdi, %rax
to
        cmpq    %rsi, %rdi
        cmovsq  %rsi, %rdi
        movq    %rdi, %rax

Perform this optimization if the actual result of SUB is not used.

rdar: 11540023


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157755 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-31 17:20:29 +00:00
Jakob Stoklund Olesen
9cda1be0aa Prioritize smaller register classes for urgent evictions.
It helps compile exotic inline asm. In the test case, normal GR32
virtual registers use up eax-edx so the final GR32_ABCD live range has
no registers left. Since all the live ranges were tiny, we had no way of
prioritizing the smaller register class.

This patch allows tiny unspillable live ranges to be evicted by tiny
unspillable live ranges from a smaller register class.

<rdar://problem/11542429>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157715 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-30 21:46:58 +00:00
Owen Anderson
f917d20561 Switch the canonical FMA term operand order to match both the comment I wrote and the usual LLVM convention.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157708 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-30 18:54:50 +00:00
Owen Anderson
85ef6f4c99 Teach DAGCombine to canonicalize the position of a constant in the term operands of an FMA node.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157707 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-30 18:50:39 +00:00
Chad Rosier
06a23ea808 Remove extra space.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157706 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-30 18:47:55 +00:00
Jakob Stoklund Olesen
275fd2523e Remove some redundant tests.
An empty list is not represented as a null pointer. Let TRI do its own
shortcuts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157702 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-30 18:38:56 +00:00
Evan Cheng
eb25bd2356 Teach taildup to update livein set. rdar://11538365
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157663 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-30 00:42:39 +00:00
Evan Cheng
3d4166dff0 If-converter models predicated defs as read + write. The read should be marked as 'undef' since it may not already be live. This appeases -verify-machineinstrs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157662 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-30 00:42:02 +00:00
Bob Wilson
6e1b812850 Add an insertPass API to TargetPassConfig. <rdar://problem/11498613>
Besides adding the new insertPass function, this patch uses it to
enhance the existing -print-machineinstrs so that the MachineInstrs
after a specific pass can be printed.

Patch by Bin Zeng!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157655 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-30 00:17:12 +00:00
Evan Cheng
cac58aa80e Optional def can be either a def or a use (of reg0).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157640 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-29 19:40:44 +00:00
Lang Hames
f905f69668 Clear the entering, exiting and internal ranges of a bundle before collecting
ranges for the instruction about to be bundled. This fixes a bug in an external
project where an assertion was triggered due to spurious 'multiple defs' within
the bundle.

Patch by Ivan Llopard. Thanks Ivan!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157632 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-29 18:19:54 +00:00
Stepan Dyatkovskiy
0aa32d5d0f ConstantRangesSet renamed to IntegersSubset. CRSBuilder renamed to IntegersSubsetMapping.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157612 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-29 12:26:47 +00:00
Peter Collingbourne
b34d3aa35b Add llvm.fabs intrinsic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157594 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-28 21:48:37 +00:00
Stepan Dyatkovskiy
484fc93eff PR1255: Case Ranges
Implemented IntItem - the wrapper around APInt. Why not to use APInt item directly right now?
1. It will very difficult to implement case ranges as series of small patches. We got several large and heavy patches. Each patch will about 90-120 kb. If you replace ConstantInt with APInt in SwitchInst you will need to changes at the same time all Readers,Writers and absolutely all passes that uses SwitchInst.
2. We can implement APInt pool inside and save memory space. E.g. we use several switches that works with 256 bit items (switch on signatures, or strings). We can avoid value duplicates in this case.
3. IntItem can be easyly easily replaced with APInt.
4. Currenly we can interpret IntItem both as ConstantInt and as APInt. It allows to provide SwitchInst methods that works with ConstantInt for non-updated passes.

Why I need it right now? Currently I need to update SimplifyCFG pass (EqualityComparisons). I need to work with APInts directly a lot, so peaces of code
ConstantInt *V = ...;
if (V->getValue().ugt(AnotherV->getValue()) {
  ...
}
will look awful. Much more better this way:
IntItem V = ConstantIntVal->getValue();
if (AnotherV < V) {
}

Of course any reviews are welcome.

P.S.: I'm also going to rename ConstantRangesSet to IntegersSubset, and CRSBuilder to IntegersSubsetMapping (allows to map individual subsets of integers to the BasicBlocks).
Since in future these classes will founded on APInt, it will possible to use them in more generic ways.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157576 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-28 12:39:09 +00:00
Peter Collingbourne
27302f0739 Have getOrCreateSubprogramDIE store the DIE for a subprogram
definition in the map before calling itself to retrieve the
DIE for the declaration.  Without this change, if this causes
getOrCreateSubprogramDIE to be recursively called on the definition,
it will create multiple DIEs for that definition.  Fixes PR12831.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157541 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-27 18:36:44 +00:00
Benjamin Kramer
cf1d69df7e Missed parens.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157527 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-27 10:56:55 +00:00
Benjamin Kramer
4fae58b32d r157525 didn't work, just disable iterator checking.
This is obviosly right but I don't see how to do this with proper vector
iterators without building a horrible mess of workarounds.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157526 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-27 10:24:52 +00:00
Benjamin Kramer
dc54f8ebe2 SDAGBuilder: Avoid iterator invalidation harder.
vector.begin()-1 is invalid too.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157525 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-27 09:44:52 +00:00
Benjamin Kramer
5db954dab9 SDAGBuilder: Don't create an invalid iterator when there is only one switch case.
Found by libstdc++'s debug mode.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157522 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-26 21:19:12 +00:00
Benjamin Kramer
c511b2a5a1 SelectionDAGBuilder: When emitting small compare chains for switches order them by using edge weights.
SimplifyCFG tends to form a lot of 2-3 case switches when merging branches. Move
the most likely condition to the front so it is checked first and the others can
be skipped. This is currently not as effective as it could be because SimplifyCFG
destroys profiling metadata when merging branches and switches. Merging branch
weight metadata is tricky though.

This code touches at most 3 cases so I didn't use a proper sorting algorithm.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157521 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-26 20:01:32 +00:00
Benjamin Kramer
9632f77f8d ScoreboardHazardRecognizer: Remove dead conditional in debug code.
Negative cycles are filtered out earlier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157514 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-26 11:37:37 +00:00
Justin Holewinski
d2ea0e10cb Change interface for TargetLowering::LowerCallTo and TargetLowering::LowerCall
to pass around a struct instead of a large set of individual values.  This
cleans up the interface and allows more information to be added to the struct
for future targets without requiring changes to each and every target.

NV_CONTRIB

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157479 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-25 16:35:28 +00:00
Andrew Trick
c7a098fbb2 misched: trace formatting
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157455 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-25 02:02:39 +00:00
Eli Friedman
2db0e9ebb6 Simplify code for calling a function where CanLowerReturn fails, fixing a small bug in the process.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157446 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-25 00:09:29 +00:00
Kaelyn Uhrain
5402efa3dc Silence unused variable warnings from when assertions are disabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157438 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-24 23:37:49 +00:00
Andrew Trick
8ddd9d5b2b misched: Use the same scheduling heuristics with -misched-topdown/bottomup.
(except the part about choosing direction)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157437 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-24 23:11:17 +00:00
Andrew Trick
bb0a242d86 misched: Trace regpressure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157429 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-24 22:11:14 +00:00
Andrew Trick
f323424d71 misched: Give each ReadyQ a unique ID
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157428 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-24 22:11:12 +00:00
Andrew Trick
0a39d4e4c8 misched: Added ScoreboardHazardRecognizer.
The Hazard checker implements in-order contraints, or interlocked
resources. Ready instructions with hazards do not enter the available
queue and are not visible to other heuristics.

The major code change is the addition of SchedBoundary to encapsulate
the state at the top or bottom of the schedule, including both a
pending and available queue.

The scheduler now counts cycles in sync with the hazard checker. These
are minimum cycle counts based on known hazards.

Targets with no itinerary (x86_64) currently remain at cycle 0. To fix
this, we need to provide some maximum issue width for all targets. We
also need to add the concept of expected latency vs. minimum latency.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157427 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-24 22:11:09 +00:00
Andrew Trick
2aa689dfbf misched: Release bottom roots in reverse order.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157426 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-24 22:11:05 +00:00
Andrew Trick
8c2d9212a9 misched: rename ReadyQ class
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157425 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-24 22:11:03 +00:00
Andrew Trick
c8fe4ecb47 misched: copy comments so compareRPDelta is readable by itself.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157424 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-24 22:11:01 +00:00
Andrew Trick
5f887fab35 regpressure: Added RegisterPressure::dump
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157423 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-24 22:10:59 +00:00
Andrew Trick
a7de4b99e4 regpressure: physreg livein/out fix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157422 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-24 22:10:57 +00:00
Craig Topper
e329810482 Mark some static arrays as const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157377 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-24 06:35:32 +00:00