Commit Graph

3599 Commits

Author SHA1 Message Date
Chris Lattner
5e6e494a97 Fix a logic error in ValueIsOnlyUsedLocallyOrStoredToOneGlobal that caused
miscompilation of 188.ammp.  Reject select and bitcast in 
ValueIsOnlyUsedLocallyOrStoredToOneGlobal because RewriteHeapSROALoadUser can't handle it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41950 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-14 03:41:21 +00:00
Chris Lattner
ce4e748565 silence a bogus gcc warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41949 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-14 03:07:24 +00:00
Bill Wendling
c68491069a Temporary reverting r41817
(http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070910/053370.html). It's
causing SPASS to fail.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41938 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-14 01:13:55 +00:00
Chris Lattner
309f20fc45 Teach GlobalLoadUsesSimpleEnoughForHeapSRA and the SROA rewriter how to handle
a limited form of PHI nodes.  This finally fixes PR1639, speeding 179.art up
from 7.84s to 3.13s on PPC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41933 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-13 21:31:36 +00:00
Chris Lattner
a637a8b1e7 be tolerant of PHI nodes when rewriting heap SROA code. This is a step
along the way of PR1639


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41930 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-13 18:00:31 +00:00
Chris Lattner
330245e90b refactor some code, no functionality change. On the path to PR1639
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41929 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-13 17:29:05 +00:00
Chris Lattner
c451f9c167 Make ValueIsOnlyUsedLocallyOrStoredToOneGlobal smart enough to see through
bitcasts and phis.  This is a step to fixing PR1639.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41928 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-13 16:37:20 +00:00
Chris Lattner
816861803f Make AllUsesOfLoadedValueWillTrapIfNull strong enough to see through PHI
nodes.  This is the first step of the fix for PR1639.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41927 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-13 16:30:19 +00:00
Chris Lattner
36597a5ddb Change llvm.gcroot to not init the root to null at runtime, this prevents
using it for live-in values etc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41879 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-12 17:53:10 +00:00
Duncan Sands
b84abcd77d Turn calls to trampolines into calls to the underlying
nested function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41844 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-11 14:35:41 +00:00
Devang Patel
c3957d1983 Avoid negative logic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41829 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-11 01:10:45 +00:00
Devang Patel
d35ed2c16d Refactor code into a separate method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41826 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-11 00:42:56 +00:00
Devang Patel
964be45e7c Clear split info object.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41823 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-11 00:23:56 +00:00
Devang Patel
4f12c5f615 Split condition does not have to be ICmpInst in all cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41822 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-11 00:12:56 +00:00
Devang Patel
ba32a5f3cc Check all terminators inside loop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41821 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-10 23:57:58 +00:00
Chris Lattner
50d9d77643 remove some dead code, this is handled by constant folding.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41819 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-10 23:46:29 +00:00
Devang Patel
0c0f7c935b Swap exit condition operands if it works.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41817 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-10 23:34:06 +00:00
Chris Lattner
8d9455d4e4 Prevent tailcallelim from breaking "recursive" calls to builtins.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41804 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-10 20:58:55 +00:00
Devang Patel
9c7a9f186c Filter exit conditions which are not yet handled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41800 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-10 18:33:42 +00:00
Devang Patel
bc533cd128 Require SCEV before LCSSA.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41798 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-10 18:08:23 +00:00
Chris Lattner
a54c7eb157 Don't zap back to back volatile load/stores
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41759 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-07 05:33:03 +00:00
Dale Johannesen
43421b3dd7 Next round of APFloat changes.
Use APFloat in UpgradeParser and AsmParser.
Change all references to ConstantFP to use the
APFloat interface rather than double.  Remove
the ConstantFP double interfaces.
Use APFloat functions for constant folding arithmetic
and comparisons.
(There are still way too many places APFloat is
just a wrapper around host float/double, but we're
getting there.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41747 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-06 18:13:44 +00:00
Nick Lewycky
455e176ffb Use isTrueWhenEqual. Thanks Chris!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41741 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-06 02:40:25 +00:00
Nick Lewycky
5a5ff9d7df When the two operands of an icmp are equal, there are five possible predicates
that would make the icmp true. Fixes PR1637.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41740 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-06 01:10:22 +00:00
Chuck Rose III
c331d305a0 Forgot to obey 80 column rule. Fixing that.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41725 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-05 20:36:41 +00:00
Chuck Rose III
d4af306aec Added default parameters to GetElementPtrInstr constructor call. Visual Studio 2k5 was getting confused and was unable to compile it. Suspected compiler error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41721 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-05 16:54:38 +00:00
Devang Patel
d24e5992e9 Insert cloned loop basic blocks before original loop header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41713 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-04 20:46:35 +00:00
David Greene
b8f74793b9 Update GEP constructors to use an iterator interface to fix
GLIBCXX_DEBUG issues.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41697 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-04 15:46:09 +00:00
Anton Korobeynikov
406452dce3 Silence warning while compiling with gcc 4.2
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41676 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-02 22:11:14 +00:00
Evan Cheng
4e9c473c4d Fix a gcroot lowering bug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41668 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-01 02:00:51 +00:00
Chris Lattner
92103de8ce Cut off crazy computation. This helps PR1622 slightly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41522 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-28 04:23:55 +00:00
Devang Patel
1cd39a4f6e Use simpler test to filter loops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41516 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-27 21:34:31 +00:00
David Greene
f1355a55f8 Update InvokeInst to work like CallInst
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41506 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-27 19:04:21 +00:00
Dan Gohman
e3784951af Change comments to refer to @malloc and @free instead of %malloc and %free.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41488 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-27 16:11:48 +00:00
Anton Korobeynikov
9f528e6280 Don't promote volatile loads/stores. This is needed (for example) to handle setjmp/longjmp properly.
This fixes PR1520.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41461 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 21:43:30 +00:00
Owen Anderson
5dfcf4318a Don't DSe volatile stores.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41456 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-26 21:14:47 +00:00
Devang Patel
d79faee69a Move exit condition and exit branch from exiting block into loop header and dominator info. This avoid execution of dead iteration. Loop is already filter in the beginning such that this change is safe.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41394 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-25 02:39:24 +00:00
Devang Patel
be97c986e1 Constant split values needs upper bound and lower bound check, just like any other split value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41389 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-25 01:09:14 +00:00
Devang Patel
4a69da9cb0 While calculating upper loop bound for first loop and lower loop bound for second loop, take care of edge cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41387 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-25 00:56:38 +00:00
Devang Patel
7097e9a710 Fix regression that I caused yesterday night while adding logic to select appropriate split condition branch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41365 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-24 19:32:26 +00:00
Devang Patel
4259fe3281 It is not safe to execute split condition's true branch first all the time. If split
condition predicate is GT or GE then execute false branch first.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41358 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-24 06:17:19 +00:00
Devang Patel
c830aee8e8 Reject ICMP_NE as index split condition.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41357 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-24 06:02:25 +00:00
Devang Patel
b88e4200cf Tightenup loop filter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41356 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-24 05:36:56 +00:00
Devang Patel
7237d1167a Remove incomplete cost analysis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41354 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-24 05:21:13 +00:00
Chris Lattner
9132a2b818 rename APInt::toString -> toStringUnsigned for symmetry with toStringSigned()
Add an APSInt::toString() method.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41309 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-23 05:15:32 +00:00
Devang Patel
40fc353a0d Remove dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41295 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-22 21:07:41 +00:00
Devang Patel
a24d918063 Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41292 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-22 20:55:18 +00:00
Devang Patel
a8644e306d Cosmetic change
"True Loop" and "False Loop" naming terminology to refer two loops
after loop cloning is confusing. Instead just use A_Loop and B_Loop.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41287 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-22 19:33:29 +00:00
Devang Patel
dc52395353 Refactor loop condition check in a separate function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41282 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-22 18:27:01 +00:00
Devang Patel
ea0fa97334 Fix thinko.
Starting value of second loop's induction variable can not be lower 
then starting value of original loop's induction variable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41280 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-22 18:07:47 +00:00
Devang Patel
0b8e02b704 Rename bunch of variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41250 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-21 21:12:02 +00:00
Devang Patel
60cbab4252 Preserve LCSSA.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41246 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-21 19:47:46 +00:00
Devang Patel
b7211a2ce1 Use SmallVector instead of std::vector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41207 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-21 00:31:24 +00:00
Devang Patel
1cc2ec8d20 s/ExitBlock/ExitingBlock/g
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41204 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-20 23:51:18 +00:00
Devang Patel
ebc5fea695 Replace indunction variable with split value in loop body.
This fixes art miscompile.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41195 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-20 20:49:01 +00:00
Devang Patel
d651f657f2 Do not split loops rejected by processOneIterationLoop().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41194 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-20 20:24:15 +00:00
Nick Lewycky
6694e31c49 Oops, remove assert that wasn't meant to be committed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41170 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-18 23:21:28 +00:00
Nick Lewycky
c721223f73 Never insert duplicate edges.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41169 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-18 23:18:03 +00:00
Nick Lewycky
af5cbc82bb Typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41168 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-18 15:08:56 +00:00
Devang Patel
20d260a193 Avoid spliting loops where two split condition branches are not independent.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41148 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-18 00:00:32 +00:00
Devang Patel
96bf524b53 When one branch of condition is eliminated then head of the other
branch is not necessary immediate dominators of merge blcok in all cases.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41144 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-17 21:59:16 +00:00
Owen Anderson
1defe2df5d Factor out some code into a helper function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41131 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-16 22:51:56 +00:00
Owen Anderson
62bc33c954 Add some more comments to GVN.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41129 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-16 22:02:55 +00:00
Devang Patel
7375bb9c8c Dominance frontier is now required.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41096 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-15 03:34:53 +00:00
Devang Patel
5b8ec614f5 Cleanup removeBlocks.
Use dominance frontier to fixup incoming edges of successor blocks not domianted by DeadBB.
Use df_iterator to walk and delete basic blocks dominated by DeadBB.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41095 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-15 03:31:47 +00:00
Reid Spencer
e9dd95ad9c Remove unneeded header file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41094 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-15 03:01:04 +00:00
Devang Patel
3fe4f2135a Avoid triangle loops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41093 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-15 02:14:55 +00:00
Devang Patel
4f5d78e9c1 Break infinite loop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41091 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-14 23:59:17 +00:00
Devang Patel
4e8061cbda Avoid nested loops at the moment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41090 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-14 23:53:57 +00:00
Devang Patel
a6a8663894 Fix dominance frontier update while removing blocks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41082 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-14 18:35:57 +00:00
Owen Anderson
31f496755a Eliminate PHI nodes with constant values during normal GVN processing, even when
they're not related to eliminating a load.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41081 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-14 18:33:27 +00:00
Owen Anderson
36057c7834 Be more aggressive in pruning unnecessary PHI nodes when doing PHI construction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41080 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-14 18:16:29 +00:00
Owen Anderson
3e75a42ee2 Make GVN iterative.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41078 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-14 18:04:11 +00:00
Owen Anderson
8e8278e7fe Fix a case where GVN was failing to return true when it had, in fact, modified
the function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41077 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-14 17:59:48 +00:00
Devang Patel
ada054a9ea Handle last value assignments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41063 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-14 01:30:57 +00:00
Devang Patel
ebcb52aa89 StartValue is already calculated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41062 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-14 00:15:45 +00:00
Devang Patel
21eca2a9cf Preserve simple analysis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41054 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-13 22:22:13 +00:00
Devang Patel
fc4c5f82f8 Preserve dominator info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41053 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-13 22:13:24 +00:00
Devang Patel
6acc9e6b7b If NewBB dominates DestBB then DestBB is not part of NewBB's dominance frontier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41051 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-13 21:59:17 +00:00
Devang Patel
98147a306e Split loops and do CFG cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41029 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-12 07:02:51 +00:00
Reid Spencer
9626a9c700 Remove unused variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41028 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-12 04:45:36 +00:00
Chris Lattner
8d2e88806b Transform a load from an undef/zero global into an undef/global even if we
have complex pointer manipulation going on.  This allows us to compile
stuff like this:

__m128i foo(__m128i x){
                static const unsigned int c_0[4] = { 0, 0, 0, 0 };
                __m128i v_Zero = _mm_loadu_si128((__m128i*)c_0);
                x  = _mm_unpacklo_epi8(x,  v_Zero);
                return x;
}

into:

_foo:
        xorps   %xmm1, %xmm1
        punpcklbw       %xmm1, %xmm0
        ret




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41022 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-11 18:48:48 +00:00
Devang Patel
423c8b29b8 Clone loop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40998 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-10 18:07:13 +00:00
Devang Patel
4bc2a0b420 Add utility to clone loops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40997 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-10 17:59:47 +00:00
Devang Patel
acb8c09e27 Remove unncessary duplication.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40979 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-10 00:59:03 +00:00
Devang Patel
23a19f82a7 Calculate exit and start value of true loop and false loop respectively.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40978 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-10 00:53:35 +00:00
Devang Patel
bacf5193cf ExitCondition and Induction variable are loop constraints
not split condition constraints.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40977 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-10 00:33:50 +00:00
Chris Lattner
f2369f2042 when we see a unaligned load from an insufficiently aligned global or
alloca, increase the alignment of the load, turning it into an aligned load.

This allows us to compile:

#include <xmmintrin.h>
__m128i foo(__m128i x){
 static const unsigned int c_0[4] = { 0, 0, 0, 0 };
	  __m128i v_Zero = _mm_loadu_si128((__m128i*)c_0);
  x  = _mm_unpacklo_epi8(x,  v_Zero);
  return x;
}

into:

_foo:
	punpcklbw	_c_0.5944, %xmm0
	ret
	.data
	.lcomm	_c_0.5944,16,4		# c_0.5944

instead of:

_foo:
	movdqu	_c_0.5944, %xmm1
	punpcklbw	%xmm1, %xmm0
	ret
	.data
	.lcomm	_c_0.5944,16,2		# c_0.5944



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40971 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-09 19:05:49 +00:00
Owen Anderson
9528f11481 Make NonLocal and None const in the right way. :-)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40961 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-09 04:42:44 +00:00
Devang Patel
c9d123dca9 Traverse loop blocks' terminators to find split candidates.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40960 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-09 01:39:01 +00:00
Devang Patel
9704fcf505 Add cost analysis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40952 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-08 22:25:28 +00:00
Devang Patel
787a713bb2 Preserve dom info while processing one iteration loop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40947 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-08 21:39:47 +00:00
Owen Anderson
8cad423d94 Change the None and NonLocal markers in memdep to be const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40946 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-08 21:39:39 +00:00
Devang Patel
9021c7001e Clear split info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40944 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-08 21:18:27 +00:00
Devang Patel
71554b8e3c Handle multiple split conditions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40941 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-08 21:02:17 +00:00
Owen Anderson
838014ee5b Global values also don't undead-ify pointers in our dead alloca's set.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40936 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-08 19:12:31 +00:00
Owen Anderson
362bb52108 Make handleEndBlock significantly faster with one trivial improvement,
and one hack to avoid hitting a bad case when the alias analysis is imprecise.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40935 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-08 18:38:28 +00:00
Owen Anderson
df359c264e Small improvement: if a function doesn't access memory, we don't need to scan
it for potentially undeading pointers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40933 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-08 17:58:56 +00:00
Owen Anderson
bb3abf41a8 Add some comments, remove a dead argument, and simplify some control flow.
No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40932 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-08 17:50:09 +00:00
Owen Anderson
c182f17aed A few more small cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40922 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-08 06:06:02 +00:00