summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils
Commit message (Collapse)AuthorAgeFilesLines
* Rearrange code a bitChris Lattner2004-02-241-30/+27
| | | | llvm-svn: 11793
* Implement: test/Regression/Transforms/SimplifyCFG/switch_create.llChris Lattner2004-02-241-7/+140
| | | | | | | | | | This turns code like this: if (X == 4 | X == 7) and if (X != 4 & X != 7) into switch instructions. llvm-svn: 11792
* Fix PR245: Linking weak and strong global variables is dependent on link orderChris Lattner2004-02-171-1/+3
| | | | llvm-svn: 11565
* Implement test/Regression/Transforms/SimplifyCFG/UncondBranchToReturn.ll,Chris Lattner2004-02-161-0/+48
| | | | | | see the testcase for the reasoning. llvm-svn: 11496
* Adjustments to support the new ConstantAggregateZero classChris Lattner2004-02-152-8/+21
| | | | llvm-svn: 11474
* Fix compilation of 126.gcc: intrinsic functions cannot throw, so they are notChris Lattner2004-02-131-28/+33
| | | | | | | allowed in invoke instructions. Thus, if we are inlining a call to an intrinsic function into an invoke site, we don't need to turn the call into an invoke! llvm-svn: 11384
* Implement SimplifyCFG/PhiEliminate.llChris Lattner2004-02-111-5/+234
| | | | | | | Having a proper 'select' instruction would allow the elimination of a lot of the special case cruft in this patch, but we don't have one yet. llvm-svn: 11307
* The hasConstantReferences predicate always returns false.Chris Lattner2004-02-111-52/+49
| | | | llvm-svn: 11301
* rename the "exceptional" destination of an invoke instruction to the ↵Chris Lattner2004-02-082-2/+2
| | | | | | 'unwind' dest llvm-svn: 11202
* Minor speedup, don't query ValueMap each time through the loopChris Lattner2004-02-041-6/+3
| | | | llvm-svn: 11123
* Two changes:Chris Lattner2004-02-041-5/+12
| | | | | | | | | | | | | 1. Don't scan to the end of alloca instructions in the caller function to insert inlined allocas, just insert at the top. This saves a lot of time inlining into functions with a lot of allocas. 2. Use splice to move the alloca instructions over, instead of remove/insert. This allows us to transfer a block at a time, and eliminates a bunch of silly symbol table manipulations. This speeds up the inliner on the testcase in PR209 from 1.73s -> 1.04s (67%) llvm-svn: 11118
* Optimize the case where we are inlining a function that contains only one ↵Chris Lattner2004-02-041-37/+67
| | | | | | | | | | | basic block, and that basic block ends with a return instruction. In this case, we can just splice the cloned "body" of the function directly into the source basic block, avoiding a lot of rearrangement and splitBasicBlock's linear scan over the split block. This speeds up the inliner on the testcase in PR209 from 2.3s to 1.7s, a 35% reduction. llvm-svn: 11116
* More refactoring. Move alloca instructions and handle invoke instructionsChris Lattner2004-02-041-129/+132
| | | | | | | before we delete the original call site, allowing slight simplifications of code, but nothing exciting. llvm-svn: 11109
* Move the cloning of the function body much earlier in the inlinefunctionChris Lattner2004-02-041-52/+54
| | | | | | | | | | process. The only optimization we did so far is to avoid creating a PHI node, then immediately destroying it in the common case where the callee has one return statement. Instead, we just don't create the return value. This has no noticable performance impact, but paves the way for future improvements. llvm-svn: 11108
* Give CloneBasicBlock an optional function argument to specify which functionChris Lattner2004-02-042-13/+10
| | | | | | | | to add the cloned block to. This allows the block to be added to the function immediately, and all of the instructions to be immediately added to the function symbol table, which speeds up the inliner from 3.7 -> 3.38s on the PR209. llvm-svn: 11107
* Bunch up all locally used allocas by the block they are allocated in, andChris Lattner2004-02-031-13/+74
| | | | | | | process them all as a group. This speeds up SRoA/mem2reg from 28.46s to 0.62s on the testcase from PR209. llvm-svn: 11100
* Handle extremely trivial cases extremely efficiently. This speeds upChris Lattner2004-02-031-17/+30
| | | | | | SRoA/mem2reg from 41.2s to 27.5s on the testcase in PR209. llvm-svn: 11099
* Clean up #includesChris Lattner2004-01-121-3/+1
| | | | llvm-svn: 10799
* Remove use of ConstantExpr::getShiftChris Lattner2004-01-123-16/+1
| | | | llvm-svn: 10792
* Remove use of ConstantHandlingChris Lattner2004-01-121-1/+1
| | | | llvm-svn: 10789
* Move llvm::ConstantFoldInstruction from VMCore to here, next to ↵Chris Lattner2004-01-121-0/+58
| | | | | | ConstantFoldTerminator llvm-svn: 10785
* Implement Transforms/ScalarRepl/phinodepromote.ll, which is an importantChris Lattner2004-01-121-17/+86
| | | | | | case that the C/C++ front-end generates. llvm-svn: 10761
* Finegrainify namespacificationChris Lattner2004-01-0912-82/+48
| | | | llvm-svn: 10727
* Add new functionChris Lattner2003-12-191-10/+41
| | | | llvm-svn: 10529
* Minor cleanups and simplificationsChris Lattner2003-11-212-11/+5
| | | | llvm-svn: 10127
* Start using the nicer terminator auto-insertion APIChris Lattner2003-11-203-8/+7
| | | | llvm-svn: 10111
* Spew symbolic types!Chris Lattner2003-11-201-3/+8
| | | | llvm-svn: 10110
* Put all LLVM code into the llvm namespace, as per bug 109.Brian Gaeke2003-11-1114-0/+55
| | | | llvm-svn: 9903
* Reorganize code for locality, improve commentsChris Lattner2003-11-101-19/+23
| | | | llvm-svn: 9857
* Adjust to new critical edge interfaceChris Lattner2003-11-101-9/+11
| | | | llvm-svn: 9853
* Various cleanups and efficiency improvementsChris Lattner2003-11-061-38/+24
| | | | llvm-svn: 9753
* Yet more fixes for constant expr shiftsChris Lattner2003-11-051-0/+6
| | | | llvm-svn: 9739
* Further fixes for PR93Chris Lattner2003-11-051-1/+7
| | | | llvm-svn: 9738
* Checking in Chris's suggestions:John Criswell2003-11-041-3/+32
| | | | | | | | | | Added assert() to ensure symbol table is well formed. Added code to remember the value that was found; resolving types can change the symbol table and invalidate the value of the iterator. Added comments to the ResolveTypes() function (mainly for my own benefit). Please feel free to correct the comments if they are not accurate. llvm-svn: 9693
* Fix test: Linker/2003-10-27-LinkOncePromote.llChris Lattner2003-10-271-27/+29
| | | | | | Fix PR58 llvm-svn: 9530
* Get the list of PHI node values before the basic block is split. Also, addChris Lattner2003-10-271-9/+16
| | | | | | | | PHI node entries for unwind instructions just like for call instructions which became invokes! This fixes PR57, tested by Inline/2003-10-26-InlineInvokeExceptionDestPhi.ll llvm-svn: 9526
* Fix bug: Linker/2003-10-21-ConflictingTypesTolerance.llChris Lattner2003-10-211-13/+10
| | | | llvm-svn: 9357
* Fix message to make more sense and confuse Chris lessChris Lattner2003-10-211-2/+7
| | | | llvm-svn: 9354
* Added LLVM copyright header.John Criswell2003-10-211-0/+7
| | | | llvm-svn: 9321
* Added LLVM copyright notice to Makefiles.John Criswell2003-10-201-0/+8
| | | | llvm-svn: 9312
* Added LLVM project notice to the top of every C++ source file.John Criswell2003-10-2013-0/+91
| | | | | | Header files will be on the way. llvm-svn: 9298
* Fix PR#50Chris Lattner2003-10-181-6/+6
| | | | llvm-svn: 9227
* Add support for 'weak' linkage.Chris Lattner2003-10-161-5/+32
| | | | llvm-svn: 9171
* CleanupChris Lattner2003-10-151-5/+2
| | | | llvm-svn: 9133
* Do not move variable sized allocations to the top of the caller, which mightChris Lattner2003-10-141-7/+5
| | | | | | | | break dominance relationships, and is otherwise bad. This fixes bug: Inline/2003-10-13-AllocaDominanceProblem.ll. This also fixes miscompilation of 3 176.gcc source files (reload1.c, global.c, flow.c) llvm-svn: 9109
* Rename loop preheaders pass to loop simplifyChris Lattner2003-10-121-1/+3
| | | | llvm-svn: 9061
* Fix spelling.Misha Brukman2003-10-105-9/+9
| | | | llvm-svn: 9027
* Avoid doing pointless work. Amazingly, this makes us go faster.Chris Lattner2003-10-062-8/+5
| | | | | | | | | | Running the inliner on 252.eon used to take 48.4763s, now it takes 14.4148s. In release mode, it went from taking 25.8741s to taking 11.5712s. This also fixes a FIXME. llvm-svn: 8890
* This changes the PromoteMemToReg function to create "pruned" SSA form, notChris Lattner2003-10-051-24/+109
| | | | | | | | | | | | | | | | | | | | "minimal" SSA form (in other words, it doesn't insert dead PHIs). This speeds up the mem2reg pass very significantly because it doesn't have to do a lot of frivolous work in many common cases. In the 252.eon function I have been playing with, this doesn't even insert the 120 PHI nodes that it used to which were trivially dead (in the process of promoting 356 alloca instructions overall). This speeds up the mem2reg pass from 1.2459s to 0.1284s. More significantly, the DCE pass used to take 2.4138s to remove the 120 dead PHI nodes that mem2reg constructed, now it takes 0.0134s (which is the time to scan the function and decide that there is nothing dead). So overall, on this one function, we speed things up a total of 3.5179s, which is a 24.8x speedup! :) This change is tested by the Mem2Reg/2003-10-05-DeadPHIInsertion.ll test, which now passes. llvm-svn: 8884
* Change the interface to PromoteMemToReg to also take a DominatorTreeChris Lattner2003-10-051-1/+2
| | | | llvm-svn: 8883
OpenPOWER on IntegriCloud