Commit Graph

10549 Commits

Author SHA1 Message Date
Duncan Sands
fb4e8ab200 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@112702 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 14:07:47 +00:00
Devang Patel
ae84d5b9ba Use absolute label for DW_AT_stmt_list if a target does not prefer offset here.
This patch was developed on top of original patch by Artur Pietrek.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112678 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 23:50:19 +00:00
Devang Patel
0b48eade42 Reapply r112623. Included additional check for unused byval argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112659 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 22:22:42 +00:00
Jakob Stoklund Olesen
f14a648d80 Track liveness of unallocatable, unreserved registers in machine DCE.
Reserved registers are unpredictable, and are treated as always live by machine
DCE.

Allocatable registers are never reserved, and can be used for virtual registers.

Unreserved, unallocatable registers can not be used for virtual registers, but
otherwise behave like a normal allocatable register. Most targets only have
the flag register in this set.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112649 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 21:51:05 +00:00
Jakob Stoklund Olesen
9d4b51b696 Ignore unallocatable registers in RegAllocFast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112632 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 19:54:25 +00:00
Devang Patel
81b79b5fa8 Revert r112623. It is causing self host build failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112631 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 19:41:03 +00:00
Devang Patel
8480c2e314 Remember byval argument's frame index during argument lowering and use this info to emit debug info.
Fixes Radar 8367011.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112623 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 18:50:09 +00:00
Jim Grosbach
864d22ea72 Improve virtual frame base register allocation heuristics.
1. Allocate them in the entry block of the function to enable function-wide
     re-use. The instructions to create them should be re-materializable, so
     there shouldn't be additional cost compared to creating them local
     to the basic blocks where they are used.
  2. Collect all of the frame index references for the function and sort them
     by the local offset referenced. Iterate over the sorted list to
     allocate the virtual base registers. This enables creation of base
     registers optimized for positive-offset access of frame references.
     (Note: This may be appropriate to later be a target hook to do the
     sorting in a target appropriate manner. For now it's done here for
     simplicity.)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112609 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 17:58:19 +00:00
Duncan Sands
22efc18f12 Stop using the dom frontier in DwarfEHPrepare by not promoting alloca's
any more.  I plan to reimplement alloca promotion using SSAUpdater later.
It looks like Bill's URoR logic really always needs domtree, so the pass
now always asks for domtree info.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112597 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 09:05:06 +00:00
Devang Patel
34ca5ed797 Offset is not always unsigned number.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112584 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 06:12:08 +00:00
Devang Patel
9e3bd2c476 Simplify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112583 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 06:11:28 +00:00
Bruno Cardoso Lopes
2e46e78c53 zap unused method. x86 is the only user and already has a more powerfull version
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112571 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 02:36:20 +00:00
Jakob Stoklund Olesen
e49e6a852b Add experimental -disable-physical-join command line option.
Eventually, we want to disable physreg coalescing completely, and let the
register allocator do its job using hints.

This option makes it possible to measure the impact of disabling physreg
coalescing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112567 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 01:27:49 +00:00
Chris Lattner
1875ce4ad9 two changes:
1) nuke ConstDataCoalSection, which is dead.
2) revise my previous patch for rdar://8018335,
  which was completely wrong.  Specifically, it doesn't 
  make sense to mark __TEXT,__const_coal as PURE_INSTRUCTIONS,
  because it is for readonly data.  templates (it turns out)
  go to const_coal_nt.  The real fix for rdar://8018335 was
  to give ConstTextCoalSection a section kind of ReadOnly 
  instead of Text.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112496 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-30 18:12:35 +00:00
Bill Wendling
c040719a15 Revert r112461. It was failing on PPC...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112463 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-30 04:36:50 +00:00
Bill Wendling
25b141912c When adding a register, we should mark it as "def" if it can optionally define
said (physical) register.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112461 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-30 01:36:05 +00:00
Chris Lattner
a11ce95cfc revert 112457, it looks like it broke selfhost.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112459 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-29 22:28:18 +00:00
Chris Lattner
4455608818 rewrite DwarfEHPrepare to use SSAUpdater to promote its allocas
instead of PromoteMemToReg.  This allows it to stop using DF and DT,
eliminating a computation of DT and DF from clang -O3.  Clang is now
down to 2 runs of DomFrontier.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112457 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-29 19:54:28 +00:00
Chris Lattner
c34c2200a8 inline function into its only caller.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112455 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-29 19:28:28 +00:00
Chris Lattner
61c70e98ac remove unions from LLVM IR. They are severely buggy and not
being actively maintained, improved, or extended.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112356 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-28 04:09:24 +00:00
Chris Lattner
5f8a87dd76 remove dead proto
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112354 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-28 03:45:03 +00:00
Dan Gohman
badcda4afa Completely disable tail calls when fast-isel is enabled, as fast-isel
doesn't currently support dealing with this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112341 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-28 00:51:03 +00:00
Dan Gohman
7258df71fa Trim a #include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112340 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-28 00:49:13 +00:00
Devang Patel
0991dfbbe0 Simplify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112305 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-27 22:25:51 +00:00
Bill Wendling
69c5eb59f5 Remove now unneeded command line flag that enables 'optimize compares.'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112287 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-27 20:39:09 +00:00
Devang Patel
4cf81c47fe Revert r112213. It is not needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112242 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26 23:35:15 +00:00
Jim Grosbach
fcb4a8ead3 Simplify eliminateFrameIndex() interface back down now that PEI doesn't need
to try to re-use scavenged frame index reference registers. rdar://8277890

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112241 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26 23:32:16 +00:00
Devang Patel
6cd467bd0e If node is not available then use FuncInfo.ValueMap to emit debug info for byval parameter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112238 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26 22:53:27 +00:00
Jim Grosbach
700f5df518 Remove the now obsolete frame index virtual re-use algorithm from PEI. Pre-RA
virtual base registers handle this function, and more. A bit more cleanup
to do on the interface to eliminateFrameIndex() after this.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112237 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26 22:42:12 +00:00
Devang Patel
e130d78ee1 Speculatively revert r112207.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112216 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26 20:33:42 +00:00
Devang Patel
8f09beacb1 80 col.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112215 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26 20:32:32 +00:00
Devang Patel
f2ec7ae279 Update DanglingDebugInfo so that it can be used to track llvm.dbg.declare also.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112213 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26 20:06:46 +00:00
Devang Patel
9d0796a0e0 Donot forget to resolve dangling debug info in a case where virtual register, used for a value, is initialized after a dbg intrinsic is seen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112207 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26 18:36:14 +00:00
Chris Lattner
341fa09a3c Add a hackaround for PR7993 which is causing failures on x86 builders that lack sse2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112175 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26 06:57:07 +00:00
Chris Lattner
8306968c14 implement SplitVecOp_CONCAT_VECTORS, fixing the included testcase with SSE1.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112171 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26 05:51:22 +00:00
Chris Lattner
6dabd9dba0 zap dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112155 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-26 02:57:35 +00:00
Chris Lattner
aafe626c7f remove some llvmcontext arguments that are now dead post-refactoring.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112104 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-25 23:00:45 +00:00
Chris Lattner
e6f7c267df Change handling of illegal vector types to widen when possible instead of
expanding: e.g. <2 x float> -> <4 x float> instead of -> 2 floats.  This
affects two places in the code: handling cross block values and handling
function return and arguments.  Since vectors are already widened by 
legalizetypes, this gives us much better code and unblocks x86-64 abi
and SPU abi work.

For example, this (which is a silly example of a cross-block value):
define <4 x float> @test2(<4 x float> %A) nounwind {
 %B = shufflevector <4 x float> %A, <4 x float> undef, <2 x i32> <i32 0, i32 1>
 %C = fadd <2 x float> %B, %B
  br label %BB
BB:
 %D = fadd <2 x float> %C, %C
 %E = shufflevector <2 x float> %D, <2 x float> undef, <4 x i32> <i32 0, i32 1, i32 undef, i32 undef>
 ret <4 x float> %E
}

Now compiles into:

_test2:                                 ## @test2
## BB#0:
 addps %xmm0, %xmm0
 addps %xmm0, %xmm0
 ret

previously it compiled into:

_test2:                                 ## @test2
## BB#0:
 addps %xmm0, %xmm0
 pshufd $1, %xmm0, %xmm1
                                        ## kill: XMM0<def> XMM0<kill> XMM0<def>
 insertps $0, %xmm0, %xmm0
 insertps $16, %xmm1, %xmm0
 addps %xmm0, %xmm0
 ret

This implements rdar://8230384



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112101 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-25 22:49:25 +00:00
Devang Patel
ab43add695 Fix comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112086 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-25 20:41:24 +00:00
Devang Patel
78a06e50b7 Remove dead argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112085 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-25 20:39:26 +00:00
Jim Grosbach
c52b3cced8 Add some statistics for PEI register scavenging
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112084 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-25 20:34:28 +00:00
Chris Lattner
3ac1884509 split the vector case of getCopyFromParts out to its own function,
no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111994 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-24 23:20:40 +00:00
Chris Lattner
a13b860f4d split the vector case out of getCopyToParts into its own function. No
functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111990 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-24 23:10:06 +00:00
Chris Lattner
549fa267ef tidy up, reduce indentation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111982 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-24 22:43:11 +00:00
Jim Grosbach
3197380143 Add ARM heuristic for when to allocate a virtual base register for stack
access. rdar://8277890&7352504

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111968 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-24 21:19:33 +00:00
Jim Grosbach
a273442891 Move enabling the local stack allocation pass into the target where it belongs.
For now it's still a command line option, but the interface to the generic
code doesn't need to know that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111942 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-24 19:05:43 +00:00
Devang Patel
af608bd4fe Revert r107202. It is not adding any value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111870 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-24 00:06:12 +00:00
Jim Grosbach
5e2475598e Remove the MFI storage of the local allocation block size. It's not needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111847 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 21:29:29 +00:00
Jim Grosbach
67ff81a083 Better handling of local offsets for downwards growing stacks. This corrects
relative offsets when there are offsets encoded in the instructions and
simplifies final allocation in PEI. rdar://8277890

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111836 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 20:40:38 +00:00
Devang Patel
0c4720c6bd Handle qualified constants that are directly folded by FE.
PR 7920.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111820 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 18:25:56 +00:00