Commit Graph

43757 Commits

Author SHA1 Message Date
Chris Lattner
d2fa781169 Implement the first half of PR3290: if there is a store of an
integer to a (transitive) bitcast the alloca and if that integer
has the full size of the alloca, then it clobbers the whole thing.
Handle this by extracting pieces out of the stored integer and 
filing them away in the SROA'd elements.

This triggers fairly frequently because the CFE uses integers to
pass small structs by value and the inliner exposes these.  For 
example, in kimwitu++, I see a bunch of these with i64 stores to
"%struct.std::pair<std::_Rb_tree_const_iterator<kc::impl_abstract_phylum*>,bool>"

In 176.gcc I see a few i32 stores to "%struct..0anon".

In the testcase, this is a difference between compiling test1 to:

_test1:
	subl	$12, %esp
	movl	20(%esp), %eax
	movl	%eax, 4(%esp)
	movl	16(%esp), %eax
	movl	%eax, (%esp)
	movl	(%esp), %eax
	addl	4(%esp), %eax
	addl	$12, %esp
	ret

vs:

_test1:
	movl	8(%esp), %eax
	addl	4(%esp), %eax
	ret

The second half of this will be to handle loads of the same form.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61853 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-07 08:11:13 +00:00
Chris Lattner
d93afec1db Factor a bunch of code out into a helper method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61852 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-07 07:18:45 +00:00
Chris Lattner
cf32186409 use continue to simplify code and reduce nesting, no functionality
change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61851 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-07 06:39:58 +00:00
Chris Lattner
56c3852fb4 Get TargetData once up front and cache as an ivar instead of
requerying it all over the place.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61850 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-07 06:34:28 +00:00
Chris Lattner
d356a7ee0e Use the hasAllZeroIndices predicate to simplify some
code, no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61849 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-07 06:25:07 +00:00
Evan Cheng
8f90b6eb2f The coalescer does not coalesce a virtual register to a physical register if any of the physical register's sub-register live intervals overlaps with the virtual register. This is overly conservative. It prevents a extract_subreg from being coalesced away:
v1024 = EDI  // not killed
      =
      = EDI

One possible solution is for the coalescer to examine the sub-register live intervals in the same manner as the physical register. Another possibility is to examine defs and uses (when needed) of sub-registers. Both solutions are too expensive. For now, look for "short virtual intervals" and scan instructions to look for conflict instead.

This is a small win on x86-64. e.g. It shaves 403.gcc by ~80 instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61847 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-07 02:08:57 +00:00
Chris Lattner
d37eaa3b97 add a testcase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61845 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-07 01:48:08 +00:00
Dan Gohman
fbb7486560 Add patterns to match conditional moves with loads folded
into their left operand, rather than their right. Do this
by commuting the operands and inverting the condition.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61842 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-07 01:00:24 +00:00
Dan Gohman
b33fc7b063 Add load-folding table entries for cmovno too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61841 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-07 00:44:53 +00:00
Dan Gohman
305fceb56c Define instructions for cmovo and cmovno.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61836 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-07 00:35:10 +00:00
Dan Gohman
653456c351 X86_COND_C and X86_COND_NC are alternate mnemonics for
X86_COND_B and X86_COND_AE, respectively.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61835 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-07 00:15:08 +00:00
Bob Wilson
bc03979536 Improve support for type-generic vector intrinsics by teaching TableGen how
to handle LLVMMatchType intrinsic parameters, and by adding new subclasses
of LLVMMatchType to match vector types with integral elements that are 
either twice as wide or half as wide as the elements of the matched type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61834 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-07 00:09:01 +00:00
Dan Gohman
0a79a2f8b0 Now that fold-pcmpeqd-0.ll is effectively testing that scheduling helps
avoid the need for spilling, add a new testcase that tests that the
pcmpeqd used for V_SETALLONES is changed to a constant-pool load as
needed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61831 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-06 23:48:10 +00:00
Dan Gohman
cca2983291 Revert r42653 and forward-port the code that lets INC64_32r be
converted to LEA64_32r in x86's convertToThreeAddress. This
replaces code like this:
   movl  %esi, %edi
   inc   %edi
with this:
   lea   1(%rsi), %edi
which appears to be beneficial.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61830 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-06 23:34:46 +00:00
Scott Michel
21213e75b5 CellSPU:
- Add preliminary support for v2i32; load/store generates the right code but
  there's a lot work to be done to make this vector type operational.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61829 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-06 23:10:38 +00:00
Dan Gohman
2c91d102ec Fix a bug in ComputeLinearIndex computation handling multi-level
aggregate types. Don't increment the current index after reaching
the end of a struct, as it will already be pointing at
one-past-the end. This fixes PR3288.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61828 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-06 22:53:52 +00:00
Devang Patel
5d31598954 Set up DwarfDebug using DebugInfo API.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61822 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-06 21:07:30 +00:00
Bill Wendling
5fe1fac1dd Forgot that this was needed for Linux. This should fix the builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61819 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-06 19:13:55 +00:00
Owen Anderson
200ee7f521 The phi construction algorithm used for interval reconstruction is complicated by
two address instructions.  We need to keep track of things we've processed AS USES
independetly of whether we've processed them as defs.

This fixes all known miscompilations when reconstruction is turned on.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61802 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-06 07:53:32 +00:00
Scott Michel
939e3a7f64 CellSPU: Update the README
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61785 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-06 03:51:14 +00:00
Scott Michel
dd950096b9 CellSPU:
- Fix bugs 3194, 3195: i128 load/stores produce correct code (although, we
  need to ensure that i128 is 16-byte aligned in real life), and 128 zero-
  extends are supported.
- New td file: SPU128InstrInfo.td: this is where all new i128 support should
  be put in the future.
- Continue to hammer on i64 operations and test cases; ensure that the only
  remaining problem will be i64 mul.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61784 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-06 03:36:14 +00:00
Dan Gohman
5ddefdaa34 Delete this test; it's a duplicate of 2006-07-03-schedulers.ll.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61781 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-06 01:36:23 +00:00
Dan Gohman
ce0d4b7a77 Update these argument lists for the isNormalMemory
argument. This doesn't affect current functionality.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61779 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-06 01:28:56 +00:00
Dan Gohman
fd2163bcf7 Use a latency value of 0 for the artificial edges inserted by
AddPseudoTwoAddrDeps. This lets the scheduling infrastructure
avoid recalculating node heights. In very large testcases this
was a major bottleneck. Thanks to Roman Levenstein for finding
this!

As a side effect, fold-pcmpeqd-0.ll is now scheduled better
and it no longer requires spilling on x86-32.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61778 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-06 01:19:04 +00:00
Chris Lattner
b9f08a00af no need to negate the APInt for 0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61777 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-06 00:06:25 +00:00
Chris Lattner
159c35b3ee Change m_ConstantInt and m_SelectCst to take their constant integers
as template arguments instead of as instance variables, exposing more
optimization opportunities to the compiler earlier.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61776 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 23:53:12 +00:00
Chris Lattner
06ebbcc71d make m_ConstantInt(int64_t) safely match ConstantInt's that are larger than i64.
This fixes an instcombine crash on PR3235.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61775 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 23:45:50 +00:00
Devang Patel
78eb6ad633 Construct subprogram DIEs using DebugInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61772 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 23:21:35 +00:00
Devang Patel
c452324f60 Construct global variable DIEs using DebugInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61771 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 23:11:11 +00:00
Devang Patel
d1ca925093 Construct compile unit dies using DebugInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61768 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 23:03:32 +00:00
Dan Gohman
de0e7f2481 Fix a thinko in the grammar for thread_local variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61767 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 23:03:03 +00:00
Bill Wendling
d60de51878 Revert r61415 and r61484. Duncan was correct that these weren't needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61765 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 22:53:45 +00:00
Dan Gohman
a80c859df3 Don't call setDepthDirty/setHeightDirty when adding an edge
with latency 0, since it doesn't affect the depth or height.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61762 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 22:40:26 +00:00
Devang Patel
8526cc03a5 Extract source location info from DebugInfo.
Add methods to add source location info in a DIE.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61761 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 22:35:52 +00:00
Devang Patel
48d190f4d7 Add type DIEs using DebugInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61757 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 21:47:57 +00:00
Duncan Sands
676b9dfe2f Add a note about passing MVT::Other to getSetCCResultType.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61756 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 21:33:06 +00:00
Bill Wendling
e6a1fe5607 Strength test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61755 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 21:27:59 +00:00
Duncan Sands
27a53009ef Teach the internalize pass to also internalize
global aliases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61754 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 21:24:45 +00:00
Duncan Sands
91c9c31033 When checking if an Argument escapes, check if
the argument is marked nocapture - no need to
analyze the argument if the answer is already
known!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61753 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 21:19:53 +00:00
Evan Cheng
7e66c0d43a Find loop back edges only after empty blocks are eliminated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61752 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 21:17:27 +00:00
Chris Lattner
c6c22e2542 testcase for bill's patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61751 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 21:07:34 +00:00
Duncan Sands
de77ebcbb9 Not having an aliasee is a theoretical possibility.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61745 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 20:47:56 +00:00
Duncan Sands
15b5750664 Format more neatly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61744 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 20:39:50 +00:00
Duncan Sands
2631ac3b5b Remove trailing spaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61743 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 20:38:27 +00:00
Duncan Sands
1da5f2dd2e Delete unused global aliases with internal linkage.
In fact this also deletes those with linkonce linkage,
however this is currently dead because for the moment
aliases aren't allowed to have this linkage type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61742 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 20:37:33 +00:00
Devang Patel
f421533661 Construct composite type DIE using DebugInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61741 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 19:55:51 +00:00
Devang Patel
a22d57d6f8 Add classof() methods so that dwarf writer can decide what DIDescriptor is in its hand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61740 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 19:55:07 +00:00
Dan Gohman
50b84f44e4 Add <climits>, to get the definition of CHAR_BIT. This should fix
build errors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61736 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 19:47:30 +00:00
Dan Gohman
11df7e5157 TargetLowering.h #includes SelectionDAGNodes.h, so it doesn't need its
own OpActionsCapacity magic number; it can just use ISD::BUILTIN_OP_END,
as long as it takes care to round up when needed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61733 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 19:40:39 +00:00
Dan Gohman
1eb49a0a5e Delete an unused variable and simplify the code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61732 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 19:31:28 +00:00