summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* loop-rotate shouldn't hoist alloca instructions out of a loop. Patch by ↵Eli Friedman2012-02-161-1/+2
| | | | | | Patrik Hägglund, with slightly modified test. Issue reported by Patrik Hägglund on llvmdev. llvm-svn: 150642
* [tsan] fix compiler warningsKostya Serebryany2012-02-141-3/+3
| | | | llvm-svn: 150449
* Add simplifyLoopLatch to LoopRotate pass.Andrew Trick2012-02-141-0/+103
| | | | | | This folds a simple loop tail into a loop latch. It covers the common (in fortran) case of postincrement loops. It's a "free" way to expose this type of loop to downstream loop optimizations that bail out on non-canonical loops (getLoopLatch is a heavily used check). llvm-svn: 150439
* whitespaceAndrew Trick2012-02-141-30/+30
| | | | llvm-svn: 150438
* Check against umin while converting fcmp into an icmp.Devang Patel2012-02-131-0/+11
| | | | llvm-svn: 150425
* Just like in regular escape analysis, loads and stores throughDan Gohman2012-02-131-0/+10
| | | | | | | (but not of) a block pointer do not cause the block pointer to escape. This fixes rdar://10803830. llvm-svn: 150424
* ThreadSanitizer, a race detector. First LLVM commit.Kostya Serebryany2012-02-133-0/+171
| | | | | | | Clang patch (flags) will follow shortly. The run-time library will also follow, but not immediately. llvm-svn: 150423
* Fix various issues (or do cleanups) found by enabling certain MSVC warnings.Ahmed Charles2012-02-132-5/+4
| | | | | | | | | - Use unsigned literals when the desired result is unsigned. This mostly allows unsigned/signed mismatch warnings to be less noisy even if they aren't on by default. - Remove misplaced llvm_unreachable. - Add static to a declaration of a function on MSVC x86 only. - Change some instances of calling a static function through a variable to simply calling that function while removing the unused variable. llvm-svn: 150364
* Handle InvokeInst in EvaluateBlock. Don't try to support exceptions, it's justNick Lewycky2012-02-121-9/+14
| | | | | | that no optz'ns have run yet to convert invokes to calls. llvm-svn: 150326
* false is totally null!Nick Lewycky2012-02-121-1/+1
| | | | llvm-svn: 150324
* Remove redundant getAnalysis<> calls in GlobalOpt. Add a few Itanium ABI callsNick Lewycky2012-02-121-10/+8
| | | | | | to TargetLibraryInfo and use one of them in GlobalOpt. llvm-svn: 150323
* Pass TargetData and TargetLibraryInfo through to the constant folder. Fixes aNick Lewycky2012-02-121-25/+37
| | | | | | few fixme's when TLI was added. llvm-svn: 150322
* Fix function name in comment to match actual name. Fix comments that are usingNick Lewycky2012-02-121-15/+15
| | | | | | doxy-style on local variables to not do so. Fix one 80-col violation. llvm-svn: 150320
* Don't traverse the PHI nodes twice. No functionality change!Nick Lewycky2012-02-121-7/+6
| | | | llvm-svn: 150319
* Update BBVectorize to use aliasesUnknownInst.Hal Finkel2012-02-101-9/+3
| | | | | | | | This allows BBVectorize to check the "unknown instruction" list in the alias sets. This is important to prevent instruction fusing from reordering function calls. Resolves PR11920. llvm-svn: 150250
* Tweak comment readability and grammar.Benjamin Kramer2012-02-091-2/+2
| | | | llvm-svn: 150183
* GlobalOpt: Be more aggressive about elminating side-effect free static dtors.Benjamin Kramer2012-02-091-4/+5
| | | | | | | | | GlobalOpt runs early in the pipeline (before inlining) and complex class hierarchies often introduce bitcasts or GEPs which weren't optimized away. Teach it to ignore side-effect free instructions instead of depending on other passes to remove them. llvm-svn: 150174
* [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
OpenPOWER on IntegriCloud