summaryrefslogtreecommitdiff
path: root/lib/Transforms
Commit message (Collapse)AuthorAge
* Add initialization routines for Instrumentation.Owen Anderson2010-10-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115971 91177308-0d34-0410-b5e6-96231b3b80d8
* Add initialization routines to InstCombine.Owen Anderson2010-10-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115965 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an initialization routine for libLLVMipo.aOwen Anderson2010-10-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115933 91177308-0d34-0410-b5e6-96231b3b80d8
* Next step on the getting-rid-of-static-ctors train: begin adding per-libraryOwen Anderson2010-10-07
| | | | | | | | initialization functions that initialize the set of passes implemented in that library. Add C bindings for these functions as well. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115927 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the pass initialization helper functions into the llvm namespace, and addOwen Anderson2010-10-07
| | | | | | | | a header declaring them all. This is also where we will declare per-library pass-set initializer functions down the road. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115900 91177308-0d34-0410-b5e6-96231b3b80d8
* Since the Hello pass is built as a loadable dynamic library, don't try to ↵Owen Anderson2010-10-07
| | | | | | convert it to new-style registration yet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115881 91177308-0d34-0410-b5e6-96231b3b80d8
* Now that the profitable bits of EnableFullLoadPRE have been enabled by ↵Owen Anderson2010-10-01
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115337 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the other half of the alignment changing issue by making sure that theEric Christopher2010-10-01
| | | | | | | | | memcpy alignment is the minimum of the incoming alignments. Fixes PR 8266. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115305 91177308-0d34-0410-b5e6-96231b3b80d8
* fix PR8267 - Instcombine shouldn't optimizer away volatile memcpy's.Chris Lattner2010-10-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115296 91177308-0d34-0410-b5e6-96231b3b80d8
* Massive rewrite of MMX: Dale Johannesen2010-09-30
| | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115243 91177308-0d34-0410-b5e6-96231b3b80d8
* We do want to allow LoadPRE to perform LICM-like transformations: we already ↵Owen Anderson2010-09-30
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115205 91177308-0d34-0410-b5e6-96231b3b80d8
* Try again to disable critical edge splitting in CodeGenPrepare.Jakob Stoklund Olesen2010-09-30
| | | | | | The bug that broke i386 linux has been fixed in r115191. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115204 91177308-0d34-0410-b5e6-96231b3b80d8
* Tighten up prototype verification of strchr and strrchr to avoid a crash in ↵Benjamin Kramer2010-09-30
| | | | | | the very unlikely case that someone passes an integer > i64 to strchr. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115144 91177308-0d34-0410-b5e6-96231b3b80d8
* Add constant folding for strspn and strcspn to SimplifyLibCalls.Benjamin Kramer2010-09-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115116 91177308-0d34-0410-b5e6-96231b3b80d8
* Add strpbrk folding to SimplifyLibCalls.Benjamin Kramer2010-09-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115111 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify the loop in StrChrOptimizer. FileCheckize test.Benjamin Kramer2010-09-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115095 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach SimplifyLibCalls how to optimize strrchr.Benjamin Kramer2010-09-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115091 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR8247: JumpThreading can cause a block to become unreachable while ↵Owen Anderson2010-09-29
| | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115082 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r114919, which caused some serious regressions on ARM.Owen Anderson2010-09-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115053 91177308-0d34-0410-b5e6-96231b3b80d8
* Removed a bunch of unnecessary target_link_libraries.Oscar Fuentes2010-09-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114999 91177308-0d34-0410-b5e6-96231b3b80d8
* Weight loop unrolling counts by nesting depth. Unrolling deeply nested loops ↵Owen Anderson2010-09-27
| | | | | | | | | | | | 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>. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114919 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Disable codegen prepare critical edge splitting. Machine instruction ↵Jakob Stoklund Olesen2010-09-27
| | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114859 91177308-0d34-0410-b5e6-96231b3b80d8
* Delete an unused function.Dan Gohman2010-09-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114841 91177308-0d34-0410-b5e6-96231b3b80d8
* LoadPRE was not properly checking that the load it was PRE'ing ↵Owen Anderson2010-09-25
| | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114785 91177308-0d34-0410-b5e6-96231b3b80d8
* If we're changing the source of a memcpy we need to use the alignmentEric Christopher2010-09-25
| | | | | | | | | | of the source, not the original alignment since it may no longer be valid. Fixes rdar://8400094 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114781 91177308-0d34-0410-b5e6-96231b3b80d8
* Get rid of pop_macro warnings on MSVC.Michael J. Spencer2010-09-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114750 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix llvm-extract so that it changes the linkage of all GlobalValues toBob Wilson2010-09-23
| | | | | | | | "external" even when doing lazy bitcode loading. This was broken because a function that is not materialized fails the !isDeclaration() test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114666 91177308-0d34-0410-b5e6-96231b3b80d8
* Disable codegen prepare critical edge splitting. Machine instruction passes nowEvan Cheng2010-09-23
| | | | | | | break critical edges on demand. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114633 91177308-0d34-0410-b5e6-96231b3b80d8
* When moving zext/sext to be folded with a load, ignore the issue of whetherBob Wilson2010-09-22
| | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114568 91177308-0d34-0410-b5e6-96231b3b80d8
* Move a sign-extend or a zero-extend of a load to the same basic block as theBob Wilson2010-09-21
| | | | | | | | load when the type of the load is not legal, even if truncates are not free. The load is going to be legalized to an extending load anyway. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114488 91177308-0d34-0410-b5e6-96231b3b80d8
* Clarify a comment.Bob Wilson2010-09-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114487 91177308-0d34-0410-b5e6-96231b3b80d8
* do not rely on the implicit-dereference semantics of dyn_cast_or_nullGabor Greif2010-09-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114278 91177308-0d34-0410-b5e6-96231b3b80d8
* do not rely on the implicit-dereference semantics of dyn_cast_or_nullGabor Greif2010-09-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114277 91177308-0d34-0410-b5e6-96231b3b80d8
* Use a depth-first iteratation in CorrelatedValuePropagation to avoid wasting ↵Owen Anderson2010-09-16
| | | | | | | | | time trying to optimize unreachable blocks. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114105 91177308-0d34-0410-b5e6-96231b3b80d8
* When substituting sunkaddrs into indirect arguments an asm, we wereDale Johannesen2010-09-16
| | | | | | | | | | | walking the asm arguments once and stashing their Values. This is wrong because the same memory location can be in the list twice, and if the first one has a sunkaddr substituted, the stashed value for the second one will be wrong (use-after-free). PR 8154. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114104 91177308-0d34-0410-b5e6-96231b3b80d8
* fix PR8144, a bug where constant merge would merge globals markedChris Lattner2010-09-15
| | | | | | | attribute(used). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113911 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the option to disable LazyValueInfo in JumpThreading, as it is nowOwen Anderson2010-09-14
| | | | | | | on by default and has received significant testing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113852 91177308-0d34-0410-b5e6-96231b3b80d8
* fix PR8102, a case where we'd copyValue from a value that we alreadyChris Lattner2010-09-14
| | | | | | | | | deleted. Fix this by doing the copyValue's before we delete stuff! The testcase only repros the problem on my system with valgrind. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113820 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally."Michael J. Spencer2010-09-13
| | | | | | | | | | This reverts commit r113632 Conflicts: cmake/modules/AddLLVM.cmake git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113819 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused variable.Eric Christopher2010-09-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113769 91177308-0d34-0410-b5e6-96231b3b80d8
* Added skeleton for inline asm multiple alternative constraint support.John Thompson2010-09-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113766 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-apply r113679, which was reverted in r113720, which added a paid of new ↵Owen Anderson2010-09-13
| | | | | | | | | | instcombine transforms to expose greater opportunities for store narrowing in codegen. This patch fixes a potential infinite loop in instcombine caused by one of the introduced transforms being overly aggressive. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113763 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert 113679, it was causing an infinite loop in a testcase that I've sentEric Christopher2010-09-12
| | | | | | | on to Owen. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113720 91177308-0d34-0410-b5e6-96231b3b80d8
* Invert and-of-or into or-of-and when doing so would allow us to clear bits ↵Owen Anderson2010-09-11
| | | | | | | | | | | | | | | of the and's mask. This can result in increased opportunities for store narrowing in code generation. Update a number of tests for this change. This fixes <rdar://problem/8285027>. Additionally, because this inverts the order of ors and ands, some patterns for optimizing or-of-and-of-or no longer fire in instances where they did originally. Add a simple transform which recaptures most of these opportunities: if we have an or-of-constant-or and have failed to fold away the inner or, commute the order of the two ors, to give the non-constant or a chance for simplification instead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113679 91177308-0d34-0410-b5e6-96231b3b80d8
* typoesGabor Greif2010-09-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113647 91177308-0d34-0410-b5e6-96231b3b80d8
* CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally.Michael J. Spencer2010-09-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113632 91177308-0d34-0410-b5e6-96231b3b80d8
* This transform is also performed by InstructionSimplify, remove the duplicate.Benjamin Kramer2010-09-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113608 91177308-0d34-0410-b5e6-96231b3b80d8
* Lower the unrolling theshold to 150. Empirical tests indicate that this is ↵Owen Anderson2010-09-10
| | | | | | | | | a sweet spot in the performance per code size increase curve. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113595 91177308-0d34-0410-b5e6-96231b3b80d8
* What the loop unroller cares about, rather than just not unrolling loops ↵Owen Anderson2010-09-09
| | | | | | | | | | | | with calls, is not unrolling loops that contain calls that would be better off getting inlined. This mostly comes up when an interleaved devirtualization pass has devirtualized a call which the inliner will inline on a future pass. Thus, rather than blocking all loops containing calls, add a metric for "inline candidate calls" and block loops containing those instead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113535 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r113439, which relaxed the requirement that loops containing calls ↵Owen Anderson2010-09-09
| | | | | | | | | cannot be unrolled. After some discussion, there seems to be a better way to achieve the same effect. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113528 91177308-0d34-0410-b5e6-96231b3b80d8