Commit Graph

697 Commits

Author SHA1 Message Date
Duraid Madina
2a0013f59f add setJumpBufSize() and setJumpBufAlignment() to target-lowering.
Call these from your backend to enjoy setjmp/longjmp goodness, see
lib/Target/IA64/IA64ISelLowering.cpp for an example


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30095 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-04 06:21:35 +00:00
Chris Lattner
7f8897f22e eliminate RegisterOpt. It does the same thing as RegisterPass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29925 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-27 22:42:52 +00:00
Chris Lattner
a4f0b3a084 s|llvm/Support/Visibility.h|llvm/Support/Compiler.h|
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29911 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-27 12:54:02 +00:00
Chris Lattner
3bb4657488 Don't attempt to split subloops out of a loop with a huge number of backedges.
Not only will this take huge amounts of compile time, the resultant loop nests
won't be useful for optimization.  This reduces loopsimplify time on
Transforms/LoopSimplify/2006-08-11-LoopSimplifyLongTime.ll from ~32s to ~0.4s
with a debug build of llvm on a 2.7Ghz G5.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29647 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-12 05:25:00 +00:00
Chris Lattner
fa78946482 Reimplement the loopsimplify code which deletes edges from unreachable
blocks that target loop blocks.

Before, the code was run once per loop, and depended on the number of
predecessors each block in the loop had.  Unfortunately, scanning preds can
be really slow when huge numbers of phis exist or when phis with huge numbers
of inputs exist.

Now, the code is run once per function and scans successors instead of preds,
which is far faster.  In addition, the new code is simpler and is goto free,
woo.

This change speeds up a nasty testcase Duraid provided me from taking hours to
taking ~72s with a debug build.  The functionality this implements is already
tested in the testsuite as Transforms/CodeExtractor/2004-03-13-LoopExtractorCrash.ll.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29644 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-12 04:51:20 +00:00
Chris Lattner
8cfe6335e4 Fix PR867 (and maybe 868) and testcsae:
Transforms/SimplifyCFG/2006-08-03-Crash.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29515 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-03 21:40:24 +00:00
Chris Lattner
f9ba401bf5 Add special check to avoid isLoop call. Simple, but doesn't seem to speed
up lcssa much in practice.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29465 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-02 00:16:47 +00:00
Chris Lattner
d41ae8bc0c Replace the SSA update code in LCSSA with a bottom-up approach instead of a top
down approach, inspired by discussions with Tanya.

This approach is significantly faster, because it does not need dominator
frontiers and it does not insert extraneous unused PHI nodes.  For example, on
252.eon, in a release-asserts build, this speeds up LCSSA (which is the slowest
pass in gccas) from 9.14s to 0.74s on my G5.  This code is also slightly smaller
and significantly simpler than the old code.

Amusingly, in a normal Release build (which includes the
"assert(L->isLCSSAForm());" assertion), asserting that the result of LCSSA
is in LCSSA form is actually slower than the LCSSA transformation pass
itself on 252.eon.  I will see if Loop::isLCSSAForm can be sped up next.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29463 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-02 00:06:09 +00:00
Chris Lattner
21ba23d0d8 silence warnings in a release build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29189 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-18 21:48:57 +00:00
Chris Lattner
27d672136a eliminate some ugly code, using ConstantExpr::getWithOperands instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29149 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-14 22:21:31 +00:00
Chris Lattner
981418bf15 Handle instructions in the map, but that map to a null pointer.
This unbreaks smg2000.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29127 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-12 21:37:11 +00:00
Chris Lattner
1bb3a40257 In addition to deleting calls, the inliner can constant fold them as well.
Handle this case, which doesn't require a new callgraph edge.  This fixes
a crash compiling MallocBench/gs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29121 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-12 18:37:18 +00:00
Chris Lattner
d85340f4ec Change the callgraph representation to store the callsite along with the
target CG node.  This allows the inliner to properly update the callgraph
when using the pruning inliner.  The pruning inliner may not copy over all
call sites from a callee to a caller, so the edges corresponding to those
call sites should not be copied over either.

This fixes PR827 and Transforms/Inline/2006-07-12-InlinePruneCGUpdate.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29120 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-12 18:29:36 +00:00
Owen Anderson
f8dad7a926 Fix typo in the comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29078 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-09 21:35:40 +00:00
Owen Anderson
e4e1ecd37c Add a fix for an issue where LCSSA would fail to insert undef's in some corner
cases.  Ideally, this issue will go away in the future as LCSSA gets smarter
about which Phi nodes it inserts.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29076 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-09 08:14:06 +00:00
Chris Lattner
9525528a7d Use hidden visibility to make symbols in an anonymous namespace get
dropped.  This shrinks libllvmgcc.dylib another 67K


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28975 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-28 23:17:24 +00:00
Chris Lattner
f4b546110c Shrink libllvmgcc.dylib by another 23K
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28972 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-28 22:08:15 +00:00
Chris Lattner
13a68e4257 Use the PotDoms map to memoize 'dominating value' lookup. With this patch,
LCSSA is still the slowest pass when gccas'ing 252.eon, but now it only takes
39s instead of 289s. :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28776 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-14 01:13:57 +00:00
Owen Anderson
8b92d0cae1 Fix another instance where PHI nodes need special treatment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28774 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-13 20:50:09 +00:00
Owen Anderson
7be3f1e078 Fix a bug that was causing major slowdowns in povray. This was due to LCSSA
not handling PHI nodes correctly when determining if a value was live-out.

This patch reduces the number of detected live-out variables in the testcase
from 6565 to 485.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28771 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-13 19:37:18 +00:00
Chris Lattner
7f2e1dd5d4 Fix an infinite loop on Transforms/SimplifyCFG/2006-06-12-InfLoop.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28758 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-12 20:18:01 +00:00
Owen Anderson
3d2aa47bd3 Fix for 2006-06-26-MultipleExitsSingleBlock.
If a single exit block has multiple predecessors within the loop, it will
appear in the exit blocks list more than once.  LCSSA needs to take that into
account so that it doesn't double process that exit block.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28750 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-12 07:10:16 +00:00
Owen Anderson
c2cc15cf9d Re-commit the safe parts of my 6/9 patch. Still working on fixing the unsafe parts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28748 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-11 19:22:28 +00:00
Evan Cheng
b9b2b309d3 Back out Owen's 6/9 changes. They broke MultiSource/Benchmarks/Prolangs-C/bison (and perhaps others).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28747 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-11 09:32:57 +00:00
Owen Anderson
f25c19c6b5 Make Loop able to verify that it is in LCSSA-form, and have the LCSSA pass assert
on this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28738 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-09 18:33:30 +00:00
Owen Anderson
a452932171 Update some comments, and expose LCSSAID in preparation for having other passes
require LCSSA.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28734 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-08 20:02:53 +00:00
Owen Anderson
e9d93d5d70 Fix some formatting, and use inLoop() when appropriate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28694 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-06 04:36:36 +00:00
Owen Anderson
92deacf2f7 Stop a memory leak, and update some comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28693 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-06 04:28:30 +00:00
Owen Anderson
c14c1d472a Some more clean-up, and squash an IDF-Phi related bug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28680 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-04 00:55:19 +00:00
Owen Anderson
9e1c1ddd4b Various clean-ups suggested by Chris.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28678 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-04 00:02:23 +00:00
Owen Anderson
30019c88f4 Fix a bug in Phi-noded insertion. Also, update some comments to reflect what's
actually going on.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28677 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-03 23:22:50 +00:00
Chris Lattner
191b0ba97e Force anything that #includes llvm/Transforms/Utils/UnifyFunctionExitNodes.h
to link in the implementation.  Thanks to Anton Korobeynikov for figuring out
what was going on here.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28660 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-02 18:40:06 +00:00
Chris Lattner
ecf626fedf Remove dead #include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28642 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-01 20:02:28 +00:00
Chris Lattner
35033efd08 Make the "pruning cloner" smarter. As it propagates constants through the
code (while cloning) it often gets the branch/switch instructions.  Since it
knows that edges of the CFG are dead, it need not clone (or even look) at
the obviously dead blocks.  This should speed up the inliner substantially on
code where there are lots of inlinable calls to functions with constant
arguments.  On C++ code in particular, this kicks in.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28641 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-01 19:19:23 +00:00
Owen Anderson
ff99366919 Remove a FIXME that was fixed with my last patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28619 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-01 06:07:40 +00:00
Owen Anderson
2824da4738 More cleanups. Also, add a special case for updating PHI nodes, and
reimplement getValueDominatingFunction to walk the DominanceTree rather than
just searching blindly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28618 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-01 06:05:47 +00:00
Owen Anderson
408a4061d8 Extract a huge loop into a helper method. Fix a few iterator-invalidation bugs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28599 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-31 20:55:06 +00:00
Owen Anderson
00ea74c27e Add Use replacement. Assuming there is nothing horribly wrong with this, LCSSA
is now theoretically feature-complete.  It has not, however, been thoroughly
test, and is still considered experimental.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28529 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-29 01:00:00 +00:00
Owen Anderson
bd82277cbb Major think-o. Iterate over all live out-of-loop values, and perform the
other calculations on each individually, rather than trying to delay it and do
them all at the end.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28527 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-28 19:33:28 +00:00
Owen Anderson
2f21e07915 Make LCSSA insert proper Phi nodes throughout the rest of the CFG by computing
the iterated Dominance Frontier of the loop-closure Phi's.  This is the
second phase of the LCSSA pass.  The third phase (coming soon) will be to
update all uses of loop variables to use the loop-closure Phi's instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28524 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-27 18:47:11 +00:00
Chris Lattner
8d8d6530b1 Fix some regression from the inliner patch I committed last night. This fixes
ldecod, lencod, and SPASS.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28523 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-27 17:28:13 +00:00
Chris Lattner
5b5bc3032f Switch the inliner over to using CloneAndPruneFunctionInto. This effectively
makes it so that it constant folds instructions on the fly.  This is good
for several reasons:

0. Many instructions are constant foldable after inlining, particularly if
   inlining a call with constant arguments.
1. Without this, the inliner has to allocate memory for all of the instructions
   that can be constant folded, then a subsequent pass has to delete them.  This
   gets the job done without this extra work.
2. This makes the inliner *pass* a bit more aggressive: in particular, it
   partially solves a phase order issue where the inliner would inline lots
   of code that folds away to nothing, but think that the resultant function
   is big because of this code that will be gone.  Now the code never exists.

This is the first part of a 2-step process.  The second part will be smart
enough to see when this implicit constant folding propagates a constant into
a branch or switch instruction, making CFG edges dead.

This implements Transforms/Inline/inline_constprop.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28521 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-27 01:28:04 +00:00
Chris Lattner
83f03bfc3f Implement a new method, CloneAndPruneFunctionInto, as documented.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28519 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-27 01:22:24 +00:00
Chris Lattner
4b30fcb5f5 Refactor some code to expose an interface to constant fold and instruction given it's opcode, typeand operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28517 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-27 01:18:04 +00:00
Owen Anderson
a90b2c7240 A few small clean-ups, and the addition of an LCSSA statistic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28512 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-27 00:31:37 +00:00
Owen Anderson
fc3a3bc64b Fix a copy-and-paste-o that would break some compilers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28507 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-26 21:19:17 +00:00
Owen Anderson
2480737211 Clean up and refactor LCSSA a bunch. It should also run faster now, though
there's still a lot of work to be done on it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28506 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-26 21:11:53 +00:00
Owen Anderson
11f510b577 Skeletal LCSSA pass. This is currently non-functional. Expect functionality
and documentation updates soo.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28495 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-26 13:58:26 +00:00
Chris Lattner
99f2af2dee Revert a patch that is unsafe, due to out of range array accesses in inner
array scopes possibly accessing valid memory in outer subscripts.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28478 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-25 21:25:12 +00:00
Chris Lattner
a04c0c417b Patch for a new instcombine xform, patch contributed by Nick Lewycky!
This implements Transforms/InstCombine/2006-05-10-InvalidIndexUndef.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28450 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-24 17:34:30 +00:00
Reid Spencer
bc2eba1ca2 Fix a doxygen problem and break lines at 80 columns
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28395 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-19 19:09:46 +00:00
Chris Lattner
ed96fe8c79 Declare that lowerinvoke doesn't interact with other lowering passes.
Patch written by Domagoj Babic!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28367 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-17 21:05:27 +00:00
Chris Lattner
782e60150e Add a CloneModule call that exposes the mapping of values from the old module
to the new module.  Patch provided by Nick Lewycky!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28349 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-17 18:05:35 +00:00
Chris Lattner
a0fcc3ee3f remove some dead code identified by coverity
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28289 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-14 18:45:44 +00:00
Chris Lattner
36a169e1a3 remove dead variables
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28286 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-14 18:33:57 +00:00
Chris Lattner
8d89e7bdbc Patch to make some xforms preserve each other. Patch contributed by
Domagoj Babic!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28181 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-09 04:13:41 +00:00
Chris Lattner
b3674e4753 Add pass ID's for various passes, so they can be AddRequiredID. Patch by
Domagoj Babic!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28048 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-02 04:24:36 +00:00
Chris Lattner
634c76c08c Fix some nondeterminstic behavior in the mem2reg pass that (in addition to
nondeterminism being bad) could cause some trivial missed optimizations (dead
phi nodes being left around for later passes to clean up).

With this, llvm-gcc4 now bootstraps and correctly compares.  I don't know
why I never tried to do it before... :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27984 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-27 01:14:43 +00:00
Chris Lattner
543abdf1d0 Add supprot for shufflevector
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27513 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-08 01:19:12 +00:00
Chris Lattner
8960766d45 Fix inlining of insert/extract element constantexprs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27478 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-07 04:41:03 +00:00
Chris Lattner
7224f84c15 Adjust to change in Intrinsics.gen interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27344 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-02 03:35:01 +00:00
Chris Lattner
3805dea3fe add valuemapper support for inline asm
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27332 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-01 23:17:11 +00:00
Chris Lattner
49aaa6a8ee teach the inliner to work with packed constants
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27161 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-27 05:50:18 +00:00
Chris Lattner
aeebe7f208 use autogenerated side-effect information
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26673 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-09 22:38:10 +00:00
Chris Lattner
299520de7c Fix Transforms/SimplifyCFG/2006-02-17-InfiniteUnroll.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26275 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-18 00:33:17 +00:00
Chris Lattner
0ab9f966de Canonicalize inner loops before outer loops. Inner loop canonicalization
can provide work for the outer loop to canonicalize.

This fixes a case that breaks unswitching.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26189 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-14 23:06:02 +00:00
Chris Lattner
c27e056d4f When splitting exit edges to canonicalize loops, make sure to put the new
block in the appropriate loop nest.

Third time is the charm, right?


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26187 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-14 22:34:08 +00:00
Chris Lattner
ee628cfefb Revert my last patch. It too breaks stuff
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26128 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-12 01:59:10 +00:00
Chris Lattner
d308ddcd67 Fix for my previously reverted patch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26126 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-11 21:24:54 +00:00
Chris Lattner
5077c7be92 revert my previous change, it exposed other problems.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26121 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-11 08:47:47 +00:00
Chris Lattner
8587eb3a51 Make this check stricter. Disallow loop exit blocks from being shared by
loops and their subloops.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26118 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-11 02:13:17 +00:00
Chris Lattner
441365c46e remove dead expr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26116 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-11 01:43:37 +00:00
Chris Lattner
f47a6b4882 teach the cloner to handle inline asms
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25633 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-26 01:55:22 +00:00
Chris Lattner
3e2fa7a746 rename method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25572 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-24 04:16:34 +00:00
Chris Lattner
9771aeafca When cloning a module, clone the inline asm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25559 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-23 23:06:28 +00:00
Chris Lattner
dac58ad983 Make iostream #inclusion explicit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25514 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-22 23:32:06 +00:00
Chris Lattner
86a5484079 Add explicit #includes of <iostream>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25509 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-22 22:53:01 +00:00
Robert Bocchino
d900c6a8b3 ConstantFoldLoadThroughGEPConstantExpr wasn't handling pointers to
packed types correctly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25470 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-19 23:53:23 +00:00
Chris Lattner
c4e8c9f318 Make sure that cloning a module clones its target triple and dependent
library list as well.  This should help bugpoint.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25424 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-18 21:32:45 +00:00
Robert Bocchino
956fd7254f Constant folding support for the insertelement operation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25407 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-17 20:07:07 +00:00
Reid Spencer
0b118206bf For PR411:
This patch is an incremental step towards supporting a flat symbol table.
It de-overloads the intrinsic functions by providing type-specific intrinsics
and arranging for automatically upgrading from the old overloaded name to
the new non-overloaded name. Specifically:
  llvm.isunordered -> llvm.isunordered.f32, llvm.isunordered.f64
  llvm.sqrt -> llvm.sqrt.f32, llvm.sqrt.f64
  llvm.ctpop -> llvm.ctpop.i8, llvm.ctpop.i16, llvm.ctpop.i32, llvm.ctpop.i64
  llvm.ctlz -> llvm.ctlz.i8, llvm.ctlz.i16, llvm.ctlz.i32, llvm.ctlz.i64
  llvm.cttz -> llvm.cttz.i8, llvm.cttz.i16, llvm.cttz.i32, llvm.cttz.i64
New code should not use the overloaded intrinsic names. Warnings will be
emitted if they are used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25366 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-16 21:12:35 +00:00
Chris Lattner
468fb1df7d Teach the inliner to update the CallGraph itself, and have it add edges to
llvm.stacksave/restore when it inserts calls to them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25320 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-14 20:07:50 +00:00
Nate Begeman
6fb3bd6a65 Add bswap intrinsics as documented in the Language Reference
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25309 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-14 01:25:24 +00:00
Chris Lattner
5522037136 it is ok to dce stacksave.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25295 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-13 21:31:54 +00:00
Chris Lattner
bf229f488a If inlining a call to a function that contains dynamic allocas, wrap the
resultant code with llvm.stacksave/llvm.stackrestore intrinsics.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25286 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-13 19:34:14 +00:00
Chris Lattner
1fdf4a859f Use ClonedCodeInfo to avoid another walk over the inlined code, this this
time in common C cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25285 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-13 19:18:11 +00:00
Chris Lattner
727d1dd587 Use the ClonedCodeInfo object to avoid scans of the inlined code when
it doesn't contain any calls.  This is a fairly common case for C++ code,
so it will probably speed up the inliner marginally in these cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25284 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-13 19:15:15 +00:00
Chris Lattner
cd4d339ec1 Refactor a bunch of invoke handling stuff out into a new function
"HandleInlinedInvoke".  No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25283 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-13 19:05:59 +00:00
Chris Lattner
a4c29d2037 Allow the code cloning interfaces to capture some important info about the
code being cloned if the client wants.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25281 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-13 18:39:17 +00:00
Chris Lattner
21f20558d6 Fix a bug I noticed by inspection: if the first instruction in the inlined
function was not an alloca, we wouldn't check the entry block for any allocas,
leading to increased stack space in some cases.  In practice, allocas are almost
always at the top of the block, so this was never noticed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25280 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-13 18:16:48 +00:00
Chris Lattner
dd9e956605 Preserve and update ETForest. Patch by Daniel Berlin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25203 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-11 05:11:13 +00:00
Robert Bocchino
b52ee7f5ff Added support for the extractelement operation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25181 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-10 19:05:34 +00:00
Chris Lattner
baec98d00b Teach loopsimplify to update et-forest. Patch contributed by Daniel Berlin!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25153 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-09 08:03:08 +00:00
Chris Lattner
8e75ee212f Fix SimplifyCFG/2005-12-03-IncorrectPHIFold.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24581 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-03 18:25:58 +00:00
Chris Lattner
36ba5006df Implement a refinement to the mem2reg algorithm for cases where an alloca
has a single def.  In this case, look for uses that are dominated by the def
and attempt to rewrite them to directly use the stored value.

This speeds up mem2reg on these values and reduces the number of phi nodes
inserted.  This should address PR665.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24411 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-18 07:31:42 +00:00
Chris Lattner
fed40df846 This needs proper dominance
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24410 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-18 07:29:44 +00:00
Nate Begeman
14b0529532 Add support alignment of allocation instructions.
Add support for specifying alignment and size of setjmp jmpbufs.

No targets currently do anything with this information, nor is it presrved
in the bytecode representation.  That's coming up next.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24196 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-05 09:21:28 +00:00
Chris Lattner
cbbc6b74e3 Fix #include order
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24044 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-27 16:34:00 +00:00
John Criswell
a115643357 Move some constant folding code shared by Analysis and Transform passes
into the LLVMAnalysis library.
This allows LLVMTranform and LLVMTransformUtils to be archives and linked
with LLVMAnalysis.a, which provides any missing definitions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24036 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-27 15:54:34 +00:00
John Criswell
e96a1a576b 1. Remove libraries no longer created from the list of libraries linked into the
SparcV9 JIT.
2. Make LLVMTransformUtils a relinked object file and always link it before
   LLVMAnalysis.a.  These two libraries have circular dependencies on each
   other which creates problem when building the SparcV9 JIT.  This change
   fixes the dependency on all platforms problems with a minimum of fuss.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24023 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-26 20:35:13 +00:00