summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* SLPVectorizer: Don't vectorize volatile memory operationsArnold Schwaighofer2013-10-161-3/+8
| | | | | | | | | | radar://15231682 Reapply r192799, http://lab.llvm.org:8011/builders/lldb-x86_64-debian-clang/builds/8226 showed that the bot is still broken even with this out. llvm-svn: 192820
* Revert "SLPVectorizer: Don't vectorize volatile memory operations"Arnold Schwaighofer2013-10-161-8/+3
| | | | | | This speculatively reverts commit 192799. It might have broken a linux buildbot. llvm-svn: 192816
* SLPVectorizer: Don't vectorize volatile memory operationsArnold Schwaighofer2013-10-161-3/+8
| | | | | | radar://15231682 llvm-svn: 192799
* [asan] Optimize accesses to global arrays with constant indexKostya Serebryany2013-10-161-6/+33
| | | | | | | | | | | | | | | | | | | | Summary: Given a global array G[N], which is declared in this CU and has static initializer avoid instrumenting accesses like G[i], where 'i' is a constant and 0<=i<N. Also add a bit of stats. This eliminates ~1% of instrumentations on SPEC2006 and also partially helps when asan is being run together with coverage. Reviewers: samsonov Reviewed By: samsonov CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1947 llvm-svn: 192794
* LoopVectorize: Properly reflect PODness in comments.Benjamin Kramer2013-10-151-4/+4
| | | | llvm-svn: 192717
* Remove x86_sse42_crc32_64_8 intrinsic. It has no functional difference from ↵Craig Topper2013-10-151-1/+0
| | | | | | x86_sse42_crc32_32_8 and was not mapped to a clang builtin. I'm not even sure why this form of the instruction is even called out explicitly in the docs. Also add AutoUpgrade support to convert it into the other intrinsic with appropriate trunc and zext. llvm-svn: 192672
* Remove lib/Transforms/Instrumentation/ProfilingUtils.*Rafael Espindola2013-10-144-207/+0
| | | | | | | | They were leftover from the old profiling support. Patch by Alastair Murray. llvm-svn: 192605
* Basic blocks typically have few predecessors. Use a SmallDenseMap toChris Lattner2013-10-141-3/+3
| | | | | | avoid a heap allocation when this is the case. llvm-svn: 192602
* [msan] Instrument x86.*_cvt* intrinsics.Evgeniy Stepanov2013-10-141-28/+149
| | | | | | | | Currently MSan checks that arguments of *cvt* intrinsics are fully initialized. That's too much to ask: some of them only operate on lower half, or even quarter, of the input register. llvm-svn: 192599
* [msan] Fix handling of scalar select of vectors.Evgeniy Stepanov2013-10-141-4/+4
| | | | llvm-svn: 192575
* SLPVectorizer: Sort PHINodes based on their opcodeArnold Schwaighofer2013-10-121-23/+44
| | | | | | | | | | | | | | Before this patch we relied on the order of phi nodes when we looked for phi nodes of the same type. This could prevent vectorization of cases where there was a phi node of a second type in between phi nodes of some type. This is important for vectorization of an internal graphics kernel. On the test suite + external on x86_64 (and on a run on armv7s) it showed no impact on either performance or compile time. radar://15024459 llvm-svn: 192537
* LoopVectorize: Add missing INITIALIZE_PASS_DEPENDENCY macrosTobias Grosser2013-10-121-0/+3
| | | | | Contributed-by: Peter Zotov <whitequark@whitequark.org> llvm-svn: 192536
* Better info when debugging vectorizerRenato Golin2013-10-111-6/+5
| | | | llvm-svn: 192460
* Fix a bug in Dead Argument Elimination.Shuxin Yang2013-10-091-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a function seen at compile time is not necessarily the one linked to the binary being built, it is illegal to change the actual arguments passing to it. e.g. -------------------------- void foo(int lol) { // foo() has linkage satisifying isWeakForLinker() // "lol" is not used at all. } void bar(int lo2) { // xform to foo(undef) is illegal, as compiler dose not know which // instance of foo() will be linked to the the binary being built. foo(lol2); } ----------------------------- Such functions can be captured by isWeakForLinker(). NOTE that mayBeOverridden() is insufficient for this purpose as it dosen't include linkage types like AvailableExternallyLinkage and LinkOnceODRLinkage. Take link_odr* as an example, it indicates a set of *EQUIVALENT* globals that can be merged at link-time. However, the semantic of *EQUIVALENT*-functions includes parameters. Changing parameters breaks the assumption. Thank John McCall for help, especially for the explanation of subtle difference between linkage types. rdar://11546243 llvm-svn: 192302
* LoopVectorize: External uses must use the last value in a reduction cycleArnold Schwaighofer2013-10-071-0/+6
| | | | | | | | | Otherwise, we don't perform operations that would have been performed on the scalar version. Fixes PR17498. llvm-svn: 192133
* Revert r191834 until we measure the effect of this benchmarks and maybe find ↵Alexey Samsonov2013-10-071-3/+56
| | | | | | a better way to fix it llvm-svn: 192121
* UpdatePHINodes in BasicBlockUtils should not crash on duplicate predecessorsHal Finkel2013-10-041-2/+6
| | | | | | | | | | | UpdatePHINodes has an optimization to reuse an existing PHI node, where it first deletes all of its entries and then replaces them. Unfortunately, in the case where we had duplicate predecessors (which are allowed so long as the associated PHI entries have the same value), the loop removing the existing PHI entries from the to-be-reused PHI would assert (if that PHI was not the one which had the duplicates). llvm-svn: 192001
* SLPVectorizer: Sort inputs to commutative binary operationsArnold Schwaighofer2013-10-041-4/+123
| | | | | | | | | | | | | | | | | | | | | | | Sort the operands of the other entries in the current vectorization root according to the first entry's operands opcodes. %conv0 = uitofp ... %load0 = load float ... = fmul %conv0, %load0 = fmul %load0, %conv1 = fmul %load0, %conv2 Make sure that we recursively vectorize <%conv0, %conv1, %conv2> and <%load0, %load0, %load0>. This makes it more likely to obtain vectorizable trees. We have to be careful when we sort that we don't destroy 'good' existing ordering implied by source order. radar://15080067 llvm-svn: 191977
* Pull fptrunc's upwards through selects when one of the select's selectands ↵Owen Anderson2013-10-031-0/+13
| | | | | | was a constant. This has a number of benefits, including producing small immediates (easier to materialize, smaller constant pools) as well as being more likely to allow the fptrunc to fuse with a preceding instruction (truncating selects are unusual). llvm-svn: 191929
* Optimize linkonce_odr unnamed_addr functions during LTO.Rafael Espindola2013-10-033-11/+39
| | | | | | | | | | | Generalize the API so we can distinguish symbols that are needed just for a DSO symbol table from those that are used from some native .o. The symbols that are only wanted for the dso symbol table can be dropped if llvm can prove every other dso has a copy (linkonce_odr) and the address is not important (unnamed_addr). llvm-svn: 191922
* Make gep i8* X, -(ptrtoint Y) transform work with address spacesMatt Arsenault2013-10-031-8/+10
| | | | llvm-svn: 191920
* Don't use runtime bounds check between address spaces.Matt Arsenault2013-10-021-11/+49
| | | | | | | | | Don't vectorize with a runtime check if it requires a comparison between pointers with different address spaces. The values can't be assumed to be directly comparable. Previously it would create an illegal bitcast. llvm-svn: 191862
* Apply slp vectorization on fully-vectorizable tree of height 2Yi Jiang2013-10-021-4/+21
| | | | llvm-svn: 191852
* Fix debug printing spacing.Matt Arsenault2013-10-021-32/+33
| | | | | | Fix missing newlines, missing and extra spaces in printed messages. llvm-svn: 191851
* Fix comment grammar and capitalization.Matt Arsenault2013-10-021-3/+3
| | | | llvm-svn: 191850
* SLPVectorizer: Make store chain finding more aggressive with ↵Benjamin Kramer2013-10-021-9/+4
| | | | | | | | | GetUnderlyingObject. This recursively strips all GEPs like the existing code. It also handles bitcasts and other operations that do not change the pointer value. llvm-svn: 191847
* StructurizeCFG: Add dependency on LowerSwitch passTom Stellard2013-10-021-1/+3
| | | | | | | | Switch instructions were crashing the StructurizeCFG pass, and it's probably easier anyway if we don't need to handle them in this pass. Reviewed-by: Christian König <christian.koenig@amd.com> llvm-svn: 191841
* Remove the very substantial, largely unmaintained legacy PGOChandler Carruth2013-10-028-1794/+1
| | | | | | | | | | | | | | | | | | | | infrastructure. This was essentially work toward PGO based on a design that had several flaws, partially dating from a time when LLVM had a different architecture, and with an effort to modernize it abandoned without being completed. Since then, it has bitrotted for several years further. The result is nearly unusable, and isn't helping any of the modern PGO efforts. Instead, it is getting in the way, adding confusion about PGO in LLVM and distracting everyone with maintenance on essentially dead code. Removing it paves the way for modern efforts around PGO. Among other effects, this removes the last of the runtime libraries from LLVM. Those are being developed in the separate 'compiler-rt' project now, with somewhat different licensing specifically more approriate for runtimes. llvm-svn: 191835
* Remove "localize global" optimizationAlexey Samsonov2013-10-021-56/+3
| | | | | | | | | | | | | | | | Summary: As discussed in http://llvm-reviews.chandlerc.com/D1754, this optimization isn't really valid for C, and fires too rarely anyway. Reviewers: rafael, nicholas Reviewed By: nicholas CC: rnk, llvm-commits, nicholas Differential Revision: http://llvm-reviews.chandlerc.com/D1769 llvm-svn: 191834
* Don't merge tiny functions.Matt Arsenault2013-10-011-0/+12
| | | | | | | | | | | | | | | | | | | | | It's silly to merge functions like these: define void @foo(i32 %x) { ret void } define void @bar(i32 %x) { ret void } to get define void @bar(i32) { tail call void @foo(i32 %0) ret void } llvm-svn: 191786
* Remove several unused variables.Rafael Espindola2013-10-015-6/+1
| | | | | | Patch by Alp Toker. llvm-svn: 191757
* Fix code duplicationMatt Arsenault2013-10-011-21/+10
| | | | llvm-svn: 191716
* Use right address space size in InstCombineComparesMatt Arsenault2013-09-301-3/+6
| | | | | | | The test's output doesn't change, but this ensures this is actually hit with a different address space. llvm-svn: 191701
* Constant fold ptrtoint + compare with address spacesMatt Arsenault2013-09-301-1/+1
| | | | llvm-svn: 191699
* BoundsChecking: Fix refacto.Benjamin Kramer2013-09-301-0/+1
| | | | llvm-svn: 191676
* Convert manual insert point restores to the new RAII object.Benjamin Kramer2013-09-303-13/+3
| | | | llvm-svn: 191675
* InstCombine: Replace manual fast math flag copying with the new IRBuilder ↵Benjamin Kramer2013-09-301-22/+20
| | | | | | | | | RAII helper. Defines away the issue where cast<Instruction> would fail because constant folding happened. Also slightly cleaner. llvm-svn: 191674
* IRBuilder: Add RAII objects to reset insertion points or fast math flags.Benjamin Kramer2013-09-301-21/+1
| | | | | | | | Inspired by the object from the SLPVectorizer. This found a minor bug in the debug loc restoration in the vectorizer where the location of a following instruction was attached instead of the location from the original instruction. llvm-svn: 191673
* Fix a bug in InstCombine where it attempted to cast a Value* to an Instruction*Joey Gouly2013-09-301-2/+2
| | | | | | | | | when it was actually a Constant*. There are quite a few other casts to Instruction that might have the same problem, but this is the only one I have a test case for. llvm-svn: 191668
* Even more spelling fixes for "instruction".Robert Wilhelm2013-09-283-4/+4
| | | | llvm-svn: 191611
* Fix spelling intruction -> instruction.Robert Wilhelm2013-09-282-2/+2
| | | | llvm-svn: 191610
* Use right pointer type in DebugIRMatt Arsenault2013-09-271-1/+1
| | | | llvm-svn: 191576
* Use type helper functionsMatt Arsenault2013-09-272-3/+2
| | | | llvm-svn: 191574
* Fix SLPVectorizer using wrong address space for load/storeMatt Arsenault2013-09-271-4/+7
| | | | llvm-svn: 191564
* InstCombine: Only foldSelectICmpAndOr for integer typesJustin Bogner2013-09-271-1/+1
| | | | | | | | | | Currently foldSelectICmpAndOr asserts if the "or" involves a vector containing several of the same power of two. We can easily avoid this by only performing the fold on integer types, like foldSelectICmpAnd does. Fixes <rdar://problem/15012516> llvm-svn: 191552
* Transforms: Use getFirstNonPHI to set the insertion point for PHIsJustin Bogner2013-09-272-2/+2
| | | | | | | | | | We were previously using getFirstInsertionPt to insert PHI instructions when vectorizing, but getFirstInsertionPt also skips past landingpads, causing this to generate invalid IR. We can avoid this issue by using getFirstNonPHI instead. llvm-svn: 191526
* First check in. Modified a comment.Puyan Lotfi2013-09-271-1/+1
| | | | llvm-svn: 191491
* SLPVectorize: Put horizontal reductions feeding a store under separate flagArnold Schwaighofer2013-09-251-13/+18
| | | | | | | Put them under a separate flag for experimentation. They are more likely to interfere with loop vectorization which happens later in the pass pipeline. llvm-svn: 191371
* [msan] Fix -Wreturn-type warnings in non-self-hosted build.Evgeniy Stepanov2013-09-251-0/+2
| | | | llvm-svn: 191361
* set the cost of tiny trees to INT_MAX in SLP vectorizer to disable ↵Yi Jiang2013-09-241-1/+1
| | | | | | vectorization on them llvm-svn: 191314
OpenPOWER on IntegriCloud