aboutsummaryrefslogtreecommitdiffstats
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
...
* Factor some code to parseSectionFlags and fix the default type of a section.Rafael Espindola2010-11-251-0/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120145 91177308-0d34-0410-b5e6-96231b3b80d8
* Treat a call of function pointer like a load of the pointer when consideringNick Lewycky2010-11-241-0/+13
| | | | | | | | whether the pointer can be replaced with the global variable it is a copy of. Fixes PR8680. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120126 91177308-0d34-0410-b5e6-96231b3b80d8
* Behave a bit more like gnu as and use the symbol (instead of the section)Rafael Espindola2010-11-241-1/+64
| | | | | | for any relocation to a symbol defined in a tls section. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120121 91177308-0d34-0410-b5e6-96231b3b80d8
* Relocate with the symbol if the relocation is of kind NTPOFF.Rafael Espindola2010-11-241-13/+34
| | | | | | Patch by David Meyer, I added the test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120104 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix and add tests for all cases in x86 and x86_64 where gnu as implicitlyRafael Espindola2010-11-242-11/+96
| | | | | | sets the type of a symbol to STT_TLS. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120100 91177308-0d34-0410-b5e6-96231b3b80d8
* Testcase for r120017.Rafael Espindola2010-11-241-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120099 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow for 'fcmp ogt' in SPU.Kalle Raiskila2010-11-241-6/+19
| | | | | | | Fix by Visa Putkinen! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120090 91177308-0d34-0410-b5e6-96231b3b80d8
* If a symbol is used as tls, mark it as tls even if not declare as so. ProbablyRafael Espindola2010-11-241-2/+14
| | | | | | fixes PR8659. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120076 91177308-0d34-0410-b5e6-96231b3b80d8
* The srem -> urem transform is not safe for any divisor that's not a power of ↵Benjamin Kramer2010-11-231-3/+3
| | | | | | | | | | | two. E.g. -5 % 5 is 0 with srem and 1 with urem. Also addresses Frits van Bommel's comments. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120049 91177308-0d34-0410-b5e6-96231b3b80d8
* Recognize sign/zero-extended constant BUILD_VECTORs for VMULL operations.Bob Wilson2010-11-231-0/+72
| | | | | | | We need to check if the individual vector elements are sign/zero-extended values. For now this only handles constants values. Radar 8687140. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120034 91177308-0d34-0410-b5e6-96231b3b80d8
* InstCombine: Reduce "X shift (A srem B)" to "X shift (A urem B)" iff B is ↵Benjamin Kramer2010-11-231-0/+11
| | | | | | | | | positive. This allows to transform the rem in "1 << ((int)x % 8);" to an and. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120028 91177308-0d34-0410-b5e6-96231b3b80d8
* Exploit distributive laws (eg: And distributes over Or, Mul over Add, etc) in aDuncan Sands2010-11-231-0/+11
| | | | | | | | | | | | | fairly systematic way in instcombine. Some of these cases were already dealt with, in which case I removed the existing code. The case of Add has a bunch of funky logic which covers some of this plus a few variants (considers shifts to be a form of multiplication), which I didn't touch. The simplification performed is: A*B+A*C -> A*(B+C). The improvement is to do this in cases that were not already handled [such as A*B-A*C -> A*(B-C), which was reported on the mailing list], and also to do it more often by not checking for "only one use" if "B+C" simplifies. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120024 91177308-0d34-0410-b5e6-96231b3b80d8
* Division by pow-of-2 is not cheap on SPU, do it with Kalle Raiskila2010-11-231-0/+22
| | | | | | | shifts. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120022 91177308-0d34-0410-b5e6-96231b3b80d8
* Produce a relocation for pcrel absolute values. Based on a patch by David Meyer.Rafael Espindola2010-11-231-0/+16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120006 91177308-0d34-0410-b5e6-96231b3b80d8
* duncan's spider sense was right, I completely reversed the conditionChris Lattner2010-11-231-4/+4
| | | | | | | on this instcombine xform. This fixes a miscompilation of 403.gcc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119988 91177308-0d34-0410-b5e6-96231b3b80d8
* filecheckizeChris Lattner2010-11-232-17/+22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119987 91177308-0d34-0410-b5e6-96231b3b80d8
* InstCombine: Implement X - A*-B -> X + A*B.Benjamin Kramer2010-11-221-0/+20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119984 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix epilogue codegen to avoid leaving the stack pointer in an invalidEvan Cheng2010-11-226-14/+74
| | | | | | | | | | | | | | | | | | state. Previously Thumb2 would restore sp from fp like this: mov sp, r7 sub, sp, #4 If an interrupt is taken after the 'mov' but before the 'sub', callee-saved registers might be clobbered by the interrupt handler. Instead, try restoring directly from sp: add sp, #4 Or, if necessary (with VLA, etc.) use a scratch register to compute sp and then restore it: sub.w r4, r7, #8 mov sp, r7 rdar://8465407 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119977 91177308-0d34-0410-b5e6-96231b3b80d8
* If a GEP index simply advances by multiples of a type of zero size,Duncan Sands2010-11-221-1/+10
| | | | | | | then replace the index with zero. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119974 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug with extractelement on SPU.Kalle Raiskila2010-11-221-1/+13
| | | | | | | | In the attached testcase, the element was never extracted (missing rotate). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119973 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement the "if (X == 6 || X == 4)" -> "if ((X|2) == 6)" optimization.Benjamin Kramer2010-11-221-0/+22
| | | | | | | | This currently only catches the most basic case, a two-case switch, but can be extended later. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119964 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement branch analysis in the MBlaze backend.Wesley Peck2010-11-211-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119951 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a rather pointless InstructionSimplify transform, inspired by recent ↵Duncan Sands2010-11-211-0/+8
| | | | | | | | | | | constant folding improvements: if P points to a type of size zero, turn "gep P, N" into "P". More generally, if a gep index type has size zero, instcombine could replace the index with zero, but that is not done here. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119942 91177308-0d34-0410-b5e6-96231b3b80d8
* Add encoding for ARM "trap" instruction.Bill Wendling2010-11-213-1/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119938 91177308-0d34-0410-b5e6-96231b3b80d8
* implement PR8524, apparently mainline gas accepts movq as an alias for movdChris Lattner2010-11-211-0/+7
| | | | | | | when transfering between i64 gprs and mmx regs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119931 91177308-0d34-0410-b5e6-96231b3b80d8
* implement PR8576, deleting dead stores with intervening may-alias stores.Chris Lattner2010-11-211-0/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119927 91177308-0d34-0410-b5e6-96231b3b80d8
* file checkizeChris Lattner2010-11-211-3/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119926 91177308-0d34-0410-b5e6-96231b3b80d8
* optimize:Chris Lattner2010-11-211-0/+38
| | | | | | | | | | | void a(int x) { if (((1<<x)&8)==0) b(); } into "x != 3", which occurs over 100 times in 403.gcc but in no other program in llvm-test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119922 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle PCRel relocations with absolute values. Fixes PR8656.Rafael Espindola2010-11-211-0/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119917 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement PR8644: forwarding a memcpy value to a byval,Chris Lattner2010-11-212-2/+17
| | | | | | | | | | | | | allowing the memcpy to be eliminated. Unfortunately, the requirements on byval's without explicit alignment are really weak and impossible to predict in the mid-level optimizer, so this doesn't kick in much with current frontends. The fix is to change clang to set alignment on all byval arguments. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119916 91177308-0d34-0410-b5e6-96231b3b80d8
* Removing the useless test that I added recently. It was meant as an example, ↵Andrew Trick2010-11-201-32/+0
| | | | | | but not complicated enough to merit another test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119898 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a test for CodeGenPrepare's ability to look through PHI nodes when ↵Owen Anderson2010-11-191-0/+23
| | | | | | | | | performing addressing mode folding, introduced in r119853. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119857 91177308-0d34-0410-b5e6-96231b3b80d8
* Prefetch has a MemOperand now. FileCheckize a test.Dale Johannesen2010-11-191-5/+5
| | | | | | | | This finishes up 8460971. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119848 91177308-0d34-0410-b5e6-96231b3b80d8
* Make isScalarToVector to return false if the node is a scalar. This will preventMon P Wang2010-11-191-0/+27
| | | | | | | | DAGCombine from making an illegal transformation of bitcast of a scalar to a vector into a scalar_to_vector. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119819 91177308-0d34-0410-b5e6-96231b3b80d8
* Added support for the Mach-O .symbol_resolver directive. rdar://8673046Kevin Enderby2010-11-191-23/+34
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119816 91177308-0d34-0410-b5e6-96231b3b80d8
* Add MC encodings for some Thumb instructions. Test for a few of them. The "bxBill Wendling2010-11-191-0/+8
| | | | | | | | lr" instruction cannot be tested just yet. It requires matching a "condition code", but adding one of those makes things go south quickly... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119774 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for parsing the writeback ("!") token.Bill Wendling2010-11-181-0/+18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119761 91177308-0d34-0410-b5e6-96231b3b80d8
* More tests.Owen Anderson2010-11-181-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119756 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix encodings for pkhbt, and fix some tests where I accidentally tested ARM ↵Owen Anderson2010-11-181-14/+20
| | | | | | mode instead of Thumb2. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119755 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix bug in DAGCombiner for ARM that was trying to do a ShiftCombine on ↵Tanya Lattner2010-11-181-0/+8
| | | | | | | | | | illegal types (vector should be split first). Added test case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119749 91177308-0d34-0410-b5e6-96231b3b80d8
* More Thumb2 encodings.Owen Anderson2010-11-181-0/+24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119737 91177308-0d34-0410-b5e6-96231b3b80d8
* Fill out the set of Thumb2 multiplication operator encodings.Owen Anderson2010-11-181-0/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119733 91177308-0d34-0410-b5e6-96231b3b80d8
* The DAGCombiner was threading select over pairs of extending loads evenDuncan Sands2010-11-181-0/+15
| | | | | | | | | | | if the extension types were not the same. The result was that if you fed a select with sext and zext loads, as in the testcase, then it would get turned into a zext (or sext) of the select, which is wrong in the cases when it should have been an sext (resp. zext). Reported and diagnosed by Sebastien Deldon. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119728 91177308-0d34-0410-b5e6-96231b3b80d8
* Factor code for testing whether replacing one value with anotherDuncan Sands2010-11-181-0/+28
| | | | | | | | | preserves LCSSA form out of ScalarEvolution and into the LoopInfo class. Use it to check that SimplifyInstruction simplifications are not breaking LCSSA form. Fixes PR8622. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119727 91177308-0d34-0410-b5e6-96231b3b80d8
* Rewrite stack callee saved spills and restores to use push/pop instructions.Eric Christopher2010-11-183-4/+4
| | | | | | | | | | Remove movePastCSLoadStoreOps and associated code for simple pointer increments. Update routines that depended upon other opcodes for save/restore. Adjust all testcases accordingly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119725 91177308-0d34-0410-b5e6-96231b3b80d8
* Completely rework the datastructure GVN uses to represent the value number ↵Owen Anderson2010-11-181-52/+0
| | | | | | | | | | | | | | | | | | | | | | | | to leader mapping. Previously, this was a tree of hashtables, and a query recursed into the table for the immediate dominator ad infinitum if the initial lookup failed. This led to really bad performance on tall, narrow CFGs. We can instead replace it with what is conceptually a multimap of value numbers to leaders (actually represented by a hashtable with a list of Value*'s as the value type), and then determine which leader from that set to use very cheaply thanks to the DFS numberings maintained by DominatorTree. Because there are typically few duplicates of a given value, this scan tends to be quite fast. Additionally, we use a custom linked list and BumpPtr allocation to avoid any unnecessary allocation in representing the value-side of the multimap. This change brings with it a 15% (!) improvement in the total running time of GVN on 403.gcc, which I think is pretty good considering that includes all the "real work" being done by MemDep as well. The one downside to this approach is that we can no longer use GVN to perform simple conditional progation, but that seems like an acceptable loss since we now have LVI and CorrelatedValuePropagation to pick up the slack. If you see conditional propagation that's not happening, please file bugs against LVI or CVP. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119714 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for PHI-translating sext, zext, and trunc instructions,Dan Gohman2010-11-181-0/+31
| | | | | | | enabling more PRE. PR8586. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119704 91177308-0d34-0410-b5e6-96231b3b80d8
* remove a pointless restriction from memcpyopt. It wasChris Lattner2010-11-182-19/+35
| | | | | | | | | | | | | | refusing to optimize two memcpy's like this: copy A <- B copy C <- A if it couldn't prove that noalias(B,C). We can eliminate the copy by producing a memmove instead of memcpy. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119694 91177308-0d34-0410-b5e6-96231b3b80d8
* filecheckize, this is still not optimal, see PR8643Chris Lattner2010-11-181-1/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119693 91177308-0d34-0410-b5e6-96231b3b80d8
* allow eliminating an alloca that is just copied from an constant globalChris Lattner2010-11-181-0/+13
| | | | | | | | | if it is passed as a byval argument. The byval argument will just be a read, so it is safe to read from the original global instead. This allows us to promote away the %agg.tmp alloca in PR8582 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119686 91177308-0d34-0410-b5e6-96231b3b80d8