summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* [asan] unpoison the stack before every noreturn call. Fixes asan issue 37. ↵Kostya Serebryany2012-02-081-2/+17
| | | | | | llvm part llvm-svn: 150102
* Use Use::set rather than finding the operand number of the useDuncan Sands2012-02-081-6/+3
| | | | | | and setting that. llvm-svn: 150074
* Convert assert(0) to llvm_unreachableCraig Topper2012-02-075-7/+6
| | | | llvm-svn: 149967
* Remove some dead code and tidy things up now that vectors use ConstantDataVectorChris Lattner2012-02-063-35/+19
| | | | | | instead of always using ConstantVector. llvm-svn: 149912
* [unwind removal] Remove all of the code for the dead 'unwind' instruction. ThereBill Wendling2012-02-062-51/+4
| | | | | | | were no 'unwind' instructions being generated before this, so this is in effect a no-op. llvm-svn: 149906
* [unwind removal] We no longer have 'unwind' instructions being generated, soBill Wendling2012-02-065-103/+6
| | | | | | remove the code that handles them. llvm-svn: 149901
* Make helper static.Benjamin Kramer2012-02-061-3/+3
| | | | llvm-svn: 149865
* Split part of EvaluateFunction into a new EvaluateBlock method. No functionalityNick Lewycky2012-02-061-57/+95
| | | | | | change. llvm-svn: 149861
* fix indentationSebastian Pop2012-02-061-9/+9
| | | | llvm-svn: 149857
* Teach GlobalOpt to handle atomic accesses to globals.Nick Lewycky2012-02-051-13/+40
| | | | | | | | | | | | | | | | | | | * Most of the transforms come through intact by having each transformed load or store copy the ordering and synchronization scope of the original. * The transform that turns a global only accessed in main() into an alloca (since main is non-recursive) with a store of the initial value uses an unordered store, since it's guaranteed to be the first thing to happen in main. (Threads may have started before main (!) but they can't have the address of a function local before the point in the entry block we insert our code.) * The heap-SRoA transforms are disabled in the face of atomic operations. This can probably be improved; it seems odd to have atomic accesses to an alloca that doesn't have its address taken. AnalyzeGlobal keeps track of the strongest ordering found in any use of the global. This is more information than we need right now, but it's cheap to compute and likely to be useful. llvm-svn: 149847
* Clean up some whitespace and comments. No functionality change.Nick Lewycky2012-02-051-13/+13
| | | | llvm-svn: 149845
* Neaten up this method. Check that if there is only oneDuncan Sands2012-02-051-3/+3
| | | | | | predecessor then it's Src. llvm-svn: 149843
* Fix a thinko pointed out by Eli and the buildbots.Duncan Sands2012-02-051-1/+1
| | | | llvm-svn: 149839
* Reduce the number of dom queries made by GVN's conditional propagationDuncan Sands2012-02-051-31/+9
| | | | | | | | | | | | logic by half: isOnlyReachableViaThisEdge was trying to be clever and handle the case of a branch to a basic block which is contained in a loop. This costs a domtree lookup and is completely useless due to GVN's position in the pass pipeline: all loops have preheaders at this point, which means it is enough for isOnlyReachableViaThisEdge to check that Dst has only one predecessor. (I checked this theoretical argument by running over the entire nightly testsuite, and indeed it is so!). llvm-svn: 149838
* Reduce the number of non-trivial domtree queries by about 1% whenDuncan Sands2012-02-051-15/+17
| | | | | | | compiling sqlite3, by only doing dom queries after the cheap check rather than interleaved with it. llvm-svn: 149836
* Simplify contains tests using 'count'.David Blaikie2012-02-051-2/+1
| | | | llvm-svn: 149813
* BBVectorize.cpp: Get rid of comparision to bool to fix a warning.NAKAMURA Takumi2012-02-051-1/+1
| | | | llvm-svn: 149810
* reapply the patches reverted in r149470 that reenable ConstantDataArray,Chris Lattner2012-02-052-57/+61
| | | | | | | | | but with a critical fix to the SelectionDAG code that optimizes copies from strings into immediate stores: the previous code was stopping reading string data at the first nul. Address this by adding a new argument to llvm::getConstantStringInfo, preserving the behavior before the patch. llvm-svn: 149800
* Boost the effective chain depth of loads and stores.Hal Finkel2012-02-041-0/+10
| | | | | | By default, boost the chain depth contribution of loads and stores. This will allow a load/store pair to vectorize even when it would not otherwise be long enough to satisfy the chain depth requirement. llvm-svn: 149761
* Narrow test further. Make bot and test happy.Jim Grosbach2012-02-031-1/+3
| | | | llvm-svn: 149650
* Tidy up. Trailing whitespace.Jim Grosbach2012-02-031-55/+55
| | | | llvm-svn: 149649
* Restrict InstCombine from converting varargs to or from fixed args.Jim Grosbach2012-02-031-0/+7
| | | | | | More targetted fix replacing d0e277d272d517ca1cda368267d199f0da7cad95. llvm-svn: 149648
* Revert "Disable InstCombine unsafe folding bitcasts of calls w/ varargs."Jim Grosbach2012-02-031-5/+14
| | | | | | This reverts commit d0e277d272d517ca1cda368267d199f0da7cad95. llvm-svn: 149647
* BBVectorize: Simplify code, no functionality change.Benjamin Kramer2012-02-021-9/+3
| | | | | | Also silences warnings about bodyless for loops. llvm-svn: 149612
* Minor changes from review.Hal Finkel2012-02-021-19/+17
| | | | | | As suggested by Nick Lewycky, the tree traversal queues have been changed to SmallVectors and the associated loops have been rotated. Also, an 80-col violation was fixed. llvm-svn: 149607
* Vectorize long blocks in groups.Hal Finkel2012-02-021-41/+90
| | | | | | Long basic blocks with many candidate pairs (such as in the SHA implementation in Perl 5.14; thanks to Roman Divacky for the example) used to take an unacceptably-long time to compile. Instead, break long blocks into groups so that no group has too many candidate pairs. llvm-svn: 149595
* SwitchInst refactoring.Stepan Dyatkovskiy2012-02-0112-78/+90
| | | | | | | | | | | | | | | | | The purpose of refactoring is to hide operand roles from SwitchInst user (programmer). If you want to play with operands directly, probably you will need lower level methods than SwitchInst ones (TerminatorInst or may be User). After this patch we can reorganize SwitchInst operands and successors as we want. What was done: 1. Changed semantics of index inside the getCaseValue method: getCaseValue(0) means "get first case", not a condition. Use getCondition() if you want to resolve the condition. I propose don't mix SwitchInst case indexing with low level indexing (TI successors indexing, User's operands indexing), since it may be dangerous. 2. By the same reason findCaseValue(ConstantInt*) returns actual number of case value. 0 means first case, not default. If there is no case with given value, ErrorIndex will returned. 3. Added getCaseSuccessor method. I propose to avoid usage of TerminatorInst::getSuccessor if you want to resolve case successor BB. Use getCaseSuccessor instead, since internal SwitchInst organization of operands/successors is hidden and may be changed in any moment. 4. Added resolveSuccessorIndex and resolveCaseIndex. The main purpose of these methods is to see how case successors are really mapped in TerminatorInst. 4.1 "resolveSuccessorIndex" was created if you need to level down from SwitchInst to TerminatorInst. It returns TerminatorInst's successor index for given case successor. 4.2 "resolveCaseIndex" converts low level successors index to case index that curresponds to the given successor. Note: There are also related compatability fix patches for dragonegg, klee, llvm-gcc-4.0, llvm-gcc-4.2, safecode, clang. llvm-svn: 149481
* BBVectorize.cpp: Try to fix MSVC build. map::iterator and multimap::iterator ↵NAKAMURA Takumi2012-02-011-2/+2
| | | | | | are incompatible. llvm-svn: 149475
* A few of the changes suggested in code review (by Nick Lewycky)Hal Finkel2012-02-011-7/+8
| | | | llvm-svn: 149472
* Revert Chris' commits up to r149348 that started causing VMCoreTests unit ↵Argyrios Kyrtzidis2012-02-012-61/+57
| | | | | | | | | | | | | | | | | | | test to fail. These are: r149348 r149351 r149352 r149354 r149356 r149357 r149361 r149362 r149364 r149365 llvm-svn: 149470
* Add a basic-block autovectorization pass.Hal Finkel2012-02-0110-3/+1896
| | | | | | | This is the initial checkin of the basic-block autovectorization pass along with some supporting vectorization infrastructure. Special thanks to everyone who helped review this code over the last several months (especially Tobias Grosser). llvm-svn: 149468
* Disable InstCombine unsafe folding bitcasts of calls w/ varargs.Jim Grosbach2012-02-011-14/+5
| | | | | | | | | | | Changing arguments from being passed as fixed to varargs is unsafe, as the ABI may require they be handled differently (stack vs. register, for example). Remove two tests which rely on the bitcast being folded into the direct call, which is exactly the transformation that's unsafe. llvm-svn: 149457
* bz11794 : EarlyCSE stack overflow on long functions.Lenny Maiorani2012-01-311-22/+117
| | | | | | Make the EarlyCSE optimizer not use recursion to do a depth first iteration. llvm-svn: 149445
* Increase the initial vector size to be equivalent to the size of the DepsBill Wendling2012-01-311-2/+2
| | | | | | vector. This potentially saves a resizing. llvm-svn: 149369
* Cache the size of the vector instead of calling .size() all over the place.Bill Wendling2012-01-311-5/+5
| | | | llvm-svn: 149368
* eliminate the "string" form of ConstantArray::get, usingChris Lattner2012-01-311-1/+1
| | | | | | ConstantDataArray::getString instead. llvm-svn: 149365
* eliminate the last uses of GetConstantStringInfo from this file, I didn't ↵Chris Lattner2012-01-311-7/+7
| | | | | | realize I was that close... llvm-svn: 149354
* start moving SimplifyLibcalls over to getConstantStringInfo, which isChris Lattner2012-01-311-49/+53
| | | | | | dramatically more efficient than GetConstantStringInfo. llvm-svn: 149352
* enhance logic to support ConstantDataArray.Chris Lattner2012-01-311-8/+13
| | | | llvm-svn: 149340
* s/getInnerUnwindDest/getInnerResumeDest/gBill Wendling2012-01-311-4/+4
| | | | llvm-svn: 149328
* Remove ivar which is identical to another ivar.Bill Wendling2012-01-311-10/+6
| | | | llvm-svn: 149323
* Remove unused ivars and s/getOuterUnwindDest/getOuterResumeDest/g.Bill Wendling2012-01-311-9/+4
| | | | llvm-svn: 149322
* Remove more dead functions.Bill Wendling2012-01-311-211/+0
| | | | llvm-svn: 149318
* s/getInnerUnwindDestNewEH/getInnerUnwindDest/gBill Wendling2012-01-311-4/+3
| | | | llvm-svn: 149317
* Remove some unused, old-EH methods.Bill Wendling2012-01-311-116/+3
| | | | llvm-svn: 149316
* Get rid of references to dead intrinsics.Bill Wendling2012-01-311-53/+5
| | | | | | | The eh.selector and eh.resume intrinsics aren't used anymore. Get rid of some calls to them. llvm-svn: 149314
* Formatting cleanups. No functionality change.Bill Wendling2012-01-311-20/+20
| | | | llvm-svn: 149312
* Remove no-longer-useful dyn_casts and pals.Bill Wendling2012-01-311-21/+10
| | | | llvm-svn: 149307
* [asan] fix the ObjC support (asan Issue #33)Kostya Serebryany2012-01-301-13/+21
| | | | llvm-svn: 149300
* Typo.Chad Rosier2012-01-301-1/+1
| | | | llvm-svn: 149289
OpenPOWER on IntegriCloud