summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* Kill unneeded SExt.Benjamin Kramer2010-05-261-1/+1
| | | | llvm-svn: 104692
* Properly promote operands when optimizing a single-character memcmp.Benjamin Kramer2010-05-251-3/+6
| | | | llvm-svn: 104648
* Fix a missing newline in debug output.Dan Gohman2010-05-251-1/+1
| | | | llvm-svn: 104644
* DominatorTree.getNode can return null for unreachable blocks.Dan Gohman2010-05-201-1/+1
| | | | llvm-svn: 104290
* Minor code cleanups.Dan Gohman2010-05-201-8/+7
| | | | llvm-svn: 104287
* Make Solve check its own post-condition, to reduce clutter in theDan Gohman2010-05-201-1/+2
| | | | | | top-level LSRInstance logic. llvm-svn: 104278
* Add comments.Dan Gohman2010-05-201-0/+16
| | | | llvm-svn: 104276
* More code cleanups. Use iterators instead of indices when indicesDan Gohman2010-05-201-22/+24
| | | | | | aren't needed. llvm-svn: 104273
* Fix OptimizeShadowIV to set Changed. Change OptimizeLoopTermCond to setDan Gohman2010-05-201-8/+7
| | | | | | | | | Changed directly instead of using a return value. Rename FilterOutUndesirableDedicatedRegisters's Changed variable to distinguish it from LSRInstance's Changed member. llvm-svn: 104269
* Add some comments.Dan Gohman2010-05-201-0/+6
| | | | llvm-svn: 104268
* Simplify this code. Don't do a DomTreeNode lookup for each visited block.Dan Gohman2010-05-201-14/+5
| | | | llvm-svn: 104267
* Minor code cleanups.Dan Gohman2010-05-201-20/+11
| | | | llvm-svn: 104263
* When canonicalizing icmp operand order to put the loop invariantDan Gohman2010-05-201-0/+1
| | | | | | | | | | | | operand on the left, the interesting operand is on the right. This fixes a bug where LSR was failing to recognize ICmpZero uses, which led it to be unable to reverse the induction variable in the attached testcase. Delete test/CodeGen/X86/stack-color-with-reg-2.ll, because its test is extremely fragile and hard to meaningfully update. llvm-svn: 104262
* Set Changed to true when canonicalizing ICmp operand order; even thoughDan Gohman2010-05-201-0/+1
| | | | | | it isn't a very interesting change, it's a change nonetheless. llvm-svn: 104260
* Strip llvm.dbg.lv also.Devang Patel2010-05-201-0/+6
| | | | llvm-svn: 104236
* Rename a variable to avoid shadowing.Dan Gohman2010-05-201-2/+3
| | | | llvm-svn: 104234
* Minor code simplification.Dan Gohman2010-05-201-4/+4
| | | | llvm-svn: 104232
* Move the code for deleting BaseRegs and LSRUses into helper functions,Dan Gohman2010-05-201-5/+22
| | | | | | | and fix a bug that valgrind noticed where the code would std::swap an element with itself. llvm-svn: 104225
* Teach LSR how to cope better with unrolled loops on targets whereDan Gohman2010-05-191-3/+191
| | | | | | | | the addressing modes don't make this trivially easy. This allows it to avoid falling into the less precise heuristics in more cases. llvm-svn: 104186
* Add a comment.Dan Gohman2010-05-181-0/+1
| | | | llvm-svn: 104089
* Fix the predicate which checks for non-sensical formulae which haveDan Gohman2010-05-181-4/+5
| | | | | | constants in registers which partially cancel out their immediate fields. llvm-svn: 104088
* Factor out the code for recomputing an LSRUse's Regs set after someDan Gohman2010-05-181-17/+40
| | | | | | | of its formulae have been removed into a helper function, and also teach it how to update the RegUseTracker. llvm-svn: 104087
* Factor out code for estimating search space complexity into a helperDan Gohman2010-05-181-22/+26
| | | | | | function. llvm-svn: 104082
* Add some more debug output.Dan Gohman2010-05-181-0/+1
| | | | llvm-svn: 104080
* Factor out the code for deleting a formula from an LSRUse intoDan Gohman2010-05-181-4/+9
| | | | | | a helper function. llvm-svn: 104079
* Make some debug output more informative.Dan Gohman2010-05-181-2/+3
| | | | llvm-svn: 104078
* Print an error message in Formula::print if the HasBaseReg flagDan Gohman2010-05-181-0/+7
| | | | | | | is inconsistent with the BaseRegs field. It's not print's job to assert on an invalid condition, but it can make one more obvious. llvm-svn: 104077
* Rename RegUseTracker's RegUses member to RegUsesMap to avoidDan Gohman2010-05-181-7/+7
| | | | | | confusion with LSRInstance's RegUses member. llvm-svn: 104076
* Teach the always inliner to release its inline cost estimates, like the basicNick Lewycky2010-05-151-0/+3
| | | | | | | inliner did in r103653. Why does the always inliner even bother with cost estimates anyways? llvm-svn: 103858
* Clean up, no functional change.Nick Lewycky2010-05-151-9/+9
| | | | llvm-svn: 103857
* Remove heinous tabs.Nick Lewycky2010-05-131-7/+7
| | | | llvm-svn: 103700
* Replace the core comparison login in merge functions. We can now mergeNick Lewycky2010-05-131-192/+276
| | | | | | | | | | | | | | | | | | | | | | | | vector<>::push_back() in: int foo(vector<int> &a, vector<unsigned> &b) { a.push_back(10); b.push_back(11); } to two calls to the same push_back function, or fold away the two copies of push_back() in: struct T { int; }; struct S { char; }; vector<T*> t; vector<S*> s; void f(T *x) { t.push_back(x); } void g(S *x) { s.push_back(x); } but leave f() and g() separate, since they refer to two different global variables. llvm-svn: 103698
* Clear CachedFunctionInfo upon Pass::releaseMemory. Because ValueMap will abortNick Lewycky2010-05-121-0/+3
| | | | | | | | | | on RAUW of functions, this is a correctness issue instead of a mere memory usage problem. No testcase until the new MergeFunctions can land. llvm-svn: 103653
* I got tired of VISIBILITY_HIDDEN colliding with the gcc enum. Rename itDuncan Sands2010-05-112-3/+3
| | | | | | | to LLVM_LIBRARY_VISIBILITY and introduce LLVM_GLOBAL_VISIBILITY, which is the opposite, for future use by dragonegg. llvm-svn: 103495
* Fixes for Microsoft Visual Studio 2010, from Steven Watanabe!Douglas Gregor2010-05-112-2/+2
| | | | llvm-svn: 103457
* make simplifycfg insert an llvm.trap before the 'unreachable' it introducesChris Lattner2010-05-081-3/+11
| | | | | | | | | | | | | | | | | | | | | when it detects undefined behavior. llvm.trap generally codegens into some thing really small (e.g. a 2 byte ud2 instruction on x86) and debugging this sort of thing is "nontrivial". For example, we now compile: void foo() { *(int*)0 = 42; } into: _foo: pushl %ebp movl %esp, %ebp ud2 Some may even claim that this is a security hole, though that seems dubious to me. This addresses rdar://7958343 - Optimizing away null dereference potentially allows arbitrary code execution llvm-svn: 103356
* Teach instcombine to transform a bitcast/(zext|trunc)/bitcast sequenceChris Lattner2010-05-081-0/+70
| | | | | | | | | | | with a vector input and output into a shuffle vector. This sort of sequence happens when the input code stores with one type and reloads with another type and then SROA promotes to i96 integers, which make everyone sad. This fixes rdar://7896024 llvm-svn: 103354
* Fix PR7052, patch by Jakub Staszak!Chris Lattner2010-05-081-3/+3
| | | | llvm-svn: 103347
* When pruning candidate formulae out of an LSRUse, update theDan Gohman2010-05-071-3/+11
| | | | | | | | | | | | | LSRUse's Regs set after all pruning is done, rather than trying to do it on the fly, which can produce an incomplete result. This fixes a case where heuristic pruning was stripping all formulae from a use, which led the solver to enter an infinite loop. Also, add a few asserts to diagnose this kind of situation. llvm-svn: 103328
* Wrap const MDNode * inside DIDescriptor.Devang Patel2010-05-071-1/+1
| | | | llvm-svn: 103295
* Use overloaded operators instead of DIDescriptor::getNode()Devang Patel2010-05-072-2/+2
| | | | llvm-svn: 103276
* Update CMake build.Ted Kremenek2010-05-071-0/+1
| | | | llvm-svn: 103266
* Add an LLVM IR version of code sinking. This uses the same simple algorithmDan Gohman2010-05-071-0/+267
| | | | | | as MachineSink, but it isn't constrained by MachineInstr-level details. llvm-svn: 103257
* Use the right version of "append" to combine two SmallVectors.Bob Wilson2010-05-051-1/+1
| | | | | | This fixes the compile-time regressions seen in last night's tests. llvm-svn: 103118
* Combine the implementations of the core part of the SSAUpdater andBob Wilson2010-05-041-429/+102
| | | | | | MachineSSAUpdater to avoid duplicating all the code. llvm-svn: 103060
* Defer adding critical edges to the "toSplit" list until after checking forBob Wilson2010-05-041-4/+5
| | | | | | | | indirect branches in all the predecessors. This avoids unnecessarily splitting edges in cases where load PRE is not possible anyway. Thanks to Jakub Staszak for pointing this out. llvm-svn: 103034
* Use getConstant instead of getIntegerSCEV. The two are basically theDan Gohman2010-05-032-18/+17
| | | | | | same, now that getConstant has overloads consistent with ConstantInt::get. llvm-svn: 102965
* Check for side effects before splitting loop.Devang Patel2010-05-031-0/+19
| | | | | | Patch by Jakub Staszak! llvm-svn: 102928
* revert r102831. We already delete dead readonly calls inChris Lattner2010-05-011-8/+1
| | | | | | | other places, killing a valid transformation is not the right answer. llvm-svn: 102850
* Disable the call-deletion transformation introduced in r86975. WithoutOwen Anderson2010-05-011-1/+8
| | | | | | | | | | halting analysis, it is illegal to delete a call to a read-only function. The correct solution is almost certainly to add a "must halt" attribute and only allow deletions in its presence. XFAIL the relevant testcase for now. llvm-svn: 102831
OpenPOWER on IntegriCloud