summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Reorganize llvmc code.Mikhail Glushenkov2009-03-027-1/+789
| | | | | | | | | | Move the code from 'llvmc/driver' into a new CompilerDriver library, and change the build system accordingly. Makes it easier for projects using LLVM to build their own llvmc-based drivers. Tested with objdir != srcdir. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65821 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a problem with DAGCombine on 64b targets where foldingNate Begeman2009-03-011-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | extracts + build_vector into a shuffle would fail, because the type of the new build_vector would not be legal. Try harder to create a legal build_vector type. Note: this will be totally irrelevant once vector_shuffle no longer takes a build_vector for shuffle mask. New: _foo: xorps %xmm0, %xmm0 xorps %xmm1, %xmm1 subps %xmm1, %xmm1 mulps %xmm0, %xmm1 addps %xmm0, %xmm1 movaps %xmm1, 0 Old: _foo: xorps %xmm0, %xmm0 movss %xmm0, %xmm1 xorps %xmm2, %xmm2 unpcklps %xmm1, %xmm2 pshufd $80, %xmm1, %xmm1 unpcklps %xmm1, %xmm2 pslldq $16, %xmm2 pshufd $57, %xmm2, %xmm1 subps %xmm0, %xmm1 mulps %xmm0, %xmm1 addps %xmm0, %xmm1 movaps %xmm1, 0 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65791 91177308-0d34-0410-b5e6-96231b3b80d8
* Another sentinel optimization. This one should alwaysGabor Greif2009-03-011-7/+0
| | | | | | be a win, since almost every interesting function has at least one Argument. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65778 91177308-0d34-0410-b5e6-96231b3b80d8
* Reuse a technique (pioneered for BasicBlocks) of superposing ilist withGabor Greif2009-03-011-7/+0
| | | | | | | | | | | | | its sentinel. This is quite a win when a function really has a basic block. When the function is just a declaration (and stays so) the old way did not allocate a sentinel. So this change is most beneficial when the ratio of function definition to declaration is high. I.e. linkers etc. Incidentally these are the most resource demanding applications, so I expect that the reduced malloc traffic, locality and space savings outweigh the cost of addition of two pointers to Function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65776 91177308-0d34-0410-b5e6-96231b3b80d8
* Temporarily revert r65755. It was causing failures in the self-hostingBill Wendling2009-03-011-5/+3
| | | | | | | | | | | | | | | | | | | | | | testsuite: Running /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/CodeGen/X86/dg.exp ... FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/CodeGen/X86/nancvt.ll Failed with exit(1) at line 2 while running: grep 2147027116 nancvt.ll.tmp | count 3 count: expected 3 lines and got 0. child process exited abnormally FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/CodeGen/X86/vec_ins_extract.ll Failed with exit(1) at line 1 while running: llvm-as < /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/CodeGen/X86/vec_ins_extract.ll | opt -scalarrepl -instcombine | llc -march=x86 -mcpu=yonah | not /usr/bin/grep sub.*esp subl $28, %esp subl $28, %esp child process exited abnormally And more. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65758 91177308-0d34-0410-b5e6-96231b3b80d8
* hoist the check for alloca size up so that it controls CanConvertToScalar Chris Lattner2009-03-011-3/+5
| | | | | | | as well as isSafeAllocaToScalarRepl. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65755 91177308-0d34-0410-b5e6-96231b3b80d8
* Minor optimization:Evan Cheng2009-03-011-29/+237
| | | | | | | | | | | | Look for situations like this: %reg1024<def> = MOV r1 %reg1025<def> = MOV r0 %reg1026<def> = ADD %reg1024, %reg1025 r0 = MOV %reg1026 Commute the ADD to hopefully eliminate an otherwise unavoidable copy. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65752 91177308-0d34-0410-b5e6-96231b3b80d8
* simplify handling "don't print top level name" processing, so that we getChris Lattner2009-03-011-37/+19
| | | | | | | stuff like %A = type { %A*} instead of an upref. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65748 91177308-0d34-0410-b5e6-96231b3b80d8
* Combine PPC's GetConstantBuildVectorBits and isConstantSplat functions to a newBob Wilson2009-03-012-106/+96
| | | | | | | method in a BuildVectorSDNode "pseudo-class". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65747 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a pretty awesome bug that only happened in a strange case with anonymousChris Lattner2009-03-011-8/+11
| | | | | | | types. This was reading the uint for the keyword after the token was advanced. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65743 91177308-0d34-0410-b5e6-96231b3b80d8
* walk type symbol table also, so we get:Chris Lattner2009-03-011-2/+10
| | | | | | | | | | | | | | | type opaque ; type %0 %C = type { %0, %0 } instead of: %C = type { opaque, opaque } when appropriate. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65742 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a long-standing bug and misfeature of the disassembler: when dealing with a Chris Lattner2009-03-011-12/+122
| | | | | | | | | | | | | | | stripped .bc file, it didn't make any attempt to try to reuse anonymous types. This causes an amazing type explosion due to types getting duplicated everywhere they are referenced and other problems. This also caused correctness issues, because opaque types are unique for each time they are uttered in the file. This means that stripping a .bc file could produce a .ll file that could not be assembled (e.g. 2009-02-28-StripOpaqueName.ll). This patch fixes both of these issues. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65738 91177308-0d34-0410-b5e6-96231b3b80d8
* move type name population out of TypePrinting class into a static Chris Lattner2009-02-281-36/+51
| | | | | | | AsmWriter.cpp method. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65736 91177308-0d34-0410-b5e6-96231b3b80d8
* switch to densemap for pointer->word map.Chris Lattner2009-02-281-9/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65735 91177308-0d34-0410-b5e6-96231b3b80d8
* delete a bunch of duplicated type printing logic, using the type printingChris Lattner2009-02-281-152/+16
| | | | | | | stuff in AsmWriter.cpp for Type::getDescription(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65734 91177308-0d34-0410-b5e6-96231b3b80d8
* make this work when constructed with a null module*Chris Lattner2009-02-281-2/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65733 91177308-0d34-0410-b5e6-96231b3b80d8
* expose TypePrinting as a public API.Chris Lattner2009-02-281-23/+24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65729 91177308-0d34-0410-b5e6-96231b3b80d8
* rename 'Result' to 'OS' in CalcTypeName for consistencyChris Lattner2009-02-281-37/+37
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65724 91177308-0d34-0410-b5e6-96231b3b80d8
* do not embed the raw_ostream into TypePrinting, pass it as an argument to ↵Chris Lattner2009-02-281-52/+43
| | | | | | print etc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65723 91177308-0d34-0410-b5e6-96231b3b80d8
* stop calling Type::getDescription().Chris Lattner2009-02-281-12/+15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65722 91177308-0d34-0410-b5e6-96231b3b80d8
* simplificationsChris Lattner2009-02-281-6/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65721 91177308-0d34-0410-b5e6-96231b3b80d8
* Change WriteTypeSymbolic to not put a space out before types, also, removeChris Lattner2009-02-283-24/+18
| | | | | | | the old std::ostream version. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65720 91177308-0d34-0410-b5e6-96231b3b80d8
* make CalcTypeName take a stream instead of a string to concat onto,Chris Lattner2009-02-281-55/+49
| | | | | | | eliminate redundant opaque handling code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65716 91177308-0d34-0410-b5e6-96231b3b80d8
* remove a bunch of nearly-duplicated code.Chris Lattner2009-02-281-63/+18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65715 91177308-0d34-0410-b5e6-96231b3b80d8
* fix indentation, remove dead integer case.Chris Lattner2009-02-281-64/+59
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65714 91177308-0d34-0410-b5e6-96231b3b80d8
* pull calcTypeName into TypePrinting class, make its type stackChris Lattner2009-02-281-12/+16
| | | | | | | be a smallvector instead of vector. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65713 91177308-0d34-0410-b5e6-96231b3b80d8
* inline method into its only use and simplify the result.Chris Lattner2009-02-281-11/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65712 91177308-0d34-0410-b5e6-96231b3b80d8
* simplify conditionChris Lattner2009-02-281-7/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65711 91177308-0d34-0410-b5e6-96231b3b80d8
* start refactoring the .ll printer: introduce a new TypePrinting classChris Lattner2009-02-281-310/+302
| | | | | | | and move all related stuff to it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65710 91177308-0d34-0410-b5e6-96231b3b80d8
* reject 0 element vectors with:Chris Lattner2009-02-281-0/+2
| | | | | | | | | | @a = internal constant void bitcast(<0 x i8> <> to void) ^ Fixes PR3685 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65698 91177308-0d34-0410-b5e6-96231b3b80d8
* Last commit accidentially deleted this code.Evan Cheng2009-02-281-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65679 91177308-0d34-0410-b5e6-96231b3b80d8
* Added another darwin subtargetMon P Wang2009-02-281-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65662 91177308-0d34-0410-b5e6-96231b3b80d8
* It is possible that subprgoram definition is only encoding return value ↵Devang Patel2009-02-271-2/+6
| | | | | | directly, instsad of an DIArray of all argument types. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65643 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor TLS code and add some tests. The tests and expected results are:Rafael Espindola2009-02-273-14/+69
| | | | | | | | | | | | | | | | | | | | | | | | pic | declaration | linkage | visibility | !pic | declaration | external | default | tls1.ll tls2.ll | local exec pic | declaration | external | default | tls1-pic.ll tls2-pic.ll | general dynamic !pic | !declaration | external | default | tls3.ll tls4.ll | initial exec pic | !declaration | external | default | tls3-pic.ll tls4-pic.ll | general dynamic !pic | declaration | external | hidden | tls7.ll tls8.ll | local exec pic | declaration | external | hidden | X | local dynamic !pic | !declaration | external | hidden | tls9.ll tls10.ll | local exec pic | !declaration | external | hidden | X | local dynamic !pic | declaration | internal | default | tls5.ll tls6.ll | local exec pic | declaration | internal | default | X | local dynamic The ones marked with an X have not been implemented since local dynamic is not implemented. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65632 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce a new technique for merging BasicBlock with Instruction sentinel ↵Gabor Greif2009-02-271-34/+0
| | | | | | | | | by superposition. This looks dangerous, but isn't because the sentinel is accessed in special way only, namely the Next and Prev fields of it, and these are guaranteed to exist. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65626 91177308-0d34-0410-b5e6-96231b3b80d8
* Silence compiler warning about use of uninitialized variables (in reality theseNick Lewycky2009-02-271-1/+1
| | | | | | | are always set by reference on the path that uses them.) No functional change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65621 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix compiler warning about uninitialized variables. No functional change.Nick Lewycky2009-02-271-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65620 91177308-0d34-0410-b5e6-96231b3b80d8
* Alignment values for i64 and f64 on ppc64 were wrong,Dale Johannesen2009-02-271-1/+3
| | | | | | | | | | possibly for the reason suggested by the comment. No wonder it didn't work very well. This unblocks bootstrap with assertions on ppc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65601 91177308-0d34-0410-b5e6-96231b3b80d8
* MachineLICM CSE should match destination register classes; avoid hoisting ↵Evan Cheng2009-02-271-3/+13
| | | | | | implicit_def's. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65592 91177308-0d34-0410-b5e6-96231b3b80d8
* Ignore dbg info intrinsics when folding conditional branch to Zhou Sheng2009-02-261-1/+5
| | | | | | | conditional branch predecessors. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65509 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable stack slot coloring DCE. Evan's spiller fixes were needed before ↵Owen Anderson2009-02-261-7/+2
| | | | | | this could happen. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65501 91177308-0d34-0410-b5e6-96231b3b80d8
* ADDS{D|S}rr_Int and MULS{D|S}rr_Int are not commutable. The users of these ↵Evan Cheng2009-02-261-8/+4
| | | | | | intrinsics expect the high bits will not be modified. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65499 91177308-0d34-0410-b5e6-96231b3b80d8
* The last commit was overly conservative. It's ok to reuse value that's ↵Evan Cheng2009-02-261-7/+0
| | | | | | already marked livein. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65498 91177308-0d34-0410-b5e6-96231b3b80d8
* If an available register falls through to a succ block, unset the last kill. ↵Evan Cheng2009-02-261-37/+76
| | | | | | Sorry, it's impossible to reduce a sensible test case. It basically requires the moon and stars to align in order to cause a failure. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65497 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert BuildVectorSDNode related patches: 65426, 65427, and 65296.Evan Cheng2009-02-2511-324/+329
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65482 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix big-endian codegen bug. We're splitting upDale Johannesen2009-02-251-1/+2
| | | | | | | | | | | | | overly long ints, e.g. i96, into pieces at PHIs and the nodes that feed into them; however big-endian reverses the order of the pieces (for some reason), and wasn't doing it the same way on both sides, so the pieces didn't match and runtime failures ensued. Fixes 188.ammp and sqlite3 on ppc32. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65481 91177308-0d34-0410-b5e6-96231b3b80d8
* Print variable's display name in dwarf DIE.Devang Patel2009-02-251-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65468 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR3667Chris Lattner2009-02-251-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65464 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't block basic block with only SwitchInst to fold into predecessors.Zhou Sheng2009-02-251-1/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65456 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean up dwarf writer, part 1. This eliminated the horrible recursive ↵Evan Cheng2009-02-254-335/+414
| | | | | | | | | getGlobalVariablesUsing and replaced it something readable. It eliminated use of slow UniqueVector and replaced it with StringMap, SmallVector, and DenseMap, etc. It also fixed some non-deterministic behavior. This is a very minor compile time win. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65438 91177308-0d34-0410-b5e6-96231b3b80d8