summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* Use the target-aware constant folder on expressions to improve the chanceNick Lewycky2012-02-211-2/+9
| | | | | | | | | | | | | they'll be simple enough to simulate, and to reduce the chance we'll encounter equal but different simple pointer constants. This removes the symptoms from PR11352 but is not a full fix. A proper fix would either require a guarantee that two constant objects we simulate are folded when equal, or a different way of handling equal pointers (ie., trying a constantexpr icmp on them to see whether we know they're equal or non-equal or unsure). llvm-svn: 151093
* Fix unsigned off-by-one in comment.Benjamin Kramer2012-02-211-1/+1
| | | | llvm-svn: 151056
* InstCombine: Don't transform a signed icmp of two GEPs into a signed compare ↵Benjamin Kramer2012-02-211-0/+8
| | | | | | | | | | | of the indices. This transformation is not safe in some pathological cases (signed icmp of pointers should be an extremely rare thing, but it's valid IR!). Add an explanatory comment. Kudos to Duncan for pointing out this edge case (and not giving up explaining it until I finally got it). llvm-svn: 151055
* Check for the correct size in the invariant marker.Nick Lewycky2012-02-201-4/+7
| | | | llvm-svn: 151003
* Fix 80-column violation.Chad Rosier2012-02-201-1/+2
| | | | llvm-svn: 150998
* InstCombine: Removing the base from the address calculation is only safe ↵Benjamin Kramer2012-02-201-1/+1
| | | | | | when the GEPs are inbounds. llvm-svn: 150978
* InstCombine: When comparing two GEPs that were derived from the same base ↵Benjamin Kramer2012-02-201-0/+14
| | | | | | | | pointer but use different types, expand the offset calculation and to the compare on the offset if profitable. This came up in SmallVector code. llvm-svn: 150962
* InstCombine: Make OptimizePointerDifference more aggressive.Benjamin Kramer2012-02-201-27/+27
| | | | | | | | | - Ignore pointer casts. - Also expand GEPs that aren't constantexprs when they have one use or only constant indices. - We now compile "&foo[i] - &foo[j]" into "i - j". llvm-svn: 150961
* Rename class Evaluate to Evaluator and put it in an anonymous namespace.Nick Lewycky2012-02-201-12/+17
| | | | llvm-svn: 150947
* Move EvaluateFunction and EvaluateBlock into a class, and make the class storeNick Lewycky2012-02-191-122/+137
| | | | | | the information that they pass around between them. No functionality change! llvm-svn: 150939
* Remove dead code. Improve llvm_unreachable text. Simplify some control flow.Ahmed Charles2012-02-191-1/+0
| | | | llvm-svn: 150918
* Calls and invokes with the new clang.arc.no_objc_arc_exceptionsDan Gohman2012-02-171-6/+47
| | | | | | | | metadata may still unwind, but only in ways that the ARC optimizer doesn't need to consider. This permits more aggressive optimization. llvm-svn: 150829
* Add support for invariant.start inside the static constructor evaluator. This isNick Lewycky2012-02-171-12/+47
| | | | | | | | | useful to represent a variable that is const in the source but can't be constant in the IR because of a non-trivial constructor. If globalopt evaluates the constructor, and there was an invariant.start with no matching invariant.end possible, it will mark the global constant afterwards. llvm-svn: 150794
* Remove redundant comment. Use a more efficient datatype.Bill Wendling2012-02-171-13/+4
| | | | llvm-svn: 150780
* Fix some grammar-os and formatting.Bill Wendling2012-02-171-21/+17
| | | | llvm-svn: 150779
* 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
OpenPOWER on IntegriCloud