Commit Graph

10517 Commits

Author SHA1 Message Date
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
Owen Anderson
02dd53e1c5 Now that PassInfo and Pass::ID have been separated, move the rest of the passes over to the new registration API.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111815 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 17:52:01 +00:00
Chandler Carruth
54f6163042 Fix some GCC warnings by providing a virtual destructor in the base of a class
hierarchy with virtual methods and using llvm_unreachable to properly indicate
unreachable states which would otherwise leave variables uninitialized.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111803 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 08:25:07 +00:00
Eli Friedman
24a1182184 Delete dead comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111744 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-21 20:19:51 +00:00
Bill Wendling
55ae515f9d Create the new linker type "linker_private_weak_def_auto".
It's similar to "linker_private_weak", but it's known that the address of the
object is not taken. For instance, functions that had an inline definition, but
the compiler decided not to inline it. Note, unlike linker_private and
linker_private_weak, linker_private_weak_def_auto may have only default
visibility.  The symbols are removed by the linker from the final linked image
(executable or dynamic library).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111684 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 22:05:50 +00:00
Jim Grosbach
4c207c2ddb Downwards growing stack allocation order reverses relative offsets
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111673 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 20:25:31 +00:00
Jim Grosbach
ab6bdec837 Add more dbg output
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111670 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 19:04:43 +00:00
Jim Grosbach
2d16f5b0cb properly check for whether base regs were inserted
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111646 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 16:48:30 +00:00
Bob Wilson
63241f79e6 If the target says that an extending load is not legal, regardless of whether
it involves specific floating-point types, legalize should expand an
extending load to a non-extending load followed by a separate extend operation.
For example, we currently expand SEXTLOAD to EXTLOAD+SIGN_EXTEND_INREG (and
assert that EXTLOAD should always be supported).  Now we can expand that to
LOAD+SIGN_EXTEND.  This is needed to allow vector SIGN_EXTEND and ZERO_EXTEND
to be used for NEON.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111586 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-19 23:52:39 +00:00
Jim Grosbach
e2f556933e Better handling of offsets on frame index references. rdar://8277890
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111585 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-19 23:52:25 +00:00
Evan Cheng
f942c13af8 Update debug logs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111575 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-19 23:33:02 +00:00
Evan Cheng
19708923be Properly update MachineDominators when splitting critical edge.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111574 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-19 23:32:47 +00:00
Bill Wendling
5567bb0c5f Correct header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111540 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-19 18:52:17 +00:00
Evan Cheng
e5e7946018 It's possible to sink a def if its local uses are PHI's.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111537 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-19 18:33:29 +00:00
Michael J. Spencer
6715be20e2 Fix the msvc 2010 build.
The Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01
implements parts of C++0x based on the draft standard. An old version of
the draft had a bug that makes std::pair<T1*, T2*>(something, 0) fail to
compile. This is because the template<class U, class V> pair(U&& x, V&& y)
constructor is selected, even though it later fails to implicitly convert
U and V to frist_type and second_type.

This has been fixed in n3090, but it seems that Microsoft is not going to
update msvc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111535 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-19 18:16:39 +00:00
Evan Cheng
c546c75459 Remove disabled assertion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111531 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-19 17:33:48 +00:00
Evan Cheng
4dc301a7c5 Teach machine-sink to break critical edges when appropriate. Work in progress.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111530 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-19 17:33:11 +00:00
Jim Grosbach
a0fc005321 Update local stack block allocation to let PEI do the allocs if no additional
base registers were required. This will allow for slightly better packing
of the locals when alignment padding is necessary after callee saved registers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111508 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-19 02:47:08 +00:00
Jim Grosbach
cd799ce8f8 Add a newline to debug output
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111453 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-18 23:14:02 +00:00
Evan Cheng
c3439ad63f If any def of a machine-sink candidate has local uses, it's obviously not safe to sink it to a successor block. This bug has been hidden because a later check for critical-edge disable these illegal optimizations. This patch should significantly reduce the amount of time spent on checking dominator information for obviously unsafe sinking.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111450 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-18 23:09:25 +00:00
Jim Grosbach
2b1e202e1c Enable ARM base register reuse to local stack slot allocation. Whenever a new
frame index reference to an object in the local block is seen, check if
it's near enough to any previously allocaated base register to re-use.

rdar://8277890



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111443 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-18 22:44:49 +00:00
Jakob Stoklund Olesen
ff3ae8691c Thinking about it, we don't need MachineDominatorTree after all. The DomValue
map discovers the iterated dominance frontier for free.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111400 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-18 20:29:53 +00:00
Jakob Stoklund Olesen
cf16bea74e Revert r111394. It was too aggressive.
We must complete the DFS, otherwise we might miss needed phi-defs, and
prematurely color live ranges with a non-dominating value.

This is not a big deal since we get to color more of the CFG and the next
mapValue call will be faster.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111397 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-18 20:06:05 +00:00
Jakob Stoklund Olesen
4d440bd786 Aggressively prune the DFS when inserting phi-defs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111394 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-18 19:00:11 +00:00
Jakob Stoklund Olesen
1407c84242 Add the LiveIntervalMap class. Don't hook it up yet.
LiveIntervalMap maps values from a parent LiveInterval to a child interval that
is a strict subset. It will create phi-def values as needed to preserve the
VNInfo SSA form in the child interval.

This leads to an algorithm very similar to the one in SSAUpdaterImpl.h, but with
enough differences that the code can't be reused:

- We don't need to manipulate PHI instructions.
- LiveIntervals have kills.
- We have MachineDominatorTree.
- We can use df_iterator.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111393 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-18 19:00:08 +00:00
Bill Wendling
3d7ff08c82 Improve whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111384 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-18 18:41:13 +00:00
Jim Grosbach
74d803a58c Add hook for re-using virtual base registers for local stack slot access.
Nothing fancy, just ask the target if any currently available base reg
is in range for the instruction under consideration and use the first one
that is. Placeholder ARM implementation simply returns false for now.

ongoing saga of rdar://8277890



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111374 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-18 17:57:37 +00:00
Jakob Stoklund Olesen
9ac248848f Preserve subregs on PHI source operands. Patch by Krister Wombell!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111366 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-18 16:09:47 +00:00
Jim Grosbach
dc140c6e7b Add materialization of virtual base registers for frame indices allocated into
the local block. Resolve references to those indices to a new base register.
For simplification and testing purposes, a new virtual base register is
allocated for each frame index being resolved. The result is truly horrible,
but correct, code that's good for exercising the new code paths.

Next up is adding thumb1 support, which should be very simple. Following that
will be adding base register re-use and implementing a reasonable ARM
heuristic for when a virtual base register should be generated at all.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111315 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-17 22:41:55 +00:00
Dale Johannesen
6cf64a631a Make fast scheduler handle asm clobbers correctly.
PR 7882.  Follows suggestion by Amaury Pouly, thanks.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111306 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-17 22:17:24 +00:00
Evan Cheng
148341cc9b PHI elimination shouldn't require machineloopinfo since it's used at -O0. Move the requirement to LiveIntervalAnalysis instead. Note this does not change the number of times machineloopinfo is computed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111285 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-17 21:00:37 +00:00
Evan Cheng
6542416560 Machine CSE preserves CFG. Pass manager was freeing machineloopinfo after machine cse before.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111281 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-17 20:57:42 +00:00
Jim Grosbach
8ae231a06c silence warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111274 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-17 20:21:30 +00:00