Commit Graph

11200 Commits

Author SHA1 Message Date
Lang Hames
5e77f4b1d2 Fix some style issues in PBQP. Patch by David Blaikie.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118883 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-12 05:47:21 +00:00
Dan Gohman
fca0b106f7 Add a FIXME comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118803 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-11 18:08:43 +00:00
Andrew Trick
8a83d54528 Check TRI->getReservedRegs because other allocators do it. Even though
it makes no sense for allocation_order iterators to visit reserved regs.
The inline spiller depends on AliasAnalysis.
Manage the Query state to avoid uninitialized or stale results.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118800 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-11 17:46:29 +00:00
Dan Gohman
efb8a9d0c2 Remove the memmove->memcpy optimization from CodeGen. MemCpyOpt does this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118789 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-11 16:24:49 +00:00
Jakob Stoklund Olesen
a05f60b241 Delete SplittingSpiller. It was not being used by anyone, and it is being
superceded by SplitKit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118754 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-11 00:52:44 +00:00
Jakob Stoklund Olesen
1e8e72d72a Insert two blank SlotIndexes between basic blocks instead of just one.
This is the first small step towards using closed intervals for liveness instead
of the half-open intervals we're using now.

We want to be able to distinguish between a SlotIndex that represents a variable
being live-out of a basic block, and an index representing a variable live-in to
its successor.

That requires two separate indexes between blocks. One for live-outs and one for
live-ins.

With this change, getMBBEndIdx(MBB).getPrevSlot() becomes stable so it stays
greater than any instructions inserted at the end of MBB.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118747 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-11 00:19:20 +00:00
Jakob Stoklund Olesen
b5f327b30f No need to add liveness that's already there.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118742 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-10 23:56:00 +00:00
Jakob Stoklund Olesen
e93198af07 Hook up AliasAnalysis in InlineSpiller. This is used for rematerializing
constant loads.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118741 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-10 23:55:56 +00:00
Devang Patel
62367045a4 Take care of special characters while creating named MDNode name to hold function specific local variable's info.
This fixes radar 8653152. I am checking in testcase as a separate check-in.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118726 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-10 22:19:21 +00:00
Jakob Stoklund Olesen
cfa7134a9c Basic rematerialization during splitting.
Whenever splitting wants to insert a copy, it checks if the value can be
rematerialized cheaply instead.

Missing features:
- Delete instructions when all uses have been rematerialized.
- Truncate live ranges to the remaining uses after rematerialization.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118702 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-10 19:31:50 +00:00
Andrew Trick
f4baeaf848 RABasic is nearly functionally complete. There are a few remaining
benchmarks hitting an assertion.
Adds LiveIntervalUnion::collectInterferingVRegs.
Fixes "late spilling" by checking for any unspillable live vregs among
all physReg aliases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118701 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-10 19:18:47 +00:00
Jakob Stoklund Olesen
b80e973c95 Simplify the LiveRangeEdit::canRematerializeAt() interface a bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118661 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-10 01:05:12 +00:00
Rafael Espindola
34be396a12 Fixed version of 118639 with an extra assert to catch similar problems
earlier. Implicit bool -> int conversions are evil!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118651 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-09 23:42:07 +00:00
Andrew Trick
071d1c063f Adds RABasic verification and tracing.
(retry now that the windows build is green)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118630 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-09 21:04:34 +00:00
Matt Beaumont-Gay
e33daaaaf9 Add a trivial virtual dtor to AbstractRegisterDescription to appease
-Wnon-virtual-dtor.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118616 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-09 19:56:25 +00:00
Andrew Trick
32d9aeb1df Reverting r118604. Windows build broke.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118613 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-09 19:47:51 +00:00
Andrew Trick
39a5ce46a5 Adds RABasic verification and tracing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118604 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-09 19:01:17 +00:00
Dan Gohman
6a559cd695 Fix DAGCombiner to avoid folding a sext-in-reg or similar through a shl
in order to fold it into a load.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118471 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-09 01:54:35 +00:00
Dale Johannesen
71365d3774 Fix an inline asm pasto from 117667; was preventing
{i64, i64} from matching i128.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118465 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-09 01:15:07 +00:00
Andrew Trick
e141a4960f Adds support for spilling previously allocated live intervals to
handle cases in which a register is unavailable for spill code.
Adds LiveIntervalUnion::extract. While processing interferences on a
live virtual register, reuses the same Query object for each
physcial reg.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118423 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-08 18:02:08 +00:00
Che-Liang Chiou
6da24ca51d Add registry hook for assembly text output
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118394 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-08 02:21:17 +00:00
Benjamin Kramer
f788854d20 Prune includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118342 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-06 11:45:59 +00:00
Duncan Sands
69300a2f47 When passing a parameter using the 'byval' mechanism, inline code needs to be used
to perform the copy, which may be of lots of memory [*].  It would be good if the
fall-back code generated something reasonable, i.e. did the copy in a loop, rather
than vast numbers of loads and stores.  Add a note about this.  Currently target
specific code seems to always kick in so this is more of a theoretical issue rather
than a practical one now that X86 has been fixed.
[*] It's amazing how often people pass mega-byte long arrays by copy...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118275 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-05 15:20:29 +00:00
Rafael Espindola
7387345016 Add 118023 back, but with proper spelling for .uleb128/.sleb128.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118254 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-04 18:17:08 +00:00
Rafael Espindola
537ebeaffc Revert previous patch. Some targets don't support uleb and say
they do :-(

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118250 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-04 17:04:24 +00:00
Rafael Espindola
40f6514ff0 MCize.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118249 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-04 16:32:18 +00:00
Duncan Sands
1e96bab329 In the calling convention logic, ValVT is always a legal type,
and as such can be represented by an MVT - the more complicated
EVT is not needed.  Use MVT for ValVT everywhere.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118245 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-04 10:49:57 +00:00
Jakob Stoklund Olesen
8c42f48d02 Disable fancy splitting during spilling unless -extra-spiller-splits is given.
This way, InlineSpiller does the same amount of splitting as the standard
spiller. Splitting should really be guided by the register allocator, and
doesn't belong in the spiller at all.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118216 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-04 00:32:32 +00:00
Eric Christopher
d81f17acb4 Just return undef for invalid masks or elts, and since we're doing that,
just do it earlier too.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118195 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-03 20:44:42 +00:00
Jakob Stoklund Olesen
964bc25e5a Let RegAllocBasic require MachineDominators - they are already available and
splitting needs them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118194 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-03 20:39:26 +00:00
Jakob Stoklund Olesen
376dcbd6c2 Tag debug output as regalloc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118193 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-03 20:39:23 +00:00
Duncan Sands
cdfad36b40 Simplify uses of MVT and EVT. An MVT can be compared directly
with a SimpleValueType, while an EVT supports equality and
inequality comparisons with SimpleValueType.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118169 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-03 12:17:33 +00:00
Duncan Sands
1440e8b918 Inside the calling convention logic LocVT is always a simple
value type, so there is no point in passing it around using
an EVT.  Use the simpler MVT everywhere.  Rather than trying
to propagate this information maximally in all the code that
using the calling convention stuff, I chose to do a mainly
low impact change instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118167 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-03 11:35:31 +00:00
Eric Christopher
caebdd44f3 If we have an undef mask our Elt will be -1 for our access, handle
this by using an undef as a pointer.

Fixes rdar://8625016


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118164 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-03 09:36:40 +00:00
Dan Gohman
394d6298bc Fix DAGCombiner to avoid going into an infinite loop when it
encounters (and:i64 (shl:i64 (load:i64), 1), 0xffffffff).
This fixes rdar://8606584.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118143 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-03 01:47:46 +00:00
Evan Cheng
8239daf7c8 Two sets of changes. Sorry they are intermingled.
1. Fix pre-ra scheduler so it doesn't try to push instructions above calls to
   "optimize for latency". Call instructions don't have the right latency and
   this is more likely to use introduce spills.
2. Fix if-converter cost function. For ARM, it should use instruction latencies,
   not # of micro-ops since multi-latency instructions is completely executed
   even when the predicate is false. Also, some instruction will be "slower"
   when they are predicated due to the register def becoming implicit input.
   rdar://8598427


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118135 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-03 00:45:17 +00:00
Andrew Trick
4638852696 Fixes <rdar://problem/8612856>: During postRAsched, the antidependence
breaker needs to check all definitions of the antidepenent register to
avoid multiple defs of the same new register.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118032 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-02 18:16:45 +00:00
Devang Patel
c8821046f8 Simplify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118027 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-02 17:37:00 +00:00
Devang Patel
8bc9ef77b7 If value map does not have register for an argument then try to find frame index before giving up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118022 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-02 17:19:03 +00:00
Devang Patel
a90b305af9 Use frameindex, if available, as a last resort to emit debug info for a parameter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118020 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-02 17:01:30 +00:00
Jakob Stoklund Olesen
371e82bf51 Don't try to split weird critical edges that really aren't:
BB#1: derived from LLVM BB %bb.nph28
    Live Ins: %AL
    Predecessors according to CFG: BB#0
	TEST8rr %reg16384<kill>, %reg16384, %EFLAGS<imp-def>; GR8:%reg16384
	JNE_4 <BB#2>, %EFLAGS<imp-use,kill>
	JMP_4 <BB#2>
    Successors according to CFG: BB#2 BB#2

These double CFG edges only ever occur in bugpoint-generated code, so there is
no need to attempt something clever.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117992 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-02 00:58:37 +00:00
Jakob Stoklund Olesen
8bcf7603f7 MachineLICM should not claim to be preserving the CFG when it can split critical
edges on demand.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117982 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-01 23:59:55 +00:00
Jakob Stoklund Olesen
962c71089d Be more precise about verifying missing kill flags.
It is legal for an instruction to have two operands using the same register,
only one a kill. This is interpreted as a kill.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117981 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-01 23:59:53 +00:00
Jakob Stoklund Olesen
3d4114c464 When inserting copies during splitting, always use the parent register as the
source, and let rewrite() clean it up.

This way, kill flags on the inserted copies are fixed as well during rewrite().

We can't just assume that all the copies we insert are going to be kills since
critical edges into loop headers sometimes require both source and dest to be
live out of a block.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117980 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-01 23:59:48 +00:00
Jakob Stoklund Olesen
1c163d2a06 Add kill flag verification.
At least X86FloatingPoint requires correct kill flags after register allocation,
and targets using register scavenging benefit. Conservative kill flags are not
enough.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117960 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-01 21:51:31 +00:00
Jakob Stoklund Olesen
79cb53ce95 Update kill flags while rewriting instructions after splitting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117959 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-01 21:51:29 +00:00
Bill Wendling
40a5eb18b0 When we look at instructions to convert to setting the 's' flag, we need to look
at more than those which define CPSR. You can have this situation:

(1)  subs  ...
(2)  sub   r6, r5, r4
(3)  movge ...
(4)  cmp   r6, 0
(5)  movge ...

We cannot convert (2) to "subs" because (3) is using the CPSR set by
(1). There's an analogous situation here:

(1)  sub   r1, r2, r3
(2)  sub   r4, r5, r6
(3)  cmp   r4, ...
(5)  movge ...
(6)  cmp   r1, ...
(7)  movge ...

We cannot convert (1) to "subs" because of the intervening use of CPSR.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117950 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-01 20:41:43 +00:00
Jakob Stoklund Olesen
a37d5cf342 Don't assign new registers created during a split to the same stack slot, but
give them individual stack slots once the are actually spilled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117945 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-01 19:49:57 +00:00
Jakob Stoklund Olesen
e8f0823a68 Add basic LiveStacks verification.
When an instruction refers to a spill slot with a LiveStacks entry, check that
the spill slot is live at the instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117944 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-01 19:49:52 +00:00
Bill Wendling
9e7cb3d243 The testcase is now XFAILed. Sorry about the breakage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117904 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-01 05:50:55 +00:00
Eric Christopher
b698a56dd4 Revert r117876 for now, it's causing more testsuite failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117879 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-31 22:42:55 +00:00
Bill Wendling
b3747706fc Disable the peephole optimizer until 186.crafty on armv6 is fixed. This is what
looks like is happening:

Without the peephole optimizer:
  (1)   sub     r6, r6, #32
        orr     r12, r12, lr, lsl r9
        orr     r2, r2, r3, lsl r10
  (x)   cmp     r6, #0
        ldr     r9, LCPI2_10
        ldr     r10, LCPI2_11
  (2)   sub     r8, r8, #32
  (a)   movge   r12, lr, lsr r6
  (y)   cmp     r8, #0
LPC2_10:
        ldr     lr, [pc, r10]
  (b)   movge   r2, r3, lsr r8

With the peephole optimizer:
        ldr     r9, LCPI2_10
        ldr     r10, LCPI2_11
  (1*)  subs    r6, r6, #32
  (2*)  subs    r8, r8, #32
  (a*)  movge   r12, lr, lsr r6
  (b*)  movge   r2, r3, lsr r8

(1) is used by (x) for the conditional move at (a). (2) is used by (y) for the
conditional move at (b). After the peephole optimizer, these the flags resulting
from (1*) are ignored and only the flags from (2*) are considered for both
conditional moves.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117876 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-31 22:07:12 +00:00
Nicolas Geoffray
7a5a3f75eb Attach a GCModuleInfo to a MachineFunction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117867 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-31 20:38:38 +00:00
Jakob Stoklund Olesen
e5f4e9fb2b Include MachineBasicBlock numbers in viewCFG() output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117765 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-30 01:26:19 +00:00
Jakob Stoklund Olesen
5b4bb218d1 Make sure copies are inserted after any exception handling labels at the top of
a basic block.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117764 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-30 01:26:16 +00:00
Jakob Stoklund Olesen
92095e7b3f Add SkipPHIsAndLabels from PHIElimination to MachineBasicBlock. It is needed
elsewhere.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117763 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-30 01:26:14 +00:00
Jakob Stoklund Olesen
ab56647e6b Disable more of physical register live intervals verification.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117762 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-30 01:26:11 +00:00
Jakob Stoklund Olesen
7d57753df3 Print out register class of spilled register.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117761 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-30 01:26:09 +00:00
Evan Cheng
189c1ec4c1 Teach machine cse to eliminate instructions with multiple physreg uses and defs. rdar://8610857.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117745 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-29 23:36:03 +00:00
Bob Wilson
46455096be Remove DAG combiner patch to fold vector splats. Instcombiner does it now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117720 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-29 22:03:02 +00:00
Jakob Stoklund Olesen
db4eec3d2c Fix sign error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117677 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-29 18:21:18 +00:00
Evan Cheng
089751535d Avoiding overly aggressive latency scheduling. If the two nodes share an
operand and one of them has a single use that is a live out copy, favor the
one that is live out. Otherwise it will be difficult to eliminate the copy
if the instruction is a loop induction variable update. e.g.

BB:
sub r1, r3, #1
str r0, [r2, r3]
mov r3, r1
cmp
bne BB

=>

BB:
str r0, [r2, r3]
sub r3, r3, #1
cmp
bne BB

This fixed the recent 256.bzip2 regression.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117675 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-29 18:09:28 +00:00
Jakob Stoklund Olesen
3ccfce0e35 Don't transfer unused values to the new intervals formed by splitting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117673 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-29 17:47:49 +00:00
Benjamin Kramer
8a8e26fb18 Silence Release build warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117671 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-29 17:40:05 +00:00
Jakob Stoklund Olesen
6d309059a7 Teach ConnectedVNInfoEqClasses::Classify to deal with unused values.
We don't want unused values forming their own equivalence classes, so we lump
them all together in one class, and then merge them with the class of the last
used value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117670 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-29 17:37:29 +00:00
Jakob Stoklund Olesen
c94fcb1507 Never propagate the idom value out of a block that defines its own value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117669 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-29 17:37:25 +00:00
John Thompson
44ab89eb37 Inline asm multiple alternative constraints development phase 2 - improved basic logic, added initial platform support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117667 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-29 17:29:13 +00:00
Bill Wendling
49ad731adf This may be an ARM target, so check for _Unwind_SjLj_Resume.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117643 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-29 07:46:01 +00:00
Jakob Stoklund Olesen
eeaae20be0 Fix broken equivalence class calculation. We could probably also use
EquvivalenceClasses.h except it looks like overkill when elements are continuous
integers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117631 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-29 00:40:59 +00:00
Jakob Stoklund Olesen
cb367778c0 Print out the connected components in the verifier after complaining about their
multiplicity.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117630 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-29 00:40:57 +00:00
Jakob Stoklund Olesen
1f46a0ac66 Run a verification pass before any splitting to better distribute blame.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117629 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-29 00:40:55 +00:00
Devang Patel
4d7f9a00a5 Ignore empty blocks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117615 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-28 22:11:59 +00:00
Jakob Stoklund Olesen
8c4564287d One day, physical register live ranges will be sensible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117602 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-28 20:44:22 +00:00
Jakob Stoklund Olesen
e1dde7b05a Replace SplitKit SSA update with an iterative algorithm very similar to the one
in SSAUpdaterImpl.h

Verifying live intervals revealed that the old method was completely wrong, and
we need an iterative approach to calculating PHI placemant. Fortunately, we have
MachineDominators available, so we don't have to compute that over and over
like SSAUpdaterImpl.h must.

Live-out values are cached between calls to mapValue() and computed in a greedy
way, so most calls will be working with very small block sets.

Thanks to Bob for explaining how this should work.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117599 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-28 20:34:52 +00:00
Jakob Stoklund Olesen
d68f458244 Make MachineDominators available for SplitEditor. We are going to need it for
proper SSA updating.

This doesn't cause MachineDominators to be recomputed since we are already
requiring MachineLoopInfo which uses dominators as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117598 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-28 20:34:50 +00:00
Jakob Stoklund Olesen
26b92be922 Add a temporary command line option to verify machine code after each spill or
split.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117597 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-28 20:34:47 +00:00
Devang Patel
bc2bb9bbd0 Do not work too hard to find type's file info. There is a special field to record file info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117588 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-28 19:50:08 +00:00
Devang Patel
3cabc9d2c9 Technically DIFile scope should also be handled here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117563 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-28 17:30:52 +00:00
Bob Wilson
0f1db1a6c6 Teach the DAG combiner to fold a splat of a splat. Radar 8597790.
Also do some minor refactoring to reduce indentation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117558 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-28 17:06:14 +00:00
Evan Cheng
7e2fe9150f Re-commit 117518 and 117519 now that ARM MC test failures are out of the way.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117531 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-28 06:47:08 +00:00
Evan Cheng
9e08ee5d16 Revert 117518 and 117519 for now. They changed scheduling and cause MC tests to fail. Ugh.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117520 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-28 02:00:25 +00:00
Evan Cheng
7c88cdcc3b Fix a major bug in operand latency computation. The use index must be adjusted
by the number of defs first for it to match the instruction itinerary.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117518 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-28 01:46:29 +00:00
Evan Cheng
de5fa932b9 Putting r117193 back except for the compile time cost. Rather than assuming fallthroughs uses all registers, just gather the union of all successor liveins.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117506 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-27 23:17:17 +00:00
Michael J. Spencer
3931b54a5f COFF: Add IMAGE_SCN_MEM_READ to text sections.
There are currently 100 references to COFF::IMAGE_SCN in 6 files
and 11 different functions. Section to attribute mapping really
needs to happen in one place to avoid problems like this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117473 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-27 18:52:29 +00:00
Michael J. Spencer
579d7a3dcc Fix whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117472 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-27 18:52:20 +00:00
Jim Grosbach
0ed257c036 Formatting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117453 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-27 16:30:18 +00:00
Jakob Stoklund Olesen
c95c1465fd Handle critical loop predecessors by making both inside and outside registers
live out.

This doesn't prevent us from inserting a loop preheader later on, if that is
better.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117424 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-27 00:39:07 +00:00
Jakob Stoklund Olesen
0960a650b7 Compute critical loop predecessors in the same way as critical loop exits.
Critical edges going into a loop are not as bad as critical exits. We can handle
them by splitting the critical edge, or by having both inside and outside
registers live out of the predecessor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117423 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-27 00:39:05 +00:00
Jakob Stoklund Olesen
8c593f9173 Physical registers trivially have multiple connected components all the time.
Only virtuals should be requires to be connected.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117422 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-27 00:39:01 +00:00
Dale Johannesen
1de4aa904e Use a MemIntrinsicSDNode for ISD::PREFETCH, which touches
memory, so a MachineMemOperand is useful (not propagated
into the MachineInstr yet).  No functional change except
for dump output.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117413 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-26 23:11:10 +00:00
Andrew Trick
3d26d5d524 Remove the vector of live vregs. I thought we would need to track
them, but hopefully we won't. And this is not the right data structure
to do it anyway.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117412 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-26 22:58:24 +00:00
Jakob Stoklund Olesen
3a0e0715a5 After splitting, compute connected components of all new registers, not just for
the remainder register.

Example:

bb0:
  x = 1
bb1:
  use(x)
  ...
  x = 2
  jump bb1

When x is isolated in bb1, the inner part breaks into two components, x1 and x2:

bb0:
  x0 = 1
bb1:
  x1 = x0
  use(x1)
  ...
  x2 = 2
  x0 = x2
  jump bb1

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117408 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-26 22:36:09 +00:00
Jakob Stoklund Olesen
501dc42245 Verify that live intervals are connected. If there are multiple connected
components, each should get its own virtual register.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117407 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-26 22:36:07 +00:00
Jakob Stoklund Olesen
f1354ae95a Call RenumberValues for all new registers created during splitting. This is
necessary to get correct hasPHIKill flags.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117406 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-26 22:36:05 +00:00
Jakob Stoklund Olesen
79c0262fa8 Preserve PHIDef bits in cloned values during splitting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117405 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-26 22:36:02 +00:00
Devang Patel
7e13efad38 Assign source ordering to nodes created for StoreInst.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117404 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-26 22:14:52 +00:00
Jakob Stoklund Olesen
f4a1e1a69f Teach MachineBasicBlock::print() to annotate instructions and blocks with
SlotIndexes when available.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117392 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-26 20:21:46 +00:00
Jakob Stoklund Olesen
dbcc2e119d Remmeber to print full live interval on verification error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117391 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-26 20:21:43 +00:00
Andrew Trick
e16eecc323 Jakob's review of the basic register allocator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117384 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-26 18:34:01 +00:00
Devang Patel
cbbe287f8a s/beginScope/beginInstruction/g
s/endScope/endInstruction/g



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117376 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-26 17:49:02 +00:00
Jakob Stoklund Olesen
e459d55f28 Don't verify physical registers going into landing pads.
Magic is happening that we don't understand.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117370 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-26 16:49:23 +00:00
Evan Cheng
c8141dfc7f Use instruction itinerary to determine what instructions are 'cheap'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117348 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-26 02:08:50 +00:00
Nick Lewycky
a568d66512 For statistics that are only used in functions declared in !NDEBUG, wrap the
declarations in !NDEBUG to avoid -Wunused-variable warnings. Patch by
Matt Beaumont-Gay!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117345 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-26 00:51:57 +00:00
Jakob Stoklund Olesen
0a12b801b5 InlineSpiller can also update LiveStacks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117338 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-26 00:11:35 +00:00
Jakob Stoklund Olesen
2d17293dd0 Make the spiller responsible for updating the LiveStacks analysis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117337 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-26 00:11:33 +00:00
Bob Wilson
7c730e7790 When the "true" and "false" blocks of a diamond if-conversion are the same,
do not double-count the duplicate instructions by counting once from the
beginning and again from the end.  Keep track of where the duplicates from
the beginning ended and don't go past that point when counting duplicates
at the end.  Radar 8589805.

This change causes one of the MC/ARM/simple-fp-encoding tests to produce
different (better!) code without the vmovne instruction being tested.
I changed the test to produce vmovne and vmoveq instructions but moving
between register files in the opposite direction.  That's not quite the same
but predicated versions of those instructions weren't being tested before,
so at least the test coverage is not any worse, just different.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117333 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-26 00:02:24 +00:00
Bob Wilson
2ad40d3494 Change if-conversion to keep track of the extra cost due to microcoded
instructions separately from the count of non-predicated instructions.  The
instruction count is used in places to determine how many instructions to
copy, predicate, etc. and things get confused if that count includes the
extra cost for microcoded ops.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117332 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-26 00:02:21 +00:00
Evan Cheng
38fd9f2a2d Neuter r117193 as it causes significant post-ra scheduler compile time regression.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117329 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-25 23:56:21 +00:00
Devang Patel
df8370bd70 Simplify.
Do not count use of sdisel for single call instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117316 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-25 21:31:46 +00:00
Devang Patel
948f7d0216 Add counters to count basic blocks and machine basic blocks with out of order line number info.
Add counters to count how many basic blocks are entirely selected by fastisel.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117310 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-25 20:55:43 +00:00
Devang Patel
9a31f0f398 Add simple counter to count no. of basic blocks without any line number information. At -O0, these basic block coule cause less than optimial debugging experience.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117307 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-25 20:45:32 +00:00
Jakob Stoklund Olesen
d3b4895414 In which I learn how to forward declare template classes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117272 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-25 17:27:30 +00:00
Chandler Carruth
19e57025d4 Move the remaining attribute macros to systematic names based on the attribute
name and prefixed with 'LLVM_'.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117203 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-23 08:40:19 +00:00
Chandler Carruth
2b3ef8b065 Fix a likely bug in an assertion by adding parentheses around '||'. This bug
was found by a GCC warning. ;]


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117199 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-23 07:46:14 +00:00
Evan Cheng
ec6906ba47 Properly model the latency of register defs which are 1) function returns or
2) live-outs.

Previously the post-RA schedulers completely ignore these dependencies since
returns, branches, etc. are all scheduling barriers. This patch model the
latencies between instructions being scheduled and the barriers. It also
handle calls by marking their register uses.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117193 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-23 02:10:46 +00:00
Jakob Stoklund Olesen
7871687604 Verify LiveIntervals against the CFG, ensuring that live-in values are live-out
of all predecessors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117191 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-23 00:49:09 +00:00
Andrew Trick
f433106054 Nonvirtual dtor that was accessible enough to be bad.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117180 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-22 23:33:19 +00:00
Andrew Trick
14e8d71cc9 This is a prototype of an experimental register allocation
framework. It's purpose is not to improve register allocation per se,
but to make it easier to develop powerful live range splitting. I call
it the basic allocator because it is as simple as a global allocator
can be but provides the building blocks for sophisticated register
allocation with live range splitting. 

A minimal implementation is provided that trivially spills whenever it
runs out of registers. I'm checking in now to get high-level design
and style feedback. I've only done minimal testing. The next step is
implementing a "greedy" allocation algorithm that does some register
reassignment and makes better splitting decisions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117174 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-22 23:09:15 +00:00
Jakob Stoklund Olesen
3bf7cf9f0e Add more verification of LiveIntervals.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117170 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-22 22:48:58 +00:00
Jakob Stoklund Olesen
2bfb324684 Be more strict about detecting multi-use blocks for isolation.
When a block has exactly two uses and the register is both live-in and live-out,
don't isolate the block. We would be inserting two copies, so we haven't really
made any progress.

If the live-in and live-out values separate into disconnected components after
splitting, we would be making progress. We can't detect that for now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117169 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-22 22:48:56 +00:00
Evan Cheng
c8f46c45a0 Unbreak build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117155 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-22 21:49:09 +00:00
Evan Cheng
b179b46cc5 Transfer implicit ops when forming load multiple and return instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117151 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-22 21:29:58 +00:00
Jakob Stoklund Olesen
2c1442e1b2 Be more strict when detecting critical edges before loop splitting.
An exit block with a critical edge must only have predecessors in the loop, or
just before the loop. This guarantees that the inserted copies in the loop
predecessors dominate the exit block.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117144 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-22 20:28:23 +00:00
Jakob Stoklund Olesen
532de3dc6e Add print methods
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117143 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-22 20:28:21 +00:00
Michael J. Spencer
391b43bf33 X86: Base _fltused on the FunctionType of the called value instead of the potentially null "CalledFunction". Thanks Duncan!
This is needed for indirect calls.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117061 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-21 20:49:23 +00:00
Jakob Stoklund Olesen
9d999772df Don't include the destination interval in the union when computing
Parent - union(Y, ...). Doh.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117042 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-21 18:47:08 +00:00
Jakob Stoklund Olesen
0a7bbcb0cc Permit landing pad successor blocks when verifying basic blocks that end in an
unconditional branch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117041 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-21 18:47:06 +00:00
Duncan Sands
9bc20ca728 The variable liTRC is not used for anything useful, zap it
(gcc-4.6 warning).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117022 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-21 16:04:43 +00:00
Duncan Sands
6abfa46987 Remove some variables that are never really used
(gcc-4.6 warns about these).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117021 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-21 16:03:28 +00:00
Michael J. Spencer
dd0a00a6e3 CodeGen-Windows: Only emit _fltused if a VarArg function is called with floating point args.
This should be the minimum set of functions that could possibly need it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116978 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-21 00:08:21 +00:00
Jakob Stoklund Olesen
f1583ae84a Remember to keep track of rematted values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116962 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-20 22:50:42 +00:00
Evan Cheng
134982daa9 More accurate estimate / tracking of register pressure.
- Initial register pressure in the loop should be all the live defs into the
  loop. Not just those from loop preheader which is often empty.
- When an instruction is hoisted, update register pressure from loop preheader
  to the original BB.
- Treat only use of a virtual register as kill since the code is still SSA.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116956 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-20 22:03:58 +00:00
Jakob Stoklund Olesen
080c316ff8 Move some of the InlineSpiller rematerialization code into LiveRangeEdit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116951 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-20 22:00:51 +00:00
Dale Johannesen
e93d99cf07 Remove Synthesizable from the Type system; as MMX vector
types are no longer Legal on X86, we don't need it.
No functional change.  8499854.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116947 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-20 21:32:10 +00:00
Jakob Stoklund Olesen
9b25940474 When SimpleRegisterCoalescing is trimming kill flags on a physical register
operand, also check if subregisters are killed.

Add <imp-def> operands for subregisters that remain alive after a super register
is killed.

I don't have a testcase for this that reproduces on trunk. <rdar://problem/8441758>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116940 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-20 18:45:55 +00:00
Dan Gohman
f96e4bd2a3 Make CodeGen TBAA-aware.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116890 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-20 00:31:05 +00:00
Jim Grosbach
e4ad387a5a Add a pre-dispatch SjLj EH hook on the unwind edge for targets to do any
setup they require. Use this for ARM/Darwin to rematerialize the base
pointer from the frame pointer when required. rdar://8564268

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116879 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-19 23:27:08 +00:00
Jakob Stoklund Olesen
2594746045 Shrink MachineOperand from 40 to 32 bytes on 64-bit hosts.
Pull an unsigned out of the Contents union such that it has the same size as two
pointers and no padding.

Arrange members such that the Contents union and all pointers can be 8-byte
aligned without padding.

This speeds up code generation by 0.8% on a 64-bit host. 32-bit hosts should be
unaffected.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116857 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-19 20:56:32 +00:00
Evan Cheng
2312842de0 Re-enable register pressure aware machine licm with fixes. Hoist() may have
erased the instruction during LICM so UpdateRegPressureAfter() should not
reference it afterwards.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116845 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-19 18:58:51 +00:00
Owen Anderson
081c34b725 Get rid of static constructors for pass registration. Instead, every pass exposes an initializeMyPassFunction(), which
must be called in the pass's constructor.  This function uses static dependency declarations to recursively initialize
the pass's dependencies.

Clients that only create passes through the createFooPass() APIs will require no changes.  Clients that want to use the
CommandLine options for passes will need to manually call the appropriate initialization functions in PassInitialization.h
before parsing commandline arguments.

I have tested this with all standard configurations of clang and llvm-gcc on Darwin.  It is possible that there are problems
with the static dependencies that will only be visible with non-standard options.  If you encounter any crash in pass
registration/creation, please send the testcase to me directly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116820 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-19 17:21:58 +00:00
Daniel Dunbar
9869413802 Revert r116781 "- Add a hook for target to determine whether an instruction def
is", which breaks some nightly tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116816 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-19 17:14:24 +00:00
NAKAMURA Takumi
3b3b0ebd2e lib/CodeGen/TargetLoweringObjectFileImpl.cpp: Tweak to emit ".{section}${name}" instead of ".{section}$linkonce_{name}" for linkonce sections.
It seems GNU ld/PECOFF relies on section names, linking with g++'s libstdc++.a would fail.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116791 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-19 03:24:42 +00:00
Andrew Trick
dc986d2462 Fix for machine licm assert: RCCost <= RegPressure[RCId]
in MultiSource/Benchmarks/VersaBench/beamformer/beamformer.
SmallSet.insert returns true if the element is inserted.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116790 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-19 02:50:50 +00:00
Evan Cheng
11e8b74a7a - Add a hook for target to determine whether an instruction def is
"long latency" enough to hoist even if it may increase spilling. Reloading
  a value from spill slot is often cheaper than performing an expensive
  computation in the loop. For X86, that means machine LICM will hoist
  SQRT, DIV, etc. ARM will be somewhat aggressive with VFP and NEON
  instructions.
- Enable register pressure aware machine LICM by default.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116781 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-19 00:55:07 +00:00
Bill Wendling
b41ee96d76 Don't recompute MachineRegisterInfo in the Optimize* method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116750 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-18 21:22:31 +00:00
Dan Gohman
4021fccf9f Add TypeBasedAliasAnalysis to the standard pass lists. Note that it
is currently inert by default.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116732 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-18 18:50:27 +00:00
Dan Gohman
c1be92f3bb Make BasicAliasAnalysis a normal AliasAnalysis implementation which
does normal initialization and normal chaining. Change the default
AliasAnalysis implementation to NoAlias.

Update StandardCompileOpts.h and friends to explicitly request
BasicAliasAnalysis.

Update tests to explicitly request -basicaa.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116720 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-18 18:04:47 +00:00
Jim Grosbach
c0c7c2b606 Trivial grammar tweak.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116710 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-18 16:29:26 +00:00
Michael J. Spencer
84ac4d5a2a X86-Windows: Emit an undefined global __fltused symbol when targeting Windows
if any floating point arguments are passed to an external function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116665 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-16 08:25:41 +00:00
Michael J. Spencer
e70c526d59 Whitespace!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116664 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-16 08:25:21 +00:00
Evan Cheng
03a9fdf2e7 More machine LICM work. It now tracks register pressure for path from preheader to current BB and use the information determine whether hoisting is worthwhile.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116654 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-16 02:20:26 +00:00
Jakob Stoklund Olesen
50cef5829d Remove unused accessor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116580 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-15 16:06:40 +00:00
Jakob Stoklund Olesen
9d5d48bc41 Eliminate curli from SplitEditor. Use the LiveRangeEdit reference instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116547 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-15 00:34:01 +00:00
Jakob Stoklund Olesen
2a0180fbff Move stack slot assignments into LiveRangeEdit.
All registers created during splitting or spilling are assigned to the same
stack slot as the parent register.

When splitting or rematting, we may not spill at all. In that case the stack
slot is still assigned, but it will be dead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116546 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-15 00:16:55 +00:00
Jakob Stoklund Olesen
a17768f582 Create a new LiveRangeEdit class to keep track of the new registers created when
splitting or spillling, and to help with rematerialization.

Use LiveRangeEdit in InlineSpiller and SplitKit. This will eventually make it
possible to share remat code between InlineSpiller and SplitKit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116543 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-14 23:49:52 +00:00
Jakob Stoklund Olesen
ab00e9f498 Only split around a loop if the live range has uses outside the loop periphery.
Before we would also split around a loop if any peripheral block had multiple
uses. This could cause repeated splitting when splitting a different live range
would insert uses into the periphery.

Now -spiller=inline passes the nightly test suite again.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116494 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-14 18:26:45 +00:00
Evan Cheng
0e673919f0 Register pressure and instruction latency aware machine LICM. Work in progress.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116465 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-14 01:16:09 +00:00
Owen Anderson
325e264355 Analysis groups need to initialize their default implementations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116441 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-13 21:49:58 +00:00
Owen Anderson
2ab36d3502 Begin adding static dependence information to passes, which will allow us to
perform initialization without static constructors AND without explicit initialization
by the client.  For the moment, passes are required to initialize both their
(potential) dependencies and any passes they preserve.  I hope to be able to relax
the latter requirement in the future.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116334 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-12 19:48:12 +00:00
Jakob Stoklund Olesen
31cc3ec330 Replace FindLiveRangeContaining() with getVNInfoAt() in LiveIntervalAnalysis.
This helps hiding the LiveRange class which really should be private.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116244 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-11 21:45:03 +00:00
Jakob Stoklund Olesen
40ef4fe82a Properly handle reloading and spilling around partial redefines in
LocalRewriter.

This is a bit of a hack that adds an implicit use operand to model the
read-modify-write nature of a partial redef. Uses and defs are rewritten in
separate passes, and a single operand would never be processed twice.

<rdar://problem/8518892>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116210 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-11 18:10:36 +00:00
Chris Lattner
60cb528246 Per discussion with Sanjiv, remove the PIC16 target from mainline. When/if
it comes back, it will be largely a rewrite, so keeping the old codebase
in tree isn't helping anyone.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116190 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-11 05:44:40 +00:00
Chris Lattner
07e3a38c78 fix the default va_arg expansion (in the realignment case) to not implicitly
truncate the stack pointer to 32-bits on a 64-bit machine.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116169 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-10 18:36:26 +00:00
Benjamin Kramer
ccefe32141 Silence compiler warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116156 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-09 16:36:44 +00:00
Jakob Stoklund Olesen
7466927b1a Rename SplitEditor::rewrite to finish() and break it out into a couple of new
functions: computeRemainder and rewrite.

When the remainder breaks up into multiple components, remember to rewrite those
uses as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116121 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-08 23:42:21 +00:00
Evan Cheng
d82de8341c Avoid compiler warning: comparison between signed and unsigned integer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116119 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-08 23:01:57 +00:00
Jakob Stoklund Olesen
a32181a57d Extract method ProcessUses from LocalRewriter::RewriteMBB. Both parent and child
are still way too long, but it's a start.

No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116116 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-08 22:14:41 +00:00
Anton Korobeynikov
657985eb8b Do not check that the bodies of two defs of same linkonce global are the same.
Such a check does not make any sense in presense of inlining and other compiler-dependent stuff.
This should fix bunch of warnings on mingw32.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116113 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-08 21:50:04 +00:00
Jakob Stoklund Olesen
54f32e6575 Classify value numbers into connected components in linear time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116105 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-08 21:19:28 +00:00
Rafael Espindola
ff9dfedd10 Call InitSections in llc and clang so that the binaries produced by them
are easier to diff with those produced by llvm-mc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116095 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-08 19:37:38 +00:00
Evan Cheng
e95f3195b8 Don't waste time unfolding simple loads. The unfolded copy won't be hoisted.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116081 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-08 18:59:19 +00:00
Evan Cheng
1aca5bc135 Fix operand latency computation in cases where the definition operand is
implicit. e.g.
%D6<def>, %D7<def> = VLD1q16 %R2<kill>, 0, ..., %Q3<imp-def>                                                                                                                                                                              
%Q1<def> = VMULv8i16 %Q1<kill>, %Q3<kill>, ...

The real definition indices are 0,1.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116080 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-08 18:42:25 +00:00
Devang Patel
b2bada305e Line number 0 indicates there is no source line/file name info available for this construct.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116061 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-08 17:18:54 +00:00
Jakob Stoklund Olesen
0253df9a89 After splitting, the remaining LiveInterval may be fragmented into multiple
connected components. These components should be allocated different virtual
registers because there is no reason for them to be allocated together.

Add the ConnectedVNInfoEqClasses class to calculate the connected components,
and move values to new LiveIntervals.

Use it from SplitKit::rewrite by creating new virtual registers for the
components.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116006 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-07 23:34:34 +00:00
Owen Anderson
ce665bd2e2 Now with fewer extraneous semicolons!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115996 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-07 22:25:06 +00:00
Devang Patel
7b172c6ae6 Provie a clearner interface so that FE can decide whether a function has prototype or not.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115988 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-07 22:03:01 +00:00
Jakob Stoklund Olesen
452a9fdf54 Print more loop info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115951 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-07 18:47:07 +00:00
Jakob Stoklund Olesen
8fc3d1187c Print out MBB number when rewriting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115950 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-07 18:47:05 +00:00
Owen Anderson
78b152470d Add initialization routines for CodeGen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115949 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-07 18:41:20 +00:00
Jakob Stoklund Olesen
4b3041c43e Cache interval iterators in SplitEditor::addTruncSimpleRange so we only have to
do one find().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115929 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-07 17:56:39 +00:00
Jakob Stoklund Olesen
9b24afe41e Clean up debug printing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115928 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-07 17:56:35 +00:00
Jakob Stoklund Olesen
bf4699c561 Add MachineRegisterInfo::constrainRegClass and use it in MachineCSE.
This function is intended to be used when inserting a machine instruction that
trivially restricts the legal registers, like LEA requiring a GR32_NOSP
argument.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115875 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-06 23:54:39 +00:00
Jakob Stoklund Olesen
893ab5d701 Skip unused registers when verifying LiveIntervals.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115874 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-06 23:54:35 +00:00
Owen Anderson
e9ef41a47d Hide analysis group registration behind a macro, just like pass registration.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115835 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-06 21:02:27 +00:00
Devang Patel
d6747df5e0 Add support for DW_TAG_unspecified_parameters.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115833 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-06 20:50:40 +00:00
Nick Lewycky
9c220fc165 Remove unused variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115802 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-06 18:11:50 +00:00
Dan Gohman
0dadb15927 ComputeLinearIndex doesn't need its TLI argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115792 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-06 16:18:29 +00:00
Evan Cheng
a0792de66c - Add TargetInstrInfo::getOperandLatency() to compute operand latencies. This
allow target to correctly compute latency for cases where static scheduling
  itineraries isn't sufficient. e.g. variable_ops instructions such as
  ARM::ldm.
  This also allows target without scheduling itineraries to compute operand
  latencies. e.g. X86 can return (approximated) latencies for high latency
  instructions such as division.
- Compute operand latencies for those defined by load multiple instructions,
  e.g. ldm and those used by store multiple instructions, e.g. stm.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115755 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-06 06:27:31 +00:00
Jakob Stoklund Olesen
9b90d7eae2 Count uses in all nested loops, not just the deepest.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115710 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-05 23:10:12 +00:00
Jakob Stoklund Olesen
fc3ef3c2e9 Remove SplitAnalysis::removeUse. It was only used to make SplitAnalysis
reusable, but that is no longer relevant since a split will always replace the
original.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115709 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-05 23:10:09 +00:00
Jakob Stoklund Olesen
d00f7e0c76 dupli always has an interval now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115708 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-05 23:10:04 +00:00
Jakob Stoklund Olesen
2e2be60e03 We can split around loops with multiple exits now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115696 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-05 22:19:35 +00:00
Jakob Stoklund Olesen
57d0f2deb0 Update SplitEditor API to reflect the fact that the original live interval is
never kept after splitting.

Keeping the original interval made sense when the split region doesn't modify
the register, and the original is spilled. We can get the same effect by
detecting reloaded values when spilling around copies.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115695 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-05 22:19:33 +00:00
Jakob Stoklund Olesen
dbc36091ff Intervals are half-open.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115694 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-05 22:19:29 +00:00
Jakob Stoklund Olesen
984a7fc32c When we find a reaching definition, make sure it is visited from all paths by
erasing it from the visited set. That ensures we create the right phi defs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115666 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-05 20:36:28 +00:00
Jakob Stoklund Olesen
fc60d7729b Don't use nextIndex to check for live out of instruction.
Insert copy after defining instruction.

Fix LiveIntervalMap::extendTo to properly handle live segments starting before
the current basic block.

Make sure the open live range is extended to the inserted copy's use slot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115665 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-05 20:36:25 +00:00
Jakob Stoklund Olesen
a818c072af Tweak VNInfo printing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115650 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-05 18:48:57 +00:00
Jakob Stoklund Olesen
201ecfca98 Add assert for valid slot indexes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115649 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-05 18:48:55 +00:00
Owen Anderson
3a9e7690ba Use a more efficient lowering of uint64_t --> float that can take advantage of hardware signed integer conversion without
having to do a double cast (uint64_t --> double --> float).  This is based on the algorithm from compiler_rt's __floatundisf
for X86-64.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115634 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-05 17:24:05 +00:00
Evan Cheng
2a135ae530 This DAG combine BRCOND transformation can look pass truncate of the operand:
//   %a = ...                                                                                                                                                                                  
    //   %b = and i32 %a, 2                                                                                                                                                                        
    //   %c = srl i32 %b, 1                                                                                                                                                                        
    //   brcond i32 %c ...                                                                                                                                                                         
    //                                                                                                                                                                                             
    // into                                                                                                                                                                                        
    //                                                                                                                                                                                             
    //   %a = ...                                                                                                                                                                                  
    //   %b = and i32 %a, 2                                                                                                                                                                        
    //   %c = setcc eq %b, 0                                                                                                                                                                       
    //   brcond %c ...

Make sure it restores local variable N1, which corresponds to the condition operand if it fails to match.

This apparently breaks TCE but since that backend isn't in the tree I don't have a test for it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115571 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-04 22:41:01 +00:00
Lang Hames
ab62b7e861 Removed the older style (in-allocator) problem construction system from the PBQP allocator. Problem construction is now done exclusively with the new builders.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115502 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-04 12:13:07 +00:00
Jakob Stoklund Olesen
ed8263553a Stop using LiveRange in MachineVerifier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115408 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-02 05:24:46 +00:00
Bob Wilson
f70007e89e Fix a miscompile in 186.crafty for Thumb2 that was exposed by Evan's
scheduling change in svn 115121.  The CriticalAntiDepBreaker had bad
liveness information.  It was calculating the KillIndices for one scheduling
region in a basic block, rescheduling that region so the KillIndices were
no longer valid, and then using those wrong KillIndices to make decisions
for the next scheduling region.  I've not been able to reduce a small
testcase for this.  Radar 8502534.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115400 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-02 01:49:29 +00:00
Jakob Stoklund Olesen
5f2d1fa0f7 Drop the use of LiveInterval::iterator and the LiveRange class in
RemoveCopyByCommutingDef.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115386 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01 23:52:27 +00:00
Jakob Stoklund Olesen
e0a73ec0a9 When RemoveCopyByCommutingDef is creating additional identity copies, just use
LiveInterval::MergeValueNumberInto instead of trying to extend LiveRanges and
getting it wrong.

This fixed PR8249 where a valno with a multi-segment live range was defined by
an identity copy created by RemoveCopyByCommutingDef. Some of the live
segments disappeared.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115385 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01 23:52:25 +00:00
Jakob Stoklund Olesen
a9b85c1074 Pretty up the debug output during RemoveCopyByCommutingDef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115384 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01 23:52:22 +00:00
Devang Patel
21ea1d5b4c Add support to let FE mark explict methods as explict in debug info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115378 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01 23:31:40 +00:00
Jim Grosbach
2b2de24fe2 Nuke trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115377 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01 23:29:12 +00:00
Owen Anderson
e3cc84a43d Thread the determination of branch prediction hit rates back through the if-conversion heuristic APIs. For now,
stick with a constant estimate of 90% (branch predictors are good!), but we might find that we want to provide
more nuanced estimates in the future.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115364 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01 22:45:50 +00:00
Devang Patel
27f46cd639 Fix code gen crash reported in PR 8235. We still lose debug info for the unused argument here. This is a known limitation recorded debuginfo-tests/trunk/dbg-declare2.ll function 'f6' test case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115323 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01 19:00:44 +00:00
Gabor Greif
fb4032f422 typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115310 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01 10:32:19 +00:00
Chris Lattner
6bf263b4a2 fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115300 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01 06:54:02 +00:00
Chris Lattner
2831a19495 fix rdar://8494845 + PR8244 - a miscompile exposed by my patch in r101350
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115294 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01 05:36:09 +00:00
Dale Johannesen
0488fb649a Massive rewrite of MMX:
The x86_mmx type is used for MMX intrinsics, parameters and
return values where these use MMX registers, and is also
supported in load, store, and bitcast.

Only the above operations generate MMX instructions, and optimizations
do not operate on or produce MMX intrinsics. 

MMX-sized vectors <2 x i32> etc. are lowered to XMM or split into
smaller pieces.  Optimizations may occur on these forms and the
result casted back to x86_mmx, provided the result feeds into a
previous existing x86_mmx operation.

The point of all this is prevent optimizations from introducing
MMX operations, which is unsafe due to the EMMS problem.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115243 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 23:57:10 +00:00
Jakob Stoklund Olesen
2622f4622c When isel is emitting instructions for an x86 target without CMOV, the CFG is
edited during emission.

If the basic block ends in a switch that gets lowered to a jump table, any
phis at the default edge were getting updated wrong. The jump table data
structure keeps a pointer to the header blocks that wasn't getting updated
after the MBB is split.

This bug was exposed on 32-bit Linux when disabling critical edge splitting in
codegen prepare.

The fix is to uipdate stale MBB pointers whenever a block is split during
emission.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115191 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 19:44:31 +00:00
Devang Patel
3cf763dc7a Let FE mark a variable as artificial variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115102 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 23:07:21 +00:00
Evan Cheng
3881cb7a5d Model Cortex-a9 load to SUB, RSB, ADD, ADC, SBC, RSC, CMN, MVN, or CMP
pipeline forwarding path.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115098 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 22:42:35 +00:00
Benjamin Kramer
6406d004c9 Silence msvc warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115097 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 22:38:50 +00:00
Devang Patel
1a30123b60 Add support to let FE encode method access specifier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115089 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 21:44:16 +00:00
Owen Anderson
b0725316cd UnreachableBlockElim could incorrectly return false when it had not modified the CFG, but HAD modified some PHI nodes. Fixes PR8174.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115083 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 20:57:19 +00:00
Devang Patel
2a3616012c Assign DW_ACCESS_public accessibility attribute to members by default.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115067 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 19:08:08 +00:00
Bill Wendling
2ff6e1e62c Revert r114997. It was causing a failure on darwin10-selfhost.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115002 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-28 23:11:55 +00:00
Oscar Fuentes
3609eb0de2 Removed a bunch of unnecessary target_link_libraries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114999 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-28 22:39:14 +00:00
Bill Wendling
4edab1a9e8 Fix a FIXME. _foo.eh symbols are currently always exported so that the linker
knows about them. This is not necessary on 10.6 and later.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114997 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-28 22:36:56 +00:00
Owen Anderson
7571ee7885 Give the if-converter access to MachineLoopInfo, and use it to generate plausible branch prediction
estimates.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114981 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-28 20:42:15 +00:00
Owen Anderson
b20b85168c Part one of switching to using a more sane heuristic for determining if-conversion profitability.
Rather than having arbitrary cutoffs, actually try to cost model the conversion.

For now, the constants are tuned to more or less match our existing behavior, but these will be
changed to reflect realistic values as this work proceeds.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114973 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-28 18:32:13 +00:00
Devang Patel
1a7ca0354a Provide an interface to let FEs anchor debug info for types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114969 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-28 18:08:20 +00:00
Devang Patel
ee70fa77b4 Remove dead argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114920 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27 23:15:27 +00:00
Dale Johannesen
61b20efd9a Don't try to make a vector of x86mmx; this won't work,
and asserts.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114843 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27 17:29:14 +00:00
Chris Lattner
8048ebe91d the latest assembler that runs on powerpc 10.4 machines doesn't
support aligned comm.  Detect when compiling for 10.4 and don't
emit an alignment for comm.  THis will hopefully fix PR8198.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114817 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27 06:44:54 +00:00
Lang Hames
cec2945f30 Fixed some tests to avoid LiveIntervals::getInstructionFromIndex(..) overhead where possible. Thanks to Jakob for the suggestions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114798 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-26 03:37:09 +00:00
Jakob Stoklund Olesen
207f8f688b Avoid using VNInfo::getCopy as much as possible. I want to get rid of it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114794 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-25 18:10:38 +00:00
Lang Hames
6e2968c85c Removed VNInfo::isDefAccurate(). Def "accuracy" can be checked by testing whether LiveIntervals::getInstructionFromIndex(def) returns NULL.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114791 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-25 12:04:16 +00:00
Jakob Stoklund Olesen
011e591071 Remove SlotIndex::PHI_BIT. It is no longer used by anything.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114779 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-25 00:45:18 +00:00
Jakob Stoklund Olesen
7c78e2624c Remove the only use of SlotIndex::isPHI. This bit is not being set consistently
and it will be removed shortly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114778 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-25 00:45:15 +00:00
Jakob Stoklund Olesen
1803b37bad Terminator gaps were unused. Might as well delete them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114776 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-24 23:58:56 +00:00
John Thompson
54584743f3 Fix for test/CodeGen/PowerPC/2008-10-17-AsmMatchingOperands.ll crash.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114767 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-24 22:24:05 +00:00
Michael J. Spencer
1f40960543 Get rid of pop_macro warnings on MSVC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114750 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-24 19:48:47 +00:00
Nicolas Geoffray
946e3c9f9d Attach a DebugLoc to a GC point in order to get precise information in the JIT of a GC point.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114736 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-24 17:27:50 +00:00
Evan Cheng
8c1f4329e2 Revert 114634 for now since buildbot claim it broke Clang self-hosting. I doubt it but it's possible it's exposing another bug somewhere.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114681 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-23 18:32:19 +00:00
Oscar Fuentes
df30bdb3a7 Fix VS 2010 build.
Patch by Nathan Jeffords!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114661 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-23 16:59:36 +00:00
Evan Cheng
b8db1981b8 Follow up to r114630. Do not optimize away unconditional branch following a conditional one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114634 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-23 07:18:35 +00:00
Evan Cheng
b0cdf8a446 Don't sink insert_subreg, subreg_to_reg, reg_sequence. They are meant to be
close to their sources to facilitate coalescing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114631 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-23 06:53:00 +00:00
Evan Cheng
266a99d161 SDISel should not optimize a unconditional branch following a conditional branch
when the unconditional branch destination is the fallthrough block. The
canonicalization makes it easier to allow optimizations on DAGs to invert
conditional branches. The branch folding pass (and AnalyzeBranch) will clean up
the unnecessary unconditional branches later.

This is one of the patches leading up to disabling codegen prepare critical edge
splitting.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114630 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-23 06:51:55 +00:00
Lang Hames
f70e7cc7a2 Moved the PBQP allocator class out of the header and back in to the cpp file to hide the gory details.
Allocator instances can now be created by calling createPBQPRegisterAllocator.

Tidied up use of CoalescerPair as per Jakob's suggestions.

Made the new PBQPBuilder based construction process the default. The internal construction process
remains in-place and available via -pbqp-builder=false for now. It will be removed shortly if the new
process doesn't cause any regressions.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114626 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-23 04:28:54 +00:00
Owen Anderson
ed1088afb5 A select between a constant and zero, when fed by a bit test, can be efficiently
lowered using a series of shifts.
Fixes <rdar://problem/8285015>.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114599 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-22 22:58:22 +00:00
Devang Patel
be90c3a0ea Use DW_OP_fbreg when offset is based on frame register.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114585 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-22 21:10:38 +00:00
Jakob Stoklund Olesen
5fa42a45a1 Build the complement interval dupli after the split intervals instead of
creating it before and subtracting split ranges.

This way, the SSA update code in LiveIntervalMap can properly create and use new
phi values in dupli. Now it is possible to create split regions where a value
escapes along two different CFG edges, creating phi values outside the split
region.

This is a work in progress and probably quite broken.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114492 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 22:32:21 +00:00
John Thompson
67aff164c0 Fixed pr20314-2.c failure, added E, F, p constraint letters.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114490 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 22:04:54 +00:00
Chris Lattner
d847bc20b8 Rework passing parent pointers into complexpatterns, I forgot
that complex patterns are matched after the entire pattern has
a structural match, therefore the NodeStack isn't in a useful
state when the actual call to the matcher happens.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114489 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 22:00:25 +00:00
Devang Patel
44cfe14445 If only user of a vreg is an copy instruction to export copy of vreg out of current basic block then insert DBG_VALUE so that debug value of the variable is also transfered to new vreg.
Testcase is in r114476.
This fixes radar 8412415.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114478 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 20:56:33 +00:00
Chris Lattner
77bd88cda5 correct this logic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114474 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 20:46:40 +00:00
Owen Anderson
bc146b0a4d Reimplement r114460 in target-independent DAGCombine rather than target-dependent, by using
the predicate to discover the number of sign bits.  Enhance X86's target lowering to provide
a useful response to this query.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114473 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 20:42:50 +00:00
Chris Lattner
78d3af47f5 just like they can opt into getting the root of the pattern being
matched, allow ComplexPatterns to opt into getting the parent node
of the operand being matched.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114472 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 20:37:12 +00:00
Jakob Stoklund Olesen
7c72707216 Refix MSVC9 and upper_bound. It actually needs a fully symmetric comparator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114469 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 20:16:12 +00:00
Chris Lattner
84bd98ac7b finish pushing MachinePointerInfo through selectiondags. At this point,
I think I've audited all uses, so it should be dependable for address spaces,
and the pointer+offset info should also be accurate when there.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114464 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 18:58:22 +00:00
Chris Lattner
fc448ff89b convert a couple more places to use the new getStore()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114463 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 18:51:21 +00:00
Chris Lattner
6229d0acb8 update a bunch of code to use the MachinePointerInfo version of getStore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114461 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 18:41:36 +00:00
Jakob Stoklund Olesen
89bfef003e Don't pollute the global namespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114459 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 18:34:17 +00:00
Jakob Stoklund Olesen
2de0e808c1 MSVC9 does not support upper_bound with an asymmetric comparator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114455 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 18:24:30 +00:00
Bob Wilson
65ffec49f7 Define the TargetLowering::getTgtMemIntrinsic hook for ARM so that NEON load
and store intrinsics are represented with MemIntrinsicSDNodes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114454 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 17:56:22 +00:00
Chris Lattner
da2d8e1032 eliminate an old SelectionDAG::getTruncStore method, propagating
MachinePointerInfo around more.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114452 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 17:42:31 +00:00
Chris Lattner
5cd9391a08 eliminate last SelectionDAG::getLoad old entrypoint, on to stores.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114450 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 17:28:52 +00:00
Chris Lattner
d0e139fa74 fix the code that infers SV info to be correct when dealing
with an indexed load/store that has an offset in the index.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114449 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 17:24:05 +00:00
Jakob Stoklund Olesen
f568b2706e Add LiveInterval::find and use it for most LiveRange searching operations
instead of calling lower_bound or upper_bound directly.

This cleans up the search logic a bit because {lower,upper}_bound compare
LR->start by default, and it is usually simpler to search LR->end.

Funnelling all searches through one function also makes it possible to replace
the search algorithm with something faster than binary search.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114448 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 17:12:18 +00:00
Jakob Stoklund Olesen
0635ead2c4 Remove dead method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114447 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 17:12:15 +00:00
Chris Lattner
3d6ccfba31 propagate MachinePointerInfo through various uses of the old
SelectionDAG::getExtLoad overload, and eliminate it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114446 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 17:04:51 +00:00
Chris Lattner
ecf42c4720 continue MachinePointerInfo'izing, eliminating use of one of the old
getLoad overloads.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114443 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 16:36:31 +00:00
Chris Lattner
fa45901eaa convert dagcombine off the old form of getLoad. This fixes several bugs
with SVOffset computation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114442 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 16:08:50 +00:00
Chris Lattner
f165806655 simplify DAGCombiner::SimplifySelectOps step #2/2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114437 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 15:58:55 +00:00
Chris Lattner
1806161a0b substantially reduce indentation and simplify DAGCombiner::SimplifySelectOps.
no functionality change (step #1)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114436 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 15:46:59 +00:00
Lang Hames
0898291490 Fixed ambiguous call.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114431 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 13:47:10 +00:00
Lang Hames
e9c935662d Added an additional PBQP problem builder which adds coalescing costs (both between pairs of virtuals, and between virtuals and physicals).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114429 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 13:19:36 +00:00
Gabor Greif
04ac81d5db Move the search for the appropriate AND instruction
into OptimizeCompareInstr.
This necessitates the passing of CmpValue around,
so widen the virtual functions to accomodate.

No functionality changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114428 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 12:01:15 +00:00
Chris Lattner
85ca106632 a few more trivial updates. This fixes PerformInsertVectorEltInMemory to not
pass a completely incorrect SrcValue, which would result in a miscompile with
combiner-aa.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114411 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 07:32:19 +00:00
Chris Lattner
1daa6f479d add some accessors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114409 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 06:43:24 +00:00
Chris Lattner
e8639036b1 it's more elegant to put the "getConstantPool" and
"getFixedStack" on the MachinePointerInfo class.  While
this isn't the problem I'm setting out to solve, it is the
right way to eliminate PseudoSourceValue, so lets go with it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114406 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 06:22:23 +00:00
Chris Lattner
e72f2027e9 reimplement memcpy/memmove/memset lowering to use MachinePointerInfo
instead of srcvalue/offset pairs.  This corrects SV info for mem 
operations whose size is > 32-bits.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114401 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 05:40:29 +00:00
Chris Lattner
40a858f6e7 add some helpful accessors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114400 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 05:39:30 +00:00
Chris Lattner
5c5cb2a171 add overloads for SelectionDAG::getLoad, getStore, getTruncStore that take a
MachinePointerInfo.  Among other virtues, this doesn't silently  truncate the
svoffset to 32-bits.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114399 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 05:10:45 +00:00
Chris Lattner
e9ba5dd236 simplify interface to SelectionDAG::getMemIntrinsicNode, making it take a MachinePointerInfo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114397 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 04:57:15 +00:00
Chris Lattner
60bddc8bcd chagne interface to SelectionDAG::getAtomic to take a MachinePointerInfo,
eliminating some weird "infer a frame address" logic which was dead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114396 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 04:53:42 +00:00
Chris Lattner
0531356e4d don't implicitly drop the offset of a machinememoperand when legalizing atomics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114395 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 04:51:11 +00:00
Chris Lattner
93a95ae8a9 force clients of MachineFunction::getMachineMemOperand to provide a
MachinePointerInfo, propagating the type out a level of API.  Remove
the old MachineFunction::getMachineMemOperand impl.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114393 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 04:46:39 +00:00
Chris Lattner
da39c39644 start pushing MachinePointerInfo out through the MachineMemOperand interface
to the MachineFunction construction methods.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114390 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 04:32:08 +00:00
Chris Lattner
e8e2e80f40 refactor the Value*/offset pair from MachineMemOperand out to a new
MachinePointerInfo struct, no functionality change.

This also adds an assert to MachineMemOperand::MachineMemOperand
that verifies that the Value* is either null or is an IR pointer type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114389 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 04:23:39 +00:00
Evan Cheng
44be1a8d66 Enable machine sinking critical edge splitting. e.g.
define double @foo(double %x, double %y, i1 %c) nounwind {
  %a = fdiv double %x, 3.2
  %z = select i1 %c, double %a, double %y
  ret double %z
}

Was:
_foo:
        divsd   LCPI0_0(%rip), %xmm0
        testb   $1, %dil
        jne     LBB0_2
        movaps  %xmm1, %xmm0
LBB0_2:
        ret

Now:
_foo:
        testb   $1, %dil
        je      LBB0_2
        divsd   LCPI0_0(%rip), %xmm0
        ret
LBB0_2:
        movaps  %xmm1, %xmm0
        ret

This avoids the divsd when early exit is taken.
rdar://8454886


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114372 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-20 22:52:00 +00:00
Owen Anderson
4a9f150926 When TCO is turned on, it is possible to end up with aliasing FrameIndex's. Therefore,
CombinerAA cannot assume that different FrameIndex's never alias, but can instead use
MachineFrameInfo to get the actual offsets of these slots and check for actual aliasing.

This fixes CodeGen/X86/2010-02-19-TailCallRetAddrBug.ll and CodeGen/X86/tailcallstack64.ll
when CombinerAA is enabled, modulo a different register allocation sequence.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114348 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-20 20:39:59 +00:00
Evan Cheng
7af6dc47a5 Avoid splitting critical edge twice for a set of PHI uses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114338 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-20 19:12:55 +00:00
Owen Anderson
0dcc814276 Revert r114312 while I sort out some issues.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114313 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-19 21:01:26 +00:00
Owen Anderson
d910fb2f12 Tentatively enabled DAGCombiner Alias Analysis by default. As far as I know,
r114268 fixed the last of the blockers to enabling it.  I will be monitoring
for failures.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114312 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-19 19:51:55 +00:00
Benjamin Kramer
9e8d1f97e9 Unbreak msvc build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114284 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-18 14:41:26 +00:00
Lang Hames
481630dee5 Fixed non-const iterator error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114273 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-18 09:49:08 +00:00
Lang Hames
eb6c8f53b4 Added a separate class (PBQPBuilder) for PBQP Problem construction. This class can be extended to support custom constraints.
For now the allocator still uses the old (internal) construction mechanism by default. This will be phased out soon assuming 
no issues with the builder system come up.

To invoke the new construction mechanism just pass '-regalloc=pbqp -pbqp-builder' to llc. To provide custom constraints a
Target just needs to extend PBQPBuilder and pass an instance of their derived builder to the RegAllocPBQP constructor.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114272 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-18 09:07:10 +00:00
Evan Cheng
2399786b27 Fix code that break critical edges for PHI uses. Watch out for multiple PHIs in different blocks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114270 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-18 06:42:17 +00:00
Owen Anderson
14ac1dd2be Invert the logic of reachesChainWithoutSideEffects(). What we want to check is that there is
NO path to the destination containing side effects, not that SOME path contains no side effects.
In  practice, this only manifests with CombinerAA enabled, because otherwise the chain has little
to no branching, so "any" is effectively equivalent to "all".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114268 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-18 04:45:14 +00:00
Evan Cheng
6edb0eac87 Teach machine sink to
1) Do forward copy propagation. This makes it easier to estimate the cost of the
   instruction being sunk.
2) Break critical edges on demand, including cases where the value is used by
   PHI nodes.
Critical edge splitting is not yet enabled by default.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114227 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-17 22:28:18 +00:00
Evan Cheng
c2b768f09e Machine CSE was forgetting to clear some data structures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114222 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-17 21:59:42 +00:00
Evan Cheng
f437f73348 Fix a potential bug that can cause miscomparison with and without debug info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114220 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-17 21:56:26 +00:00
Devang Patel
1905a18abc If FE forgot to provide a file name (usually it uses "stdin" as name in such situation) then make one up to ensure that debug info is not malformed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114119 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-16 20:57:49 +00:00
Jakob Stoklund Olesen
f6a129a24b Use the value mapping provided by LiveIntervalMap. This simplifies the code a
great deal because we don't have to worry about maintaining SSA form.

Unconditionally copy back to dupli when the register is live out of the split
range, even if the live-out value was defined outside the range. Skipping the
back-copy only makes sense when the live range is going to spill outside the
split range, and we don't know that it will. Besides, this was a hack to avoid
SSA update issues.

Clear up some confusion about the end point of a half-open LiveRange. Methinks
LiveRanges need to be closed so both start and end are included in the range.
The low bits of a SlotIndex are symbolic, so a half-open range doesn't really
make sense. This would be a pervasive change, though.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114043 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-16 00:01:36 +00:00
Devang Patel
27ede1ba6d Check bb to ensure that alloca is in separate basic block.
This fixes funcargs.exp regression reported by gdb testsuite.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113992 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-15 18:13:55 +00:00
Devang Patel
1397fdc0ab If dbg.declare from non-entry block is using alloca from entry block then use offset available in StaticAllocaMap to emit DBG_VALUE. Right now, this has no material impact because varible info also collected using offset table maintained in machine module info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113967 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-15 14:48:53 +00:00
Gabor Greif
4f7d107d1d must not peephole away side effects
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113848 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-14 20:46:08 +00:00
Devang Patel
6fe75aaaeb Use frame index, if available for byval argument while lowering dbg_declare. Otherwise let getRegForValue() find register for this argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113843 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-14 20:29:31 +00:00
Michael J. Spencer
3a210e2d30 Revert "CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally."
This reverts commit r113632

Conflicts:

	cmake/modules/AddLLVM.cmake

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113819 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-13 23:59:48 +00:00
Jakob Stoklund Olesen
dd9f3fdc77 Mechanically replace LiveInterval* with LiveIntervalMap for intervals being
edited without actually using LiveIntervalMap functionality.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113816 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-13 23:29:11 +00:00
Jakob Stoklund Olesen
9ca2aeb2d2 Allow LiveIntervalMap to be reused by resetting the current live interval.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113815 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-13 23:29:09 +00:00
Jakob Stoklund Olesen
b3e9681cc0 Let's just declare that it is impossible to construct a std::pair from a null
pointer and work around that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113788 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-13 21:29:45 +00:00
Benjamin Kramer
12ea765632 Fix linux/msvc build, move include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113776 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-13 20:04:49 +00:00
Eric Christopher
1a56e083e7 Silence more warnings. Two more unused variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113771 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-13 18:30:57 +00:00
John Thompson
eac6e1d0c7 Added skeleton for inline asm multiple alternative constraint support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113766 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-13 18:15:37 +00:00
Bill Wendling
a65568676d Rename ConvertToSetZeroFlag to something more general.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113670 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-11 00:13:50 +00:00
Bill Wendling
3665661a57 No need to recompute the SrcReg and CmpValue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113666 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-10 23:46:12 +00:00
Bill Wendling
92ad57f066 Move some of the decision logic for converting an instruction into one that sets
the 'zero' bit down into the back-end. There are other cases where this logic
isn't sufficient, so they should be handled separately.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113665 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-10 23:34:19 +00:00
Bob Wilson
59718a4f42 Fix a comment typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113653 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-10 22:42:21 +00:00
Bill Wendling
220e240bdf Modify the comparison optimizations in the peephole optimizer to update the
iterator when an optimization took place. This allows us to do more insane
things with the code than just remove an instruction or two.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113640 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-10 21:55:43 +00:00
Michael J. Spencer
4e9c939312 CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113632 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-10 21:14:25 +00:00
Devang Patel
4bafda9618 Add DEBUG message.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113614 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-10 20:32:09 +00:00
Evan Cheng
3ef1c8759a Teach if-converter to be more careful with predicating instructions that would
take multiple cycles to decode.
For the current if-converter clients (actually only ARM), the instructions that
are predicated on false are not nops. They would still take machine cycles to
decode. Micro-coded instructions such as LDM / STM can potentially take multiple
cycles to decode. If-converter should take treat them as non-micro-coded
simple instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113570 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-10 01:29:16 +00:00
Jakob Stoklund Olesen
4a4bc3fba6 Remove dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113386 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 18:50:24 +00:00
Jakob Stoklund Olesen
6b964cd211 Don't add <imp-def> operands during register rewriting.
LiveIntervals already adds <imp-def> operands for super-registers when a subreg
def defines the whole register. Thus, it is not necessary to do it again when
rewriting.

In fact, the super-register imp-defs caused miscompilations because the late
scheduler couldn't see that the super-register was read.

We still add super-reg <imp-use,kill> operands when rewriting virtuals to
physicals.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113299 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-07 22:38:45 +00:00
Chris Lattner
dfe254b86e add a comment about where this should eventually move.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113117 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-05 20:33:40 +00:00
Lang Hames
b76d20969f Added initialisers for reduction rule counters.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113108 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-05 13:42:32 +00:00
Chris Lattner
beac75da37 implement rdar://6653118 - fastisel should fold loads where possible.
Since mem2reg isn't run at -O0, we get a ton of reloads from the stack,
for example, before, this code:

int foo(int x, int y, int z) {
  return x+y+z;
}

used to compile into:

_foo:                                   ## @foo
	subq	$12, %rsp
	movl	%edi, 8(%rsp)
	movl	%esi, 4(%rsp)
	movl	%edx, (%rsp)
	movl	8(%rsp), %edx
	movl	4(%rsp), %esi
	addl	%edx, %esi
	movl	(%rsp), %edx
	addl	%esi, %edx
	movl	%edx, %eax
	addq	$12, %rsp
	ret

Now we produce:

_foo:                                   ## @foo
	subq	$12, %rsp
	movl	%edi, 8(%rsp)
	movl	%esi, 4(%rsp)
	movl	%edx, (%rsp)
	movl	8(%rsp), %edx
	addl	4(%rsp), %edx    ## Folded load
	addl	(%rsp), %edx     ## Folded load
	movl	%edx, %eax
	addq	$12, %rsp
	ret

Fewer instructions and less register use = faster compiles.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113102 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-05 02:18:34 +00:00
Jakob Stoklund Olesen
07c2b7ff68 Remove dead code.
Clobber ranges are no longer used when joining physical registers.
Instead, all aliases are checked for interference.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113084 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-04 21:09:33 +00:00
Chris Lattner
17aa68055b zap dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113073 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-04 18:12:00 +00:00
Jim Grosbach
ee72651df4 previous patch was a little too tricky for its own good. Don't try to
overload UserInInstr. Explicitly check Allocatable. The early exit in the
condition will mean the performance impact of the extra test should be
minimal.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113016 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 21:45:15 +00:00
Bob Wilson
ef134d02e0 Add a missing check when legalizing a vector extending load. This doesn't
solve the root problem, but it corrects the bug in the code I added to
support legalizing in the case where the non-extended type is also legal.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112997 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 19:20:37 +00:00
Jakob Stoklund Olesen
1e3aeefc08 VirtRegRewriter checks for early clobbers before it reuses an available stack
slot.

Teach it to also check for early clobbered aliases, and early clobber operands
following the current operand.

This fixes the miscompilation in PR8044 where EC registers eax and ecx were
being used for inputs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112988 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 18:36:56 +00:00
Duncan Sands
850fcd4705 Reapply commit 112702 which was speculatively reverted by echristo.
Original commit message:
Use the SSAUpdator to turn calls to eh.exception that are not in a
landing pad into uses of registers rather than loads from a stack
slot.  Doesn't touch the 'orrible hack code - Bill needs to persuade
me harder :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112952 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03 08:31:48 +00:00
Devang Patel
a660be7587 There is no need to use .set here.
Thanks Chris!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112900 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 23:01:10 +00:00
Devang Patel
3f74a116c8 Detect undef value early and save unnecessary NodeMap query.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112864 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 21:29:42 +00:00
Dan Gohman
24bde5bce1 Don't narrow the load and store in a load+twiddle+store sequence unless
there are clearly no stores between the load and the store. This fixes
this miscompile reported as PR7833.

This breaks the test/CodeGen/X86/narrow_op-2.ll optimization, which is
safe, but awkward to prove safe. Move it to X86's README.txt.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112861 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 21:18:42 +00:00
Devang Patel
8e741ed2fa Tidy up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112858 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 21:02:27 +00:00
Jim Grosbach
9204ddad5c The scavenger should just use getAllocatableSet() rather than reinventing it
locally.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112845 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 18:29:04 +00:00
Jim Grosbach
9b041c92ef Anti-dependency breaking needs to be careful not to use reserved regs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112832 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 17:12:55 +00:00
Devang Patel
b1fcfbe89b Fix .debug_range for linux. Patch by Krister Wombell.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112830 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 16:43:44 +00:00
Lang Hames
33198391d6 Added support for register allocators to record which intervals are spill intervals, and where the uses and defs of the original intervals were in the original code.
Spill intervals can be hidden using the "-rmf-intervals=virt-nospills*" option.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112811 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 08:27:00 +00:00
Chandler Carruth
4315093eb7 Silence an ambiguous else warning from GCC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112809 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 07:08:05 +00:00
Lang Hames
7642572e6d Added counters for PBQP reduction rules.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112807 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 05:37:52 +00:00
Jim Grosbach
d273a003b6 Add a bit of debug output for register scavenging
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112787 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 00:51:37 +00:00
Jim Grosbach
188da252ab Tweak to ignoring reserved regs. The allocator was occasionally still looking
at them since they'd end up in the register weights list. Tell it to stop
doing that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112756 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 22:48:34 +00:00
Jakob Stoklund Olesen
0077114efc Teach RemoveCopyByCommutingDef to check all aliases, not just subregisters.
This caused a miscompilation in WebKit where %RAX had conflicting defs when
RemoveCopyByCommutingDef was commuting a %EAX use.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112751 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 22:15:35 +00:00
Jim Grosbach
662fb77687 tidy up trailing whitespace and an 80 column violation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112746 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 21:48:06 +00:00
Jim Grosbach
5a4cbea312 cleanup per feedback. use a helper function for getting the first non-reserved
physical register in a register class. Make sure to assert if the register
class is empty.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112743 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 21:34:41 +00:00
Jim Grosbach
269354e570 The register allocator shouldn't consider allocating reserved registers. PBQP version.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112742 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 21:23:03 +00:00
Jim Grosbach
067a648599 The register allocator shouldn't consider allocating reserved registers.
r112728 did this for fast regalloc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112741 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 21:04:27 +00:00
Jim Grosbach
1f758831cb The register allocator shouldn't consider allocating reserved registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112728 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 19:28:41 +00:00
Jim Grosbach
07cb689d62 tidy up a few 80-column and trailing whitespace bits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112726 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 19:16:29 +00:00