summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar
Commit message (Collapse)AuthorAgeFilesLines
* Add helper functions for computing the Location of load, store,Dan Gohman2010-11-112-10/+3
| | | | | | and vaarg instructions. llvm-svn: 118845
* Make Sink tbaa-aware.Dan Gohman2010-11-111-1/+4
| | | | llvm-svn: 118788
* It's safe to sink some instructions which are not safe to speculativelyDan Gohman2010-11-111-1/+4
| | | | | | execute. Make Sink's predicate more precise. llvm-svn: 118787
* Enhance GVN to do more precise alias queries for non-local memoryDan Gohman2010-11-101-2/+4
| | | | | | | | | | | | | | | references. For example, this allows gvn to eliminate the load in this example: void foo(int n, int* p, int *q) { p[0] = 0; p[1] = 1; if (n) { *q = p[0]; } } llvm-svn: 118714
* Use getValueOperand() and getPointerOperand() on load and storeDan Gohman2010-11-101-12/+13
| | | | | | instructions instead of hard-coding operand numbers. llvm-svn: 118698
* Teach LICM and AliasSetTracker about AccessesArgumentsReadonly.Dan Gohman2010-11-091-1/+1
| | | | llvm-svn: 118618
* Give up on doing in-line instruction simplification during correlated value ↵Owen Anderson2010-10-291-10/+1
| | | | | | | | | | | | | propagation. Instruction simplification needs to be guaranteed never to be run on an unreachable block. However, earlier block simplifications may have changed the CFG to make block that were reachable when we began our iteration unreachable by the time we try to simplify them. (Note that this also means that our depth-first iterators were potentially being invalidated). This should not have a large impact on code quality, since later runs of instcombine should pick up these simplifications. Fixes PR8506. llvm-svn: 117709
* Inline asm multiple alternative constraints development phase 2 - improved ↵John Thompson2010-10-291-1/+1
| | | | | | basic logic, added initial platform support. llvm-svn: 117667
* Reapply r116831 and r116839, converting AliasAnalysis to useDan Gohman2010-10-194-17/+19
| | | | | | uint64_t, plus fixes for places I missed before. llvm-svn: 116875
* Revert r116831 and r116839, which are breaking selfhost builds.Dan Gohman2010-10-192-4/+4
| | | | llvm-svn: 116858
* Passes do not need to recursively initialize passes that they preserve, ifOwen Anderson2010-10-196-10/+2
| | | | | | | they do not also require them. This allows us to reduce inter-pass linkage dependencies. llvm-svn: 116854
* Oops, check in all the files for converting AliasAnalysis toDan Gohman2010-10-192-4/+4
| | | | | | use uint64_t. llvm-svn: 116839
* Get rid of static constructors for pass registration. Instead, every pass ↵Owen Anderson2010-10-1929-30/+91
| | | | | | | | | | | | | | | | | exposes an initializeMyPassFunction(), which must be called in the pass's constructor. This function uses static dependency declarations to recursively initialize the pass's dependencies. Clients that only create passes through the createFooPass() APIs will require no changes. Clients that want to use the CommandLine options for passes will need to manually call the appropriate initialization functions in PassInitialization.h before parsing commandline arguments. I have tested this with all standard configurations of clang and llvm-gcc on Darwin. It is possible that there are problems with the static dependencies that will only be visible with non-standard options. If you encounter any crash in pass registration/creation, please send the testcase to me directly. llvm-svn: 116820
* Consistently use AliasAnalysis::UnknownSize instead of hardcoding ~0u.Dan Gohman2010-10-192-5/+5
| | | | llvm-svn: 116815
* Make AliasSetTracker TBAA-aware, enabling TBAA-enabled LICM.Dan Gohman2010-10-181-3/+6
| | | | llvm-svn: 116743
* Eliminate some calls to Value::getNameStr.Benjamin Kramer2010-10-161-1/+1
| | | | llvm-svn: 116670
* Generalize MemCpyOpt's handling of call slot forwarding to function properly ↵Owen Anderson2010-10-151-18/+48
| | | | | | | | when the call slot forwarding is implemented with a load/store pair rather than a memcpy. llvm-svn: 116637
* Be more consistent in using ValueToValueMapTy.Rafael Espindola2010-10-131-5/+5
| | | | llvm-svn: 116387
* Begin adding static dependence information to passes, which will allow us toOwen Anderson2010-10-1216-18/+100
| | | | | | | | | perform initialization without static constructors AND without explicit initialization by the client. For the moment, passes are required to initialize both their (potential) dependencies and any passes they preserve. I hope to be able to relax the latter requirement in the future. llvm-svn: 116334
* Filter out illegal formulae after updating offsets, not before, so thatDan Gohman2010-10-081-18/+18
| | | | | | | | | | formulae which become illegal as a result of the offset updating don't escape. This is for rdar://8529692. No testcase yet, because the given cases hit use-list ordering differences. llvm-svn: 116093
* Update CMake.Daniel Dunbar2010-10-081-1/+0
| | | | llvm-svn: 116034
* Delete the FormulaSorter class and inline its one method into itsDan Gohman2010-10-071-28/+10
| | | | | | | one user. This code will be restructured soon and FormulaSorter is getting in the way. llvm-svn: 116012
* Fix a spello.Dan Gohman2010-10-071-1/+1
| | | | llvm-svn: 116011
* Charge a formula for explicit multiplies on scaled registers too,Dan Gohman2010-10-071-3/+3
| | | | | | not just base registers. llvm-svn: 116010
* Use size_t for consistency.Dan Gohman2010-10-071-1/+1
| | | | llvm-svn: 116009
* When merging one use into another, transfer the offsets fromDan Gohman2010-10-071-0/+8
| | | | | | the old use to the new one. llvm-svn: 116008
* Fix LSR to keep the RegUseTracker up to date when combining users.Dan Gohman2010-10-071-8/+19
| | | | | | | | This doesn't usually matter, because the other heuristics usually succeed regardless, but it's good to keep the register use bookkeeping consistent. llvm-svn: 116005
* Remove LoopIndexSplit pass. It is neither maintained nor used by anyone.Devang Patel2010-10-072-1275/+0
| | | | llvm-svn: 116004
* Now with fewer extraneous semicolons!Owen Anderson2010-10-0730-32/+32
| | | | llvm-svn: 115996
* Next step on the getting-rid-of-static-ctors train: begin adding per-libraryOwen Anderson2010-10-071-2/+46
| | | | | | | initialization functions that initialize the set of passes implemented in that library. Add C bindings for these functions as well. llvm-svn: 115927
* Now that the profitable bits of EnableFullLoadPRE have been enabled by ↵Owen Anderson2010-10-011-8/+6
| | | | | | | | | default, rip out the remainder. Anyone interested in more general PRE would be better served by implementing it separately, to get real anticipation calculation, etc. llvm-svn: 115337
* Fix the other half of the alignment changing issue by making sure that theEric Christopher2010-10-011-3/+8
| | | | | | | | memcpy alignment is the minimum of the incoming alignments. Fixes PR 8266. llvm-svn: 115305
* Massive rewrite of MMX: Dale Johannesen2010-09-301-0/+6
| | | | | | | | | | | | | | | | | | | The x86_mmx type is used for MMX intrinsics, parameters and return values where these use MMX registers, and is also supported in load, store, and bitcast. Only the above operations generate MMX instructions, and optimizations do not operate on or produce MMX intrinsics. MMX-sized vectors <2 x i32> etc. are lowered to XMM or split into smaller pieces. Optimizations may occur on these forms and the result casted back to x86_mmx, provided the result feeds into a previous existing x86_mmx operation. The point of all this is prevent optimizations from introducing MMX operations, which is unsafe due to the EMMS problem. llvm-svn: 115243
* We do want to allow LoadPRE to perform LICM-like transformations: we already ↵Owen Anderson2010-09-301-13/+0
| | | | | | | | | consider PHI nodes to be negligible for code size (making this transform code size neutral), and it allows us to hoist values out of loops, which is always a good thing. llvm-svn: 115205
* Try again to disable critical edge splitting in CodeGenPrepare.Jakob Stoklund Olesen2010-09-301-1/+5
| | | | | | The bug that broke i386 linux has been fixed in r115191. llvm-svn: 115204
* Tighten up prototype verification of strchr and strrchr to avoid a crash in ↵Benjamin Kramer2010-09-301-2/+4
| | | | | | the very unlikely case that someone passes an integer > i64 to strchr. llvm-svn: 115144
* Add constant folding for strspn and strcspn to SimplifyLibCalls.Benjamin Kramer2010-09-301-9/+64
| | | | llvm-svn: 115116
* Add strpbrk folding to SimplifyLibCalls.Benjamin Kramer2010-09-291-7/+42
| | | | llvm-svn: 115111
* Simplify the loop in StrChrOptimizer. FileCheckize test.Benjamin Kramer2010-09-291-11/+4
| | | | llvm-svn: 115095
* Teach SimplifyLibCalls how to optimize strrchr.Benjamin Kramer2010-09-291-6/+44
| | | | llvm-svn: 115091
* Fix PR8247: JumpThreading can cause a block to become unreachable while ↵Owen Anderson2010-09-291-4/+4
| | | | | | | | | | still having predecessor, if it is part of a self-loop. Because of this, we cannot use the Simplify* APIs, as they can assert-fail on unreachable code. Since it's not easy to determine if a given threading will cause a block to become unreachable, simply defer simplifying simplification to later InstCombine and/or DCE passes. llvm-svn: 115082
* Revert r114919, which caused some serious regressions on ARM.Owen Anderson2010-09-291-6/+1
| | | | llvm-svn: 115053
* Removed a bunch of unnecessary target_link_libraries.Oscar Fuentes2010-09-281-2/+0
| | | | llvm-svn: 114999
* Weight loop unrolling counts by nesting depth. Unrolling deeply nested loops ↵Owen Anderson2010-09-271-1/+6
| | | | | | | | | | | tends to cause high register pressure and thus excess spills, which we don't currently recover from well. This should be re-evaluated in the future if our ability to generate good spills/splits improves. Partial fix for <rdar://problem/7635585>. llvm-svn: 114919
* Revert "Disable codegen prepare critical edge splitting. Machine instruction ↵Jakob Stoklund Olesen2010-09-271-5/+1
| | | | | | | | | | | | | | | passes now" This reverts revision 114633. It was breaking llvm-gcc-i386-linux-selfhost. It seems there is a downstream bug that is exposed by -cgp-critical-edge-splitting=0. When that bug is fixed, this patch can go back in. Note that the changes to tailcallfp2.ll are not reverted. They were good are required. llvm-svn: 114859
* Delete an unused function.Dan Gohman2010-09-271-2/+0
| | | | llvm-svn: 114841
* LoadPRE was not properly checking that the load it was PRE'ing ↵Owen Anderson2010-09-251-1/+7
| | | | | | | | | | | | | | post-dominated the block it was being hoisted to. Splitting critical edges at the merge point only addressed part of the issue; it is also possible for non-post-domination to occur when the path from the load to the merge has branches in it. Unfortunately, full anticipation analysis is time-consuming, so for now approximate it. This is strictly more conservative than real anticipation, so we will miss some cases that real PRE would allow, but we also no longer insert loads into paths where they didn't exist before. :-) This is a very slight net positive on SPEC for me (0.5% on average). Most of the benchmarks are largely unaffected, but when it pays off it pays off decently: 181.mcf improves by 4.5% on my machine. llvm-svn: 114785
* If we're changing the source of a memcpy we need to use the alignmentEric Christopher2010-09-251-3/+5
| | | | | | | | | of the source, not the original alignment since it may no longer be valid. Fixes rdar://8400094 llvm-svn: 114781
* Disable codegen prepare critical edge splitting. Machine instruction passes nowEvan Cheng2010-09-231-1/+5
| | | | | | break critical edges on demand. llvm-svn: 114633
* When moving zext/sext to be folded with a load, ignore the issue of whetherBob Wilson2010-09-221-1/+2
| | | | | | | | truncates are free only in the case where the extended type is legal but the load type is not. If both types are illegal, such as when they are too big, the load may not be legalized into an extended load. llvm-svn: 114568
OpenPOWER on IntegriCloud