summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms
Commit message (Collapse)AuthorAgeFilesLines
...
* Adding tests for DebugIR passDaniel Malea2013-06-287-0/+363
| | | | | | | | | | - lit tests verify that each line of input LLVM IR gets a !dbg node and a corresponding entry of metadata that contains the line number - unit tests verify that DebugIR works as advertised in the interface - refactored some useful IR generation functionality from the MCJIT unit tests so it can be reused llvm-svn: 185212
* Debug Info: clean up usage of Verify.Manman Ren2013-06-281-2/+2
| | | | | | | | | | | No functionality change. It should suffice to check the type of a debug info metadata, instead of calling Verify. For cases where we know the type of a DI metadata, use assert. Also update testing cases to make them conform to the format of DI classes. llvm-svn: 185135
* Convert tests to FileCheckMatt Arsenault2013-06-284-7/+14
| | | | llvm-svn: 185124
* LoopVectorize: Preserve debug location infoArnold Schwaighofer2013-06-281-0/+92
| | | | | | radar://14169017 llvm-svn: 185122
* LoopVectorize: Cache edge masks created during if-conversionArnold Schwaighofer2013-06-271-0/+243
| | | | | | | Otherwise, we end up with an exponential IR blowup. Fixes PR16472. llvm-svn: 185097
* LoopVectorize: Use vectorized loop invariant gep index anchored in loopArnold Schwaighofer2013-06-271-0/+36
| | | | | | | | | Use vectorized instruction instead of original instruction anchored in the original loop. Fixes PR16452 and t2075.c of PR16455. llvm-svn: 185081
* Update testing case to make DI nodes have the correct format.Manman Ren2013-06-271-3/+3
| | | | llvm-svn: 185061
* Fix spelling.Arnold Schwaighofer2013-06-271-1/+1
| | | | llvm-svn: 185052
* LoopVectorize: Don't store a reversed value in the vectorized value mapArnold Schwaighofer2013-06-271-0/+55
| | | | | | | | | | When we store values for reversed induction stores we must not store the reversed value in the vectorized value map. Another instruction might use this value. This fixes 3 test cases of PR16455. llvm-svn: 185051
* Added support for the Builtin attribute.Michael Gottesman2013-06-271-0/+12
| | | | | | | | The Builtin attribute is an attribute that can be placed on function call site that signal that even though a function is declared as being a builtin, rdar://problem/13727199 llvm-svn: 185049
* Erase all of the instructions that we RAUWedNadav Rotem2013-06-261-1/+1
| | | | llvm-svn: 184969
* Do not add cse-ed instructions into the visited map because we dont want to ↵Nadav Rotem2013-06-261-0/+84
| | | | | | consider them as a candidate for replacement of instructions to be visited. llvm-svn: 184966
* SLPVectorizer: support slp-vectorization of PHINodes between basic blocksNadav Rotem2013-06-251-0/+46
| | | | llvm-svn: 184888
* Fix SROA to avoid unnecessary scalar conversions for 1-element vectors.Bob Wilson2013-06-251-0/+24
| | | | | | | | | | | When a 1-element vector alloca is promoted, a store instruction can often be rewritten without converting the value to a scalar and using an insertelement instruction to stuff it into the new alloca. This patch just adds a check to skip that conversion when it is unnecessary. This turns out to be really important for some ARM Neon operations where <1 x i64> is used to get around the fact that i64 is not a legal type. llvm-svn: 184870
* Reapply 184685 after the SetVector iteration order fix.Arnold Schwaighofer2013-06-243-2/+224
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This should hopefully have fixed the stage2/stage3 miscompare on the dragonegg testers. "LoopVectorize: Use the dependence test utility class We now no longer need alias analysis - the cases that alias analysis would handle are now handled as accesses with a large dependence distance. We can now vectorize loops with simple constant dependence distances. for (i = 8; i < 256; ++i) { a[i] = a[i+4] * a[i+8]; } for (i = 8; i < 256; ++i) { a[i] = a[i-4] * a[i-8]; } We would be able to vectorize about 200 more loops (in many cases the cost model instructs us no to) in the test suite now. Results on x86-64 are a wash. I have seen one degradation in ammp. Interestingly, the function in which we now vectorize a loop is never executed so we probably see some instruction cache effects. There is a 2% improvement in h264ref. There is one or the other TSCV loop kernel that speeds up. radar://13681598" llvm-svn: 184724
* Revert "LoopVectorize: Use the dependence test utility class"Arnold Schwaighofer2013-06-243-224/+2
| | | | | | | | This reverts commit cbfa1ca993363ca5c4dbf6c913abc957c584cbac. We are seeing a stage2 and stage3 miscompare on some dragonegg bots. llvm-svn: 184690
* LoopVectorize: Use the dependence test utility classArnold Schwaighofer2013-06-243-2/+224
| | | | | | | | | | | | | | | | | | | | | | | | | | | We now no longer need alias analysis - the cases that alias analysis would handle are now handled as accesses with a large dependence distance. We can now vectorize loops with simple constant dependence distances. for (i = 8; i < 256; ++i) { a[i] = a[i+4] * a[i+8]; } for (i = 8; i < 256; ++i) { a[i] = a[i-4] * a[i-8]; } We would be able to vectorize about 200 more loops (in many cases the cost model instructs us no to) in the test suite now. Results on x86-64 are a wash. I have seen one degradation in ammp. Interestingly, the function in which we now vectorize a loop is never executed so we probably see some instruction cache effects. There is a 2% improvement in h264ref. There is one or the other TSCV loop kernel that speeds up. radar://13681598 llvm-svn: 184685
* SLP Vectorizer: Add support for vectorizing parts of the tree.Nadav Rotem2013-06-241-0/+46
| | | | | | | | | | | | Untill now we detected the vectorizable tree and evaluated the cost of the entire tree. With this patch we can decide to trim-out branches of the tree that are not profitable to vectorizer. Also, increase the max depth from 6 to 12. In the worse possible case where all of the code is made of diamond-shaped graph this can bring the cost to 2**10, but diamonds are not very common. llvm-svn: 184681
* SLP Vectorizer: Fix a bug in the code that does CSE on the generated gather ↵Nadav Rotem2013-06-231-0/+51
| | | | | | | | sequences. Make sure that we don't replace and RAUW two sequences if one does not dominate the other. llvm-svn: 184674
* SLP Vectorizer: Implement a simple CSE optimization for the gather sequences.Nadav Rotem2013-06-231-0/+85
| | | | llvm-svn: 184660
* SLP Vectorizer: Implement multi-block slp-vectorization.Nadav Rotem2013-06-223-5/+60
| | | | | | | | | Rewrote the SLP-vectorization as a whole-function vectorization pass. It is now able to vectorize chains across multiple basic blocks. It still does not vectorize PHIs, but this should be easy to do now that we scan the entire function. I removed the support for extracting values from trees. We are now able to vectorize more programs, but there are some serious regressions in many workloads (such as flops-6 and mandel-2). llvm-svn: 184647
* SLPVectorization: Add a basic support for cross-basic block slp vectorization.Nadav Rotem2013-06-201-0/+54
| | | | | | | We collect gather sequences when we vectorize basic blocks. Gather sequences are excellent hints for vectorization of other basic blocks. llvm-svn: 184444
* Move StructurizeCFG out of R600 to generic Transforms.Matt Arsenault2013-06-192-0/+51
| | | | | | Register it with PassManager llvm-svn: 184343
* LSR: Fix the parameters used to compute the scaling factor cost.Quentin Colombet2013-06-191-0/+68
| | | | | | | | | | | | | Prior to this change, the considered addressing modes may be invalid since the maximum and minimum offsets were not taking into account. This was causing an assertion failure. The added test case exercices that behavior. <rdar://problem/14199725> Assertion failed: (CurScaleCost >= 0 && "Legal addressing mode has an illegal cost!") llvm-svn: 184341
* SLPVectorizer: handle scalars that are extracted from vectors (using ↵Nadav Rotem2013-06-191-0/+59
| | | | | | ExtractElementInst). llvm-svn: 184325
* SLPVectorizer: start constructing chains at stores that are not power of two.Nadav Rotem2013-06-191-0/+46
| | | | | | | | The type <3 x i8> is a common in graphics and we want to be able to vectorize it. This changes accelerates bullet by 12% and 471_omnetpp by 5%. llvm-svn: 184317
* SLPVectorizer: vectorize compares and selects.Nadav Rotem2013-06-191-0/+32
| | | | llvm-svn: 184282
* Fix for a regression caused by the LoopVectorizer whenPekka Jaaskelainen2013-06-171-0/+47
| | | | | | | vectorizing loops with memory accesses to non-zero address spaces. It simply dropped the AS info. Fixes PR16306. llvm-svn: 184103
* Fix DeleteDeadVarargs not to crash on functions referenced by BlockAddressesDerek Schuff2013-06-131-0/+25
| | | | | | | | | | | | | | | This pass was assuming that if hasAddressTaken() returns false for a function, the function's only uses are call sites. That's not true because there can be references by BlockAddresses too. Fix the pass to handle this case. Fix BlockAddress::replaceUsesOfWithOnConstant() to allow a function's type to be changed by RAUW'ing the function with a bitcast of the recreated function. Patch by Mark Seaborn. llvm-svn: 183933
* Always remove an alias when we rename the target.Rafael Espindola2013-06-121-1/+12
| | | | | | Should fix the dragonegg build bots. llvm-svn: 183845
* Convert test to FileCheck.Rafael Espindola2013-06-121-9/+17
| | | | llvm-svn: 183843
* Change how globalopt handles aliases in llvm.used.Rafael Espindola2013-06-111-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | Instead of a custom implementation of replaceAllUsesWith, we just call replaceAllUsesWith and recreate llvm.used and llvm.compiler-used. This change is particularity interesting because it makes llvm see through what clang is doing with static used functions in extern "C" contexts. With this change, running clang -O2 in extern "C" { __attribute__((used)) static void foo() {} } produces @llvm.used = appending global [1 x i8*] [i8* bitcast (void ()* @foo to i8*)], section "llvm.metadata" define internal void @foo() #0 { entry: ret void } llvm-svn: 183756
* Make DeadArgumentElimination more conservative on variadic functionsTim Northover2013-06-091-0/+38
| | | | | | | Variadic functions are particularly fragile in the face of ABI changes, so this limits how much the pass changes them llvm-svn: 183625
* Fix a potential bug in r183584.Shuxin Yang2013-06-081-22/+0
| | | | | | | | | | | | | r183584 tries to derive some info from the code *AFTER* a call and apply these derived info to the code *BEFORE* the call, which is not always safe as the call in question may never return, and in this case, the derived info is invalid. Thank Duncan for pointing out this potential bug. rdar://14073661 llvm-svn: 183606
* Fix an assertion in MemCpyOpt pass.Shuxin Yang2013-06-071-0/+39
| | | | | | | | | | | | | | | | | | | | | The MemCpyOpt pass is capable of optimizing: callee(&S); copy N bytes from S to D. into: callee(&D); subject to some legality constraints. Assertion is triggered when the compiler tries to evalute "sizeof(typeof(D))", while D is an opaque-typed, 'sret' formal argument of function being compiled. i.e. the signature of the func being compiled is something like this: T caller(...,%opaque* noalias nocapture sret %D, ...) The fix is that when come across such situation, instead of calling some utility functions to get the size of D's type (which will crash), we simply assume D has at least N bytes as implified by the copy-instruction. rdar://14073661 llvm-svn: 183584
* [objc-arc] Ensure that the cfg path count does not overflow when we multiply ↵Michael Gottesman2013-06-071-3/+531
| | | | | | | | TopDownPathCount/BottomUpPathCount. rdar://12480535 llvm-svn: 183489
* Add a testcase from pr16244.Rafael Espindola2013-06-061-0/+10
| | | | llvm-svn: 183433
* IndVarSimplify: check if loop invariant expansion can trapDavid Majnemer2013-06-041-0/+32
| | | | | | | | | | | | | | | IndVarSimplify is willing to move divide instructions outside of their loop bodies if they are invariant of the loop. However, it may not be safe to expand them if we do not know if they can trap. Instead, check to see if it is not safe to expand the instruction and skip the expansion. This fixes PR16041. Testcase by Rafael Ávila de Espíndola. llvm-svn: 183239
* Second part of pr16069Rafael Espindola2013-06-041-1/+15
| | | | | | | | | | | | | | | | | The problem this time seems to be a thinko. We were assuming that in the CFG A | \ | B | / C speculating the basic block B would cause only the phi value for the B->C edge to be speculated. That is not true, the phi's are semantically in the edges, so if the A->B->C path is taken, any code needed for A->C is not executed and we have to consider it too when deciding to speculate B. llvm-svn: 183226
* SimplifyCFG: Do not transform PHI to select if doing so would be unsafeDavid Majnemer2013-06-031-0/+14
| | | | | | | | | | | | | PR16069 is an interesting case where an incoming value to a PHI is a trap value while also being a 'ConstantExpr'. We do not consider this case when performing the 'HoistThenElseCodeToIf' optimization. Instead, make our modifications more conservative if we detect that we cannot transform the PHI to a select. llvm-svn: 183152
* When determining the new index for an insertelement, we may not assume that anNick Lewycky2013-06-011-0/+11
| | | | | | | | | | index greater than the size of the vector is invalid. The shuffle may be shrinking the size of the vector. Fixes a crash! Also drop the maximum recursion depth of the safety check for this optimization to five. llvm-svn: 183080
* Prevent loop-unroll from making assumptions about undefined behavior.Andrew Trick2013-05-312-22/+62
| | | | | | | | | | | | | | Fixes rdar:14036816, PR16130. There is an opportunity to compute precise trip counts for 'or' expressions and multi-exit loops. rdar:14038809: Optimize trip count computation for multi-exit loops. To do this we need to record the fact that ExitLimit assumes NSW. When it does not we can safely assume that the loop trip count is the minimum ExitLimt across all subexpressions and loop exits. llvm-svn: 183060
* LoopVectorize: PHIs with only outside users should prevent vectorizationArnold Schwaighofer2013-05-311-0/+41
| | | | | | | | | | We check that instructions in the loop don't have outside users (except if they are reduction values). Unfortunately, we skipped this check for if-convertable PHIs. Fixes PR16184. llvm-svn: 183035
* Modify how the formulae are rated in Loop Strength Reduce.Quentin Colombet2013-05-312-6/+62
| | | | | | | | | | | | | | Namely, check if the target allows to fold more that one register in the addressing mode and if yes, adjust the cost accordingly. Prior to this commit, reg1 + scale * reg2 accesses were artificially preferred to reg1 + reg2 accesses. Indeed, the cost model wrongly assumed that reg1 + reg2 needs a temporary register for the computation, whereas it was correctly estimated for reg1 + scale * reg2. <rdar://problem/13973908> llvm-svn: 183021
* Simplify multiplications by vectors whose elements are powers of 2.Rafael Espindola2013-05-311-0/+408
| | | | | | Patch by Andrea Di Biagio. llvm-svn: 183005
* Reapply with r182909 with a fix to the calculation of the new indices forNick Lewycky2013-05-311-0/+21
| | | | | | insertelement instructions. llvm-svn: 182976
* Revert r182909.Evgeniy Stepanov2013-05-301-12/+0
| | | | | | PR/16177 llvm-svn: 182919
* Swizzle vector inputs if it helps us eliminate shuffles.Nick Lewycky2013-05-301-0/+12
| | | | llvm-svn: 182909
* Add support for llvm.vectorizer metadataPaul Redmond2013-05-286-10/+86
| | | | | | | | | | | | | | | | | | | - llvm.loop.parallel metadata has been renamed to llvm.loop to be more generic by making the root of additional loop metadata. - Loop::isAnnotatedParallel now looks for llvm.loop and associated llvm.mem.parallel_loop_access - document llvm.loop and update llvm.mem.parallel_loop_access - add support for llvm.vectorizer.width and llvm.vectorizer.unroll - document llvm.vectorizer.* metadata - add utility class LoopVectorizerHints for getting/setting loop metadata - use llvm.vectorizer.width=1 to indicate already vectorized instead of already_vectorized - update existing tests that used llvm.loop.parallel and llvm.vectorizer.already_vectorized Reviewed by: Nadav Rotem llvm-svn: 182802
* Track IR ordering of SelectionDAG nodes 3/4.Andrew Trick2013-05-251-2/+2
| | | | | | | Remove the old IR ordering mechanism and switch to new one. Fix unit test failures. llvm-svn: 182704
OpenPOWER on IntegriCloud