- Aug 31, 2009
-
-
Chris Lattner authored
argpromotion and structretpromote. Basically, when replacing a function, they used the 'changeFunction' api which changes the entry in the function map (and steals/reuses the callgraph node). This has some interesting effects: first, the problem is that it doesn't update the "callee" edges in any callees of the function in the call graph. Second, this covers for a major problem in all the CGSCC pass stuff, which is that it is completely broken when functions are deleted if they *don't* reuse a CGN. (there is a cute little fixme about this though :). This patch changes the protocol that CGSCC passes must obey: now the CGSCC pass manager copies the SCC and preincrements its iterator to avoid passes invalidating it. This allows CGSCC passes to mutate the current SCC. However multiple passes may be run on that SCC, so if passes do this, they are now required to *update* the SCC to be current when they return. Other less interesting parts of this patch are that it makes passes update the CG more directly, eliminates changeFunction, and requires clients of replaceCallSite to specify the new callee CGN if they are changing it. llvm-svn: 80527
-
- Aug 30, 2009
-
-
Chris Lattner authored
is itself a bitcast. Since we have gep(bitcast(bitcast(y))) in this case, just wait for the two bitcasts to get zapped. This prevents instcombine from confusing some aliasing stuff, and allows it to directly eliminate the load in the testcase. llvm-svn: 80508
-
Chris Lattner authored
llvm-svn: 80507
-
Chris Lattner authored
in a few scalar xforms to simplify things. llvm-svn: 80506
-
Chris Lattner authored
llvm-svn: 80505
-
Chris Lattner authored
llvm-svn: 80504
-
Chris Lattner authored
the new Instcombine builder. llvm-svn: 80501
-
Chris Lattner authored
llvm-svn: 80500
-
Chris Lattner authored
workslist and is set to insert new instructions before the current one. Convert a bunch of stuff that used to call InsertNewInstBefore over to use it, greatly simplifying code and making it more natural. There is still a lot more to go, but this is a good start. llvm-svn: 80492
-
Chris Lattner authored
if the operand is not an instruction. Simplify most uses of AddOperandsToWorkList to use AddValue and inline it into the one remaining callsite. llvm-svn: 80488
-
Chris Lattner authored
argument stronger typed. llvm-svn: 80487
-
Chris Lattner authored
former looks too much like AddUsersToWorkList and keeps confusing me. Remove AddSoonDeadInstToWorklist and change its two callers to do the same thing in a simpler way. llvm-svn: 80486
-
Chris Lattner authored
into their callers. simplify ReplaceInstUsesWith. Make EraseInstFromFunction only add operands to the worklist if there aren't too many of them (this was a scalability win for crazy programs that was only infrequently enforced). Switch more code to using EraseInstFromFunction instead of duplicating it inline. Change some fcmp/icmp optimizations to modify fcmp/icmp in place instead of creating a new one and deleting the old one just to change the predicate. llvm-svn: 80483
-
Chris Lattner authored
llvm-svn: 80482
-
Chris Lattner authored
llvm-svn: 80481
-
Chris Lattner authored
other places. llvm-svn: 80478
-
Chris Lattner authored
llvm-svn: 80477
-
Chris Lattner authored
llvm-svn: 80476
-
Chris Lattner authored
does constant folding of gep's: this is already handled in a more general way. No functionality change. llvm-svn: 80475
-
Dan Gohman authored
llvm-svn: 80454
-
- Aug 29, 2009
-
-
Benjamin Kramer authored
llvm-svn: 80431
-
Bill Wendling authored
llvm-svn: 80429
-
Devang Patel authored
Use MDNodes to encode debug info in llvm IR. llvm-svn: 80406
-
- Aug 28, 2009
-
-
Andreas Neustifter authored
This implements the maximum spanning tree algorithm on CFGs according to weights given by the ProfileEstimator. This is then used to implement Optimal Edge Profiling. llvm-svn: 80358
-
Chris Lattner authored
llvm-svn: 80334
-
Chris Lattner authored
llvm-svn: 80327
-
- Aug 27, 2009
-
-
Chris Lattner authored
calls into a function and if the calls bring in arrays, try to merge them together to reduce stack size. For example, in the testcase we'd previously end up with 4 allocas, now we end up with 2 allocas. As described in the comments, this is not really the ideal solution to this problem, but it is surprisingly effective. For example, on 176.gcc, we end up eliminating 67 arrays at "gccas" time and another 24 at "llvm-ld" time. One piece of concern that I didn't look into: at -O0 -g with forced inlining this will almost certainly result in worse debug info. I think this is acceptable though given that this is a case of "debugging optimized code", and we don't want debug info to prevent the optimizer from doing things anyway. llvm-svn: 80215
-
Chris Lattner authored
llvm-svn: 80205
-
Chris Lattner authored
llvm-svn: 80204
-
Chris Lattner authored
a the list of static allocas that it inlined. llvm-svn: 80203
-
Chris Lattner authored
llvm-svn: 80202
-
Chris Lattner authored
llvm-svn: 80201
-
Chris Lattner authored
and other code cleanups. No functionality change. llvm-svn: 80199
-
Owen Anderson authored
llvm-svn: 80170
-
- Aug 26, 2009
-
-
Devang Patel authored
llvm-svn: 80073
-
Dan Gohman authored
llvm-svn: 80058
-
Dan Gohman authored
constructors. llvm-svn: 80049
-
Dan Gohman authored
and introduce a new Instruction::isIdenticalTo which tests for full identity, including the SubclassOptionalData flags. Also, fix the Instruction::clone implementations to preserve the SubclassOptionalData flags. Finally, teach several optimizations how to handle SubclassOptionalData correctly, given these changes. This fixes the counterintuitive behavior of isIdenticalTo not comparing the full value, and clone not returning an identical clone, as well as some subtle bugs that could be caused by these. Thanks to Nick Lewycky for reporting this, and for an initial patch! llvm-svn: 80038
-
- Aug 25, 2009
-
-
Dan Gohman authored
sinking code, since they are special. If the loop preheader happens to be the entry block of a function, don't sink static allocas out of it. This fixes PR4775. llvm-svn: 80010
-
Owen Anderson authored
llvm-svn: 80009
-