Commit Graph

19820 Commits

Author SHA1 Message Date
Chris Lattner
6c81213b4c use continue to avoid nesting, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40819 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-04 20:07:06 +00:00
Chris Lattner
fb312c7e44 Promoting allocas with the 'single store' fastpath is
faster than with the 'local to a block' fastpath.  This speeds
up PR1432 from 2.1232 to 2.0686s (2.6%)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40818 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-04 20:03:23 +00:00
Chris Lattner
7a5745b38c When PromoteLocallyUsedAllocas promoted allocas, it didn't remember
to increment NumLocalPromoted, and didn't actually delete the
dead alloca, leading to an extra iteration of mem2reg.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40817 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-04 20:01:43 +00:00
Chris Lattner
59a2837715 std::map -> DenseMap
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40816 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-04 19:52:20 +00:00
Nick Lewycky
7956dae870 Clean up comments, fix up some confusing code logic.
Predsimplify fails llvm-gcc bootstrap.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40815 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-04 18:45:32 +00:00
Chris Lattner
c69e491575 fix a logic bug where we wouldn't promote single store allocas if the
stored value was a non-instruction value.  Doh.

This increase the # single store allocas from 8982 to 9026, and
speeds up mem2reg on the testcase in PR1432 from 2.17 to 2.13s.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40813 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-04 02:45:02 +00:00
Chris Lattner
4f63e76cda When we do the single-store optimization, delete both the store
and the alloca so they don't get reprocessed.

This speeds up PR1432 from 2.20s to 2.17s.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40812 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-04 02:38:38 +00:00
Chris Lattner
d0458e5d4f Three improvements:
1. Check for revisiting a block before checking domination, which is faster.
  2. If the stored value isn't an instruction, we don't have to check for domination.
  3. If we have a value used in the same block more than once, make sure to remove the
     block from the UsingBlocks vector.  Not doing so forces us to go through the slow
     path for the alloca.

The combination of these improvements increases the number of allocas on the fastpath
from 8935 to 8982 on PR1432.  This speeds it up from 2.90s to 2.20s (31%)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40811 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-04 02:32:22 +00:00
Chris Lattner
c3f6ea8330 switch from using a std::set to using a SmallPtrSet. This speeds up the
testcase in PR1432 from 6.33s to 2.90s (2.22x)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40810 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-04 02:21:22 +00:00
Chris Lattner
b776a335b1 In mem2reg, when handling the single-store case, make sure to remove
a using block from the list if we handle it.  Not doing this caused us
to not be able to promote (with the fast path) allocas which have uses (whoops).

This increases the # allocas hitting this fastpath from 4042 to 8935 on the
testcase in PR1432, speeding up mem2reg by 2.6x



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40809 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-04 02:15:24 +00:00
Chandler Carruth
022021951b Regenerating.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40808 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-04 01:56:21 +00:00
Chandler Carruth
6994040a95 This is the patch to provide clean intrinsic function overloading support in LLVM. It cleans up the intrinsic definitions and generally smooths the process for more complicated intrinsic writing. It will be used by the upcoming atomic intrinsics as well as vector and float intrinsics in the future.
This also changes the syntax for llvm.bswap, llvm.part.set, llvm.part.select, and llvm.ct* intrinsics. They are automatically upgraded by both the LLVM ASM reader and the bitcode reader. The test cases have been updated, with special tests added to ensure the automatic upgrading is supported.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40807 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-04 01:51:18 +00:00
Chris Lattner
5dd75b4ca7 split rewriting of single-store allocas into its own
method.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40806 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-04 01:47:41 +00:00
Chris Lattner
bbe104002f refactor some code to shrink PromoteMem2Reg::run a bit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40805 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-04 01:41:18 +00:00
Chris Lattner
483ce14bf4 add a typedef, no other change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40804 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-04 01:19:38 +00:00
Chris Lattner
63cdcaa3d6 avoid an unneeded vector copy. This speeds up mem2reg on the testcase
in PR1432 by 6%


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40803 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-04 01:07:49 +00:00
Chris Lattner
ac4aa4be9b make RenamePassWorkList a local var instead of an ivar.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40802 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-04 01:04:40 +00:00
Dale Johannesen
8c78a26955 Make x86 long double alignment 32 for everything but
Darwin (which makes size within a struct==96)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40796 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-03 22:46:15 +00:00
Dale Johannesen
e713d9340a long double patch 3 of N. Add to MVT.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40793 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-03 20:51:37 +00:00
Dale Johannesen
8c1e6a119a long double patch 2 of N. Handle it in TargetData.
(I've tried to get the info right for all targets,
but I'm not expert on all of them - check yours.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40792 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-03 20:20:50 +00:00
Owen Anderson
ab8702787d Fix a subtle miscompilation. This allows 197.parser to be compiled correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40791 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-03 19:59:35 +00:00
Owen Anderson
4b55c3b0f1 Fix a subtle iterator invalidation bug in a recursive algorithm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40776 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-03 11:03:26 +00:00
Dale Johannesen
320fc8a39e Long double, part 1 of N. Support in IR.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40774 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-03 01:03:46 +00:00
Chris Lattner
107f54a002 add an observation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40772 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-03 00:17:42 +00:00
Chris Lattner
b0e71edb6b Fix an accidental commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40758 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 21:33:36 +00:00
Dan Gohman
61e729e2e9 More explicit keywords.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40757 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 21:21:54 +00:00
Dan Gohman
7f55fcbc6b Fix the alignment requirements of several unpck and shuf instructions.
Generalize isPSHUFDMask and add a unary SHUFPD pattern so that SHUFPD's
memory operand alignment can be tested as well, with a fix to avoid
breaking MMX's use of isPSHUFDMask.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40756 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 21:17:01 +00:00
Dan Gohman
f3372d1d64 Fix pastos in vector arithmetic intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40754 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 21:06:40 +00:00
Owen Anderson
9fed589912 Fix 80 col. violations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40751 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 18:20:52 +00:00
Owen Anderson
830db6a00e Fix 80 col. violations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40750 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 18:16:06 +00:00
Owen Anderson
666f6fe0ce Fix 80 col. violations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40749 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 18:11:11 +00:00
Chris Lattner
b15e49597f don't redefine a parameter
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40748 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 18:08:16 +00:00
Owen Anderson
1c2763d3fe Fix a bug that was causing several miscompilations on SPEC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40746 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 17:56:05 +00:00
Christopher Lamb
a326b5da4b Implement review feedback.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40745 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 17:52:00 +00:00
Chris Lattner
5543a856ff Replacing a cast with another one does not reduce the number of
casts in the input.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40741 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 17:23:38 +00:00
Chris Lattner
b014678eb3 Disable an xform that causes an infinite loop. This fixes PR1594
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40739 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 16:56:32 +00:00
Chris Lattner
684b22df79 wrap some long lines. Major offenders that are left include
gvn, gvnpre, dse, and predsimplify.  To see these, use:

  make check-line-length



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40738 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 16:53:43 +00:00
Devang Patel
1ff61385c8 Update dominator info for the middle blocks created while spliting
exit edge to preserve LCSSA.

Fix dominance frontier update during loop unswitch. This fixes PR 1589, again



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40737 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 15:25:57 +00:00
Dan Gohman
73a902b228 Mark the SSE and MMX load instructions that
X86InstrInfo::isReallyTriviallyReMaterializable knows how to handle
with the isReMaterializable flag so that it is given a chance to handle
them. Without hoisting constant-pool loads from loops this isn't very
visible, though it does keep CodeGen/X86/constant-pool-remat-0.ll from
making a copy of the constant pool on the stack.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40736 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 14:27:55 +00:00
Chris Lattner
951626b437 Enhance instcombine to be more aggressive about folding casts of
operations of casts.  This implements InstCombine/zext-fold.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40726 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 06:11:14 +00:00
Evan Cheng
7afa166c76 Switch some multiplication instructions over to the new scheme for testing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40723 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 05:48:35 +00:00
Evan Cheng
33d5595d66 Do not emit copies for physical register output if it's not used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40722 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 05:29:38 +00:00
Chris Lattner
9dd7a5178f Fix PR1575 and test/Transforms/CondProp/2007-08-01-InvalidRead.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40720 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 04:47:05 +00:00
Scott Michel
335f4f7788 Style police: Expand the tabs to spaces!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40712 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 02:22:46 +00:00
Christopher Lamb
406bfa3e21 Teach BasicAA about noalias parameter attributes, but do it correctly this time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40711 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 01:18:14 +00:00
Evan Cheng
8409747efa Instead of adding copyfromreg's to handle physical definitions. Now isel can
simply specify them as results and let scheduledag handle them. That
is, instead of
SDOperand Flag = DAG.getTargetNode(Opc, MVT::i32, MVT::Flag, ...)
SDOperand Result = DAG.getCopyFromReg(Chain, X86::EAX, MVT::i32, Flag)

Just write:
SDOperand Result = DAG.getTargetNode(Opc, MVT::i32, MVT::i32, ...)

And let scheduledag emit the move from X86::EAX to a virtual register.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40710 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 00:28:15 +00:00
Evan Cheng
5278784621 Can't handle offset and scale if rip-relative addressing is to be used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40703 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-01 23:46:47 +00:00
Evan Cheng
0db079e2e6 Mac OS X X86-64 low 4G address not available.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40702 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-01 23:46:10 +00:00
Evan Cheng
f6844ca0e4 Mac OS X X86-64 low 4G address not available.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40701 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-01 23:45:51 +00:00
Devang Patel
2f2e519083 Undo previous check-in.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40698 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-01 23:24:50 +00:00
Evan Cheng
caf778ab3b Some out operands were incorrectly specified as input operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40697 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-01 23:07:38 +00:00
Devang Patel
28ae151c48 Update dominator info for the middle blocks created while spliting
exit edge to preserve LCSSA.

Fix dominance frontier update during loop unswitch. This fixes PR 1589.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40695 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-01 22:23:50 +00:00
Owen Anderson
9066020993 Make non-local memdep not be recursive, and fix a bug on 403.gcc that this exposed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40692 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-01 22:01:54 +00:00
Evan Cheng
c5dd54154a Missing Requires.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40691 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-01 21:42:24 +00:00
Evan Cheng
1c3017c51e Be more precise.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40689 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-01 20:22:37 +00:00
Evan Cheng
21b3bf0650 Bugs: missing partial uses and redundant partial defs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40688 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-01 20:18:21 +00:00
Lauro Ramos Venancio
f3c13c82e3 Expand unaligned loads/stores when the target doesn't support them. (PR1548)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40682 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-01 19:34:21 +00:00
Dan Gohman
c2bbfc18e9 More explicit keywords.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40673 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-01 15:32:29 +00:00
Dan Gohman
a9f643432d Change a .size directive to use a tab instead of a space, for consistency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40672 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-01 14:42:30 +00:00
Owen Anderson
f6a05f949f Rename FastDSE to just DSE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40668 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-01 06:36:51 +00:00
Owen Anderson
a56c34f90b Move FastDSE in to DeadStoreElimination.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40667 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-01 06:30:51 +00:00
Owen Anderson
e739bae8da Remove old DSE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40666 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-01 06:30:10 +00:00
David Greene
718fda37a7 Update generated files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40663 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-01 03:59:32 +00:00
David Greene
52eec54820 New CallInst interface to address GLIBCXX_DEBUG errors caused by
indexing an empty std::vector.

Updates to all clients.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40660 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-01 03:43:44 +00:00
Evan Cheng
7fc77611ef Indexed loads each has 2 outputs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40658 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-01 00:12:08 +00:00
Owen Anderson
bf7d0bc4e5 Don't let the memory allocator outsmart GVN. ;-)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40655 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-31 23:27:13 +00:00
Evan Cheng
3b1f55ea24 simpleregistercoalescing -> regcoalescing. It's too long for me to handle.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40654 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-31 22:37:44 +00:00
Owen Anderson
b95f9d565f Fix a failure I accidentally caused in my last commit by mishandling the
removal of redundant phis.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40650 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-31 20:18:28 +00:00
Lauro Ramos Venancio
c7d1114ade Fix a bug in GetKnownAlignment of packed structs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40649 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-31 20:13:21 +00:00
Dan Gohman
b1576f56c8 Change the x86 assembly output to use tab characters to separate the
mnemonics from their operands instead of single spaces. This makes the
assembly output a little more consistent with various other compilers
(f.e. GCC), and slightly easier to read. Also, update the regression
tests accordingly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40648 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-31 20:11:57 +00:00
David Greene
df464195fe Fix GLIBCXX_DEBUG error owing to dereference of end iterator. There's
no guarantee that an instruction returned by getDependency exists in
the maps.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40647 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-31 20:01:27 +00:00
Owen Anderson
054ab94bff Fix a misoptimization in aha.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40642 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-31 17:43:14 +00:00
Dan Gohman
a9cfed77b6 Use SCEVExpander::InsertCastOfTo instead of calling new IntToPtrInst
directly, because the insert point used by the SCEVExpander may vary
from what LSR originally computes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40641 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-31 17:22:27 +00:00
Devang Patel
8d246f09cb Add note.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40638 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-31 16:52:25 +00:00
Christopher Lamb
321ff4e6d5 Revert overly aggressive interpretation of noalias
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40635 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-31 16:18:07 +00:00
Reid Spencer
1013b4d749 Regenerate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40634 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-31 14:41:17 +00:00
Reid Spencer
e87f23377c After a discussion with Anton, it turns out that the InReg attribute is not
permitted on function results. So, revert the last patch to make it illegal.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40632 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-31 14:39:10 +00:00
Evan Cheng
c64a1a921c Redo and generalize previously removed opt for pinsrw: (vextract (v4i32 bc (v4f32 s2v (f32 load ))), 0) -> (i32 load )
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40628 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-31 08:04:03 +00:00
Devang Patel
15c260adff Loop unswitch preserves dom info.
Use simple analysis interface to preserve analysis info maintained by other loop passes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40627 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-31 08:03:26 +00:00
Devang Patel
91d22c8b1e Implement Simple Analysis interfaces - cloneBasicBlockAnalysis and deleteAnalysisValue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40626 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-31 08:01:41 +00:00
Devang Patel
c7e49c08c2 Introduce Simple Analysis interface for loop passes.
Right now, this interface provides hooks for only to operations, 1) clone basic block 2) delete value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40625 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-31 08:00:57 +00:00
Christopher Lamb
50192c2152 Teach BasicAA about noalias function parameters. Passes all of DejaGNU and test-suite.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40624 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-31 07:04:51 +00:00
Reid Spencer
ee0142e4a6 Regenerate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40621 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-31 06:37:43 +00:00
Reid Spencer
bf7f45152c Allow the INREG parameter attribute to be added to functions. This permits the
function result to be passed in a register. This implements the GCC regparm
function attribute for llvm by translation to the InReg parameter attribute 
and fixes test/CFrontend/2002-07-30-SubregSetAssertion.c


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40619 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-31 06:37:27 +00:00
Reid Spencer
6e800fe6cb The InReg parameter attribute is valid on function results. The llvm-gcc-4.0
front end converts regparm attribute on the gcc function into InReg attribute 
on the llvm function. This fixes test/CFrontend/2002-07-30-SubrefSetAssertion.c


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40618 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-31 06:33:37 +00:00
Evan Cheng
4ebcc8c2f8 This isn't safe when there are uses of load's chain result.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40617 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-31 06:21:44 +00:00
Chris Lattner
6240ab5022 Fix PR1581, patch by Timo Savola
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40616 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-31 06:00:51 +00:00
Reid Spencer
d8e616b173 Regenerate (again).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40613 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-31 03:55:56 +00:00
Reid Spencer
6794e616c7 Don't include newlines in the whitespace before newline (WSNL) rule.
Fix the comment for WSNL to describe its actual function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40612 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-31 03:55:43 +00:00
Reid Spencer
b8f85050d1 Regenerate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40611 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-31 03:50:36 +00:00
Reid Spencer
1d3d230861 For PR1553:
Make the AsmParser auto-upgrade the old zext and sext
keywords for parameter attributes and handle the 
end-of-line ambiguity.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40610 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-31 02:57:37 +00:00
Devang Patel
6f62af6e64 If loop can be unswitched again, then do it yourself.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40609 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-30 23:07:10 +00:00
Anton Korobeynikov
42346f58d8 Add a comment: don't expect from external function resolver in interpreter
things, it wasn't designed to handle.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40608 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-30 23:03:25 +00:00
Owen Anderson
891eecb040 Avoid potential iterator invalidation problems.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40607 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-30 21:26:39 +00:00
Devang Patel
df5cf2074c Remove dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40606 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-30 21:10:44 +00:00
Scott Michel
910b66d8d6 - Allow custom lowering for CTPOP, CTTZ, CTLZ.
- Fixed an existing unexpanded tab.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40605 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-30 21:00:31 +00:00
Devang Patel
81a129c0fb LCSSA preserves dom info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40604 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-30 20:23:45 +00:00
Devang Patel
d9a6dcba9f Loop Rotation pass preserves dominator tree and frontier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40603 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-30 20:22:53 +00:00
Devang Patel
96b651c627 LICM preserves scalar evolution and dom frontier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40602 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-30 20:19:59 +00:00
Anton Korobeynikov
3b30a6e92d Add detection of __dso_handle presence during configure. Use this information in the
JITer (short path is added for darwin). This is needed to properly JIT llvm-gcc-4.2-built
binaries, since cxa_atexit is enabled by default on much more targets.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40600 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-30 20:02:02 +00:00
Reid Spencer
ed3fa8552a Fix a typo/thinko.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40599 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-30 19:53:57 +00:00
Dan Gohman
be444ed6db Fix a bug in getCopyFromParts turned up in the testcase for PR1132.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40598 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-30 19:09:17 +00:00
Owen Anderson
45c8388e2a Use more caching when computing non-local dependence. This makes bzip2 not
use up the entire 32-bit address space.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40596 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-30 17:29:24 +00:00
Owen Anderson
4f9ba7c40c Fix a bug caused by indiscriminantly asking for the dominators of a predecessor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40595 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-30 16:57:08 +00:00
Dan Gohman
825811dc83 Use tabs more consistently in assembler pseudo-ops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40594 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-30 15:08:02 +00:00
Dan Gohman
286d56935c Print a space between the comment character and the basic block name,
for prettiness.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40593 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-30 15:06:25 +00:00
Dan Gohman
fb71d38247 Fix the comment for getClosestTargetForJIT to reflect the fact that
it does not have a Module parameter.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40590 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-30 14:58:59 +00:00
Dan Gohman
f452207d20 More explicit keywords.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40589 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-30 14:51:59 +00:00
Dan Gohman
209ee187c9 Fix pastos in comments for doFinalization functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40588 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-30 14:51:13 +00:00
Evan Cheng
66ffe6be0c Vector fneg must be expanded into fsub -0.0, X.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40586 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-30 07:51:22 +00:00
Christopher Lamb
2dc6dc619c Change the x86 backend to use extract_subreg for truncation operations. Passes DejaGnu, SingleSource and MultiSource.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40578 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-29 01:24:57 +00:00
Christopher Lamb
f9b90ea955 Add register info needed to use subreg sets on X86.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40572 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-28 19:03:30 +00:00
Devang Patel
19fe8f907e Add facility to dump pass manager structure
to make it easier to understand failure.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40567 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-27 20:06:09 +00:00
Duncan Sands
b116fac90f Trampoline codegen support for X86-32.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40566 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-27 20:02:49 +00:00
Devang Patel
c61ce1ad09 Fix edge cases in handling basic block split.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40564 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-27 19:13:43 +00:00
Devang Patel
29381fb7cd Use SmallPtrSet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40560 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-27 18:34:27 +00:00
Chuck Rose III
936baaa5ae VStudio compiler errors and placing Function*->ExFunc map under ManagedStatic control.
This commit fixes two things.  One is a pair of VStudio compiler errors stemming from variables
which defined within the for loop statement and also within the body of the for loop.  I fixed these 
by renaming one of the two variables.  Additionally, I've made the Function*->ExFunc map in 
ExternalFunctions.cpp a ManagedStatic object, so that cleanup will be done on llvm_shutdown.  In repeated
uses of the interpreter, where the same Function* address may get used for completely differnet functions,
this was causing a crash.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40558 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-27 18:26:35 +00:00
Owen Anderson
e992a56ae9 Allow SmallPtrSet to hold pointers to const data.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40556 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-27 18:07:02 +00:00
Dan Gohman
d300622eba Re-apply 40504, but with a fix for the segfault it caused in oggenc:
Make the alignedload and alignedstore patterns always require 16-byte
alignment. This way when they are used in the "Fs" instructions, in which
a vector instruction is used for a scalar purpose, they can still require
the full vector alignment. And add a regression test for this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40555 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-27 17:16:43 +00:00
Duncan Sands
9d3e79107d It seems logical that InReg should be incompatible
with StructReturn and ByVal, so make it so.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40554 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-27 16:45:18 +00:00
Duncan Sands
fdef00f1f7 As the number of parameter attributes increases,
Verifier::visitFunction is suffering a combinatorial
explosion due to the number of mutually incompatible
attributes.  This patch tidies the whole thing up
using attribute masks.  While there I fixed some
small bugs: (1) the ByVal attribute tests cast a
type to a pointer type, which can fail.  Yes, the
fact it is of a pointer type is checked before,
but a failing check does not cause the program
to exit, it continues on outputting further errors;
(2) Nothing was checking that an sret attribute is
on the first parameter; (3) nothing was checking that
a function for which isStructReturn() is true has a
parameter with the sret attribute and vice-versa (I
don't think it is possible for this to go wrong, but
it seems right to check it).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40553 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-27 15:09:54 +00:00
Duncan Sands
36397f5034 Support for trampolines, except for X86 codegen which is
still under discussion.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40549 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-27 12:58:54 +00:00
Christopher Lamb
ada779fb11 Move subreg lowering pass to be right after regalloc, per feedback.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40548 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-27 07:36:14 +00:00
Evan Cheng
3e22947d9a Reverting 40504 for now. It's breaking oggenc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40547 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-27 01:37:47 +00:00
Devang Patel
70b36d96b3 Fix thinko. Update return status appropriately.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40546 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-26 20:21:42 +00:00
Owen Anderson
a377a24771 Fix a bug introduced in my last commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40542 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-26 18:57:04 +00:00
Owen Anderson
45537917ee Fix a couple more bugs in the phi construction by pulling in code that does
almost the same things from LCSSA.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40540 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-26 18:26:51 +00:00
Evan Cheng
fcc8793dc8 Make sure epilogue esp adjustment is placed before any terminator and pop instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40538 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-26 17:45:41 +00:00
Evan Cheng
85dce6cf78 Don't pollute the meaning of isUnpredicatedTerminator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40537 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-26 17:32:14 +00:00
Evan Cheng
cf5543c47e Minor bug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40535 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-26 17:02:45 +00:00
Dan Gohman
559742c0ea Fix the alias analysis query in DAGCombiner to not add in two
offsets. The SrcValueOffset values are the real offsets from the
SrcValue base pointers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40534 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-26 16:14:06 +00:00
Dan Gohman
37f3ee17d2 Move the GET_SIDE_EFFECT_INFO logic from isInstructionTriviallyDead
to Instruction::mayWriteToMemory, fixing a FIXME, and helping
various places that call mayWriteToMemory directly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40533 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-26 16:06:08 +00:00
Dan Gohman
c2dfd066c0 Remove a bogus return statement, what appears to have been a pasto
from Relation::contradicts in Relation::incorporate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40531 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-26 15:29:35 +00:00
Dan Gohman
9adcdf2535 DummyInst's member functions don't need to be virtual.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40530 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-26 15:25:08 +00:00
Dan Gohman
b6bbe39ff9 In the .loc directive, print the fields as "debug" fields, so they
don't get decorated as if for immediate fields for instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40529 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-26 15:24:15 +00:00
Dan Gohman
1704c2f9b9 Fix a whitespace difference between CMPSSrr and CMPSDrr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40528 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-26 15:11:50 +00:00
Christopher Lamb
bab2474b64 Add a MachineFunction pass, which runs post register allocation, that turns subreg insert/extract instruction into register copies. This ensures correct code gen if the coalescer isn't able to remove all subreg instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40521 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-26 08:18:32 +00:00
Christopher Lamb
e24f8f1ec9 Teach DAG scheduling how to properly emit subreg insert/extract machine instructions. PR1350
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40520 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-26 08:12:07 +00:00
Christopher Lamb
08d52071ba Add target independent MachineInstr's to represent subreg insert/extract in MBB's. PR1350
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40518 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-26 07:48:21 +00:00
Evan Cheng
518143d795 Same goes for constantpool, etc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40517 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-26 07:35:15 +00:00
Christopher Lamb
557c3631d3 Add selection DAG nodes for subreg insert/extract. PR1350
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40516 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-26 07:34:40 +00:00
Christopher Lamb
6f95014158 Remove subreg index from MachineInstr's and also keep vregs as unsigned when adding operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40514 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-26 07:00:46 +00:00
Christopher Lamb
844228a631 Fix infinite recursion for when extract_vector_elt is legal. Unfortunately no public targets use this code-path, so no test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40510 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-26 03:33:13 +00:00
Christopher Lamb
1fcc4b2ba8 Add support for 3 element 32-bit vector ValueTypes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40506 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-26 01:46:52 +00:00
Dan Gohman
d3283832aa Remove X86ISD::LOAD_PACK and X86ISD::LOAD_UA and associated code from the
x86 target, replacing them with the new alignment attributes on memory
references.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40504 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-26 00:31:09 +00:00
Owen Anderson
febc7e3613 Fix what is _hopefully_ the last corner case for loops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40503 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-25 23:54:42 +00:00
Evan Cheng
a49ed78c27 Mac OS X x86-64 lower 4G address is not available.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40502 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-25 23:41:36 +00:00
Evan Cheng
ad5e9cac02 Mac OS X should use 0x90 to fill in gaps to satisfy function alignment requirements.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40501 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-25 23:36:05 +00:00
Evan Cheng
73a259a9d1 EmitAlignment() also emits optional fill value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40500 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-25 23:35:07 +00:00
Evan Cheng
d88ea4d9aa Functions with LinkOnce and weak linkage still need to be aligned. Doh.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40499 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-25 22:28:16 +00:00