summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils
Commit message (Collapse)AuthorAgeFilesLines
...
* rename InlineInfo.DevirtualizedCalls -> InlinedCalls toChris Lattner2010-05-011-5/+5
| | | | | | | reflect that it includes all inlined calls now, not just devirtualized ones. llvm-svn: 102824
* Implement rdar://6295824 and PR6724 with two tiny changesChris Lattner2010-05-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | that can have a big effect :). The first is to enable the iterative SCC passmanager juice that kicks in when the scc passmgr detects that a function pass has devirtualized a call. In this case, it will rerun all the passes it manages on the SCC, up to the iteration count limit (4). This is useful because a function pass may devirualize a call, and we want the inliner to inline it, or pruneeh to infer stuff about it, etc. The second patch is to add *all* call sites to the DevirtualizedCalls list the inliner uses. This list is about to get renamed, but the jist of this is that the inliner now reconsiders *all* inlined call sites as candidates for further inlining. The intuition is this that in cases like this: f() { g(1); } g(int x) { h(x); } We analyze this bottom up, and may decide that it isn't profitable to inline H into G. Next step, we decide that it is profitable to inline G into F, and do so, which means that F now calls H. Even though the call from G -> H may not have been profitable to inline, the call from F -> H may be (in this case because a constant allows folding etc). In my spot checks, this doesn't have a big impact on code. For example, the LLC output for 252.eon grew from 0.02% (from 317252 to 317308) and 176.gcc actually shrunk by .3% (from 1525612 to 1520964 bytes). 252.eon never iterated in the SCC Passmgr, 176.gcc iterated at most 1 time. llvm-svn: 102823
* Fix a problem that lower invoke has with allocas (PR6694), and Chris Lattner2010-04-261-10/+38
| | | | | | | | | add a version of createLowerInvokePass that allows the client to specify whether it wants "expensive" or "cheap" lowering. Patch by Alex Mac! llvm-svn: 102402
* switch InlineInfo.DevirtualizedCalls's list to be of WeakVH.Chris Lattner2010-04-231-1/+1
| | | | | | | | | This fixes a bug where calls inlined into an invoke would get changed into an invoke but the array would keep pointing to the (now dead) call. The improved inliner behavior is still disabled for now. llvm-svn: 102196
* The inliner was choosing to not consider call sitesChris Lattner2010-04-221-2/+7
| | | | | | | | | | that appear in the SCC as a result of inlining as candidates for inlining. Change this so that it *does* consider call sites that change from being indirect to being direct as a result of inlining. This allows it to completely "devirtualize" the testcase. llvm-svn: 102146
* refactor the interface to InlineFunction so that most of the in/outChris Lattner2010-04-222-22/+23
| | | | | | | | arguments are handled with a new InlineFunctionInfo class. This makes it easier to extend InlineFunction to return more info in the future. llvm-svn: 102137
* when inlining something like this:Chris Lattner2010-04-221-2/+16
| | | | | | | | | | | | | | | | | | | | | | | define void @f3(void (i8*)* %__f) ssp { entry: call void %__f(i8* undef) unreachable } define void @f4(i8* %this) ssp align 2 { entry: call void @f3(void (i8*)* @f2) ssp ret void } The inliner is turning the indirect call to %__f into a direct call to F2. Make the call graph more precise when this happens. The inliner doesn't revisit call sites introduced by inlining, so there isn't an easy way to test for this, but a more precise callgraph is a good thing. llvm-svn: 102131
* eliminate dead #include.Chris Lattner2010-04-221-1/+0
| | | | llvm-svn: 102119
* Fix a performance problem with the new SSAUpdater. This showed up in theBob Wilson2010-04-211-2/+8
| | | | | | GCCAS time for MultiSource/Benchmarks/ASCI_Purple/SMG2000. llvm-svn: 102009
* Rename ValueMapTy as ValueToValueMapTy to clearly indicate that this has no ↵Devang Patel2010-04-203-9/+9
| | | | | | replationship with ADT/ValueMap. llvm-svn: 101950
* There is no need to install ValueMapper.h header. Devang Patel2010-04-204-3/+32
| | | | llvm-svn: 101949
* Re-commit my previous SSAUpdater changes. The previous version naively triedBob Wilson2010-04-171-179/+434
| | | | | | | | | | | to determine where to place PHIs by iteratively comparing reaching definitions at each block. That was just plain wrong. This version now computes the dominator tree within the subset of the CFG where PHIs may need to be placed, and then places the PHIs in the iterated dominance frontier of each definition. The rest of the patch is mostly the same, with a few more performance improvements added in. llvm-svn: 101612
* Revert 101465, it broke internal OpenGL testing.Eric Christopher2010-04-163-22/+22
| | | | | | | Probably the best way to know that all getOperand() calls have been handled is to replace that API instead of updating. llvm-svn: 101579
* reapply r101434Gabor Greif2010-04-163-22/+22
| | | | | | | | | | | | | with a fix for self-hosting rotate CallInst operands, i.e. move callee to the back of the operand array the motivation for this patch are laid out in my mail to llvm-commits: more efficient access to operands and callee, faster callgraph-construction, smaller compiler binary llvm-svn: 101465
* back out r101423 and r101397, they break llvm-gcc self-host on darwin10Gabor Greif2010-04-163-22/+22
| | | | llvm-svn: 101434
* reapply r101364, which has been backed out in r101368Gabor Greif2010-04-153-22/+22
| | | | | | | | | | | | | with a fix rotate CallInst operands, i.e. move callee to the back of the operand array the motivation for this patch are laid out in my mail to llvm-commits: more efficient access to operands and callee, faster callgraph-construction, smaller compiler binary llvm-svn: 101397
* back out r101364, as it trips the linux nightlybot on some clang C++ testsGabor Greif2010-04-153-22/+22
| | | | llvm-svn: 101368
* rotate CallInst operands, i.e. move callee to the backGabor Greif2010-04-153-22/+22
| | | | | | | | | | of the operand array the motivation for this patch are laid out in my mail to llvm-commits: more efficient access to operands and callee, faster callgraph-construction, smaller compiler binary llvm-svn: 101364
* Actually... return after the check for invalid input.Eric Christopher2010-04-131-0/+1
| | | | llvm-svn: 101139
* Verify function prototypes before trying to optimize functions. We alsoEric Christopher2010-04-121-2/+48
| | | | | | | | | | need TargetData, just return false if we don't have it. Update testcases accordingly. Fixes PR6807. llvm-svn: 101011
* performance: cache result of looking up userGabor Greif2010-04-091-4/+6
| | | | llvm-svn: 100862
* Add support for stpncpy_chk.Eric Christopher2010-04-071-6/+6
| | | | llvm-svn: 100710
* rename llvm::llvm_report_error -> llvm::report_fatal_errorChris Lattner2010-04-071-1/+1
| | | | llvm-svn: 100709
* Code clean up.Evan Cheng2010-04-051-12/+10
| | | | llvm-svn: 100467
* Reapply address space patch after fixing an issue in MemCopyOptimizer.Mon P Wang2010-04-042-25/+29
| | | | | | | Added support for address spaces and added a isVolatile field to memcpy, memmove, and memset, e.g., llvm.memcpy.i32(i8*, i8*, i32, i32) -> llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1) llvm-svn: 100304
* Revert all my SSAUpdater patches. The PHI placement algorithm is not correctBob Wilson2010-04-031-315/+183
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (what was I thinking?) and there's also a problem with LCSSA. I'll try again later with fixes. --- Reverse-merging r100263 into '.': U lib/Transforms/Utils/SSAUpdater.cpp --- Reverse-merging r100177 into '.': G lib/Transforms/Utils/SSAUpdater.cpp --- Reverse-merging r100148 into '.': G lib/Transforms/Utils/SSAUpdater.cpp --- Reverse-merging r100147 into '.': U include/llvm/Transforms/Utils/SSAUpdater.h G lib/Transforms/Utils/SSAUpdater.cpp --- Reverse-merging r100131 into '.': G include/llvm/Transforms/Utils/SSAUpdater.h G lib/Transforms/Utils/SSAUpdater.cpp --- Reverse-merging r100130 into '.': G lib/Transforms/Utils/SSAUpdater.cpp --- Reverse-merging r100126 into '.': G include/llvm/Transforms/Utils/SSAUpdater.h G lib/Transforms/Utils/SSAUpdater.cpp --- Reverse-merging r100050 into '.': D test/Transforms/GVN/2010-03-31-RedundantPHIs.ll --- Reverse-merging r100047 into '.': G include/llvm/Transforms/Utils/SSAUpdater.h G lib/Transforms/Utils/SSAUpdater.cpp llvm-svn: 100264
* Add a DEBUG_TYPE for the SSAUpdater.Bob Wilson2010-04-031-0/+1
| | | | llvm-svn: 100263
* Revert r100191 since it breaks objc in clang Mon P Wang2010-04-022-29/+25
| | | | llvm-svn: 100199
* Reapply address space patch after fixing an issue in MemCopyOptimizer.Mon P Wang2010-04-022-25/+29
| | | | | | | Added support for address spaces and added a isVolatile field to memcpy, memmove, and memset, e.g., llvm.memcpy.i32(i8*, i8*, i32, i32) -> llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1) llvm-svn: 100191
* Recommit 100158 now that the buildbots are happy again.Bob Wilson2010-04-021-21/+29
| | | | llvm-svn: 100177
* Revert 100158 in case it is causing some of the buildbot problems.Bob Wilson2010-04-021-29/+21
| | | | llvm-svn: 100164
* Check for terminating conditions before adding PHIs to the worklists.Bob Wilson2010-04-021-21/+29
| | | | | | This is more efficient than adding them to the worklist and then ignoring them. llvm-svn: 100158
* Remove trailing whitespace.Bob Wilson2010-04-011-5/+5
| | | | llvm-svn: 100148
* Rewrite another SSAUpdater function to avoid recursion.Bob Wilson2010-04-011-32/+46
| | | | llvm-svn: 100147
* Change another SSAUpdater function to avoid recursion.Bob Wilson2010-04-011-18/+24
| | | | llvm-svn: 100131
* Simplify the code to check for existing PHIs, now that it is only used inBob Wilson2010-04-011-30/+12
| | | | | | one place. This removes the template function added in svn 94690. llvm-svn: 100130
* The SSAUpdater should avoid recursive traversals of the CFG, since that mayBob Wilson2010-04-011-15/+23
| | | | | | blow out the stack for really big functions. Start by fixing an easy case. llvm-svn: 100126
* Rewrite part of the SSAUpdater to be more careful about inserting redundantBob Wilson2010-03-311-150/+263
| | | | | | | | PHIs. The previous algorithm was unable to reliably detect when existing PHIs in a cycle can be reused. I'm still working on reducing a testcase. Radar 7711900. llvm-svn: 100047
* Revert Mon Ping's change 99928, since it broke all the llvm-gcc buildbots.Bob Wilson2010-03-302-29/+25
| | | | llvm-svn: 99948
* Added support for address spaces and added a isVolatile field to memcpy, ↵Mon P Wang2010-03-302-25/+29
| | | | | | | | | memmove, and memset, e.g., llvm.memcpy.i32(i8*, i8*, i32, i32) -> llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1) A update of langref will occur in a subsequent checkin. llvm-svn: 99928
* Fix a grammaro.Dan Gohman2010-03-301-1/+1
| | | | llvm-svn: 99917
* fix two cases where the arguments were extracted from the wrong range out of ↵Gabor Greif2010-03-301-3/+3
| | | | | | | | the InvokeInst spotted by baldrick -- thanks\! llvm-svn: 99914
* rename pred_const_iterator to const_pred_iterator for consistency's sakeGabor Greif2010-03-251-1/+1
| | | | llvm-svn: 99567
* rename use_const_iterator to const_use_iterator for consistency's sakeGabor Greif2010-03-251-1/+1
| | | | llvm-svn: 99564
* Temporarily revert this, it's causing an issue with an internal project.Eric Christopher2010-03-241-3/+1
| | | | llvm-svn: 99451
* Finally land the InvokeInst operand reordering.Gabor Greif2010-03-241-2/+2
| | | | | | | | | | | | I have audited all getOperandNo calls now, fixing hidden assumptions. CallSite related uglyness will be eliminated successively. Note this patch has a long and griveous history, for all the back-and-forths have a look at CallSite.h's log. llvm-svn: 99399
* cache result of UI.getOperandNo() instead of calling it twice, it is cheaper ↵Gabor Greif2010-03-241-2/+3
| | | | | | this way llvm-svn: 99394
* add some accessors to callsite/callinst/invokeinst to checkChris Lattner2010-03-231-1/+3
| | | | | | | | for the noinline attribute, and make the inliner refuse to inline a call site when the call site is marked noinline even if the callee isn't. This fixes PR6682. llvm-svn: 99341
* Teach simplify libcall to transform __strcpy_chk to __memcpy_chk to enable ↵Evan Cheng2010-03-231-1/+25
| | | | | | optimizations down stream. llvm-svn: 99282
* Fix 80 col violation.Evan Cheng2010-03-221-1/+1
| | | | llvm-svn: 99224
OpenPOWER on IntegriCloud