summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
...
* [asan/tsan] extend the functionality of FunctionBlackList to globals and ↵Kostya Serebryany2012-08-242-55/+89
| | | | | | modules. Patch by Reid Watson. llvm-svn: 162565
* GVN: Fix quadratic runtime on the number of switch cases.Benjamin Kramer2012-08-241-2/+10
| | | | | | | | No intended behavior change. This was introduced in r162023. With the fixed algorithm a Release build of ARMInstPrinter.cpp goes from 16s to 10s on a 2011 MBP. llvm-svn: 162559
* SimplifyLibCalls: Give all safely-shrinkable libcalls the same treatment.Benjamin Kramer2012-08-221-5/+5
| | | | llvm-svn: 162383
* Add a few float shrinking optimizations to SimplifyLibCalls. UnsafeChad Rosier2012-08-221-36/+99
| | | | | | | optimizations are guarded by the -enable-double-float-shrink LLVM option. Last bit of PR13574. Patch by Weiming Zhao <weimingz@codeaurora.org>. llvm-svn: 162368
* Add a new helper function, AddOpt(F1, F1, Opt), as part of PR13574. NoChad Rosier2012-08-221-14/+15
| | | | | | functional change intended. Patch by Weiming Zhao <weimingz@codeaurora.org>. llvm-svn: 162363
* MaximumSpanningTree::EdgeWeightCompare: Make this comparator actually be aRichard Smith2012-08-211-25/+28
| | | | | | strict weak ordering, and don't pass possibly-null pointers to dyn_cast. llvm-svn: 162314
* Don't bind a reference to a dereferenced null pointer (for return value of ↵Richard Smith2012-08-211-1/+2
| | | | | | WeakVH::operator*). llvm-svn: 162309
* Port the global copy optimization from the SROA pass to InstCombine.Chandler Carruth2012-08-212-179/+171
| | | | | | | | | | This optimization is really just replacing allocas wholesale with globals, there is no scalarization. The underlying motivation for this patch is to simplify the SROA pass and focus it on splitting and promoting allocas. llvm-svn: 162271
* [asan] add code to detect global initialization fiasco in C/C++. The ↵Kostya Serebryany2012-08-211-63/+171
| | | | | | sub-pass is off by default for now. Patch by Reid Watson. Note: this patch changes the interface between LLVM and compiler-rt parts of asan. The corresponding patch to compiler-rt will follow. llvm-svn: 162268
* revise debug output to avoid dangling pointerMichael Liao2012-08-211-1/+1
| | | | llvm-svn: 162256
* InstCombine: Fix a crasher when encountering a function pointer.Benjamin Kramer2012-08-181-1/+1
| | | | llvm-svn: 162180
* Remove overly conservative hasOneUse check, this always expands into a ↵Benjamin Kramer2012-08-181-1/+1
| | | | | | single IR instruction. llvm-svn: 162175
* InstCombine: Add a couple of fabs identities for comparing with 0.0.Benjamin Kramer2012-08-181-0/+39
| | | | llvm-svn: 162174
* SimplifyLibcalls: Add fabs and trunc to the list of libcalls that are safe ↵Benjamin Kramer2012-08-181-0/+4
| | | | | | to shrink from double to float. llvm-svn: 162173
* Fix undefined behavior (binding a reference to a dereferenced null pointer) ifRichard Smith2012-08-171-1/+1
| | | | | | SSAUpdater was created and destroyed without being initialized. llvm-svn: 162137
* Teach GVN to reason about edges dominating uses. This allows it to handle casesRafael Espindola2012-08-161-47/+48
| | | | | | | | | | | | | where some fact lake a=b dominates a use in a phi, but doesn't dominate the basic block itself. This feature could also be implemented by splitting critical edges, but at least with the current algorithm reasoning about the dominance directly is faster. The time for running "opt -O2" in the testcase in pr10584 is 1.003 times slower and on gcc as a single file it is 1.0007 times faster. llvm-svn: 162023
* Remove dead flag.Bill Wendling2012-08-151-9/+3
| | | | llvm-svn: 161990
* [asan] implement --asan-always-slow-path, which is a part of the improvement ↵Kostya Serebryany2012-08-151-2/+5
| | | | | | to handle unaligned partially OOB accesses. See http://code.google.com/p/address-sanitizer/issues/detail?id=100 llvm-svn: 161937
* fix infinite loop in instcombine with more than 4GB memcpyMichael Liao2012-08-151-6/+4
| | | | | | | | | | | | - memcpy size is wrongly truncated into 32-bit and treat 8GB memcpy is 0-sized memcpy - as 0-sized memcpy/memset is already removed before SimplifyMemTransfer and SimplifyMemSet in visitCallInst, replace 0 checking with assertions. - replace getZExtValue() with getLimitedValue() according to Eli Friedman llvm-svn: 161923
* [asan] insert crash basic blocks inline as opposed to inserting them at the ↵Kostya Serebryany2012-08-141-30/+27
| | | | | | end of the function. This doesn't seem to fix or break anything, but is considered to be more friendly to downstream passes llvm-svn: 161870
* Change greater than to greater than or equal so that an identical sized ↵Craig Topper2012-08-141-1/+1
| | | | | | store to the same offset is treated as completing overwriting. llvm-svn: 161857
* During the CodeGenPrepare we often lower intrinsics (such as objsize)Nadav Rotem2012-08-141-0/+39
| | | | | | | | | | | and allow some optimizations to turn conditional branches into unconditional. This commit adds a simple control-flow optimization which merges two consecutive basic blocks which are connected by a single edge. This allows the codegen to operate on larger basic blocks. rdar://11973998 llvm-svn: 161852
* LICM uses AliasSet information to hoist and sink instructions. However, ↵Nadav Rotem2012-08-131-0/+5
| | | | | | | | | | | | other passes, such as LoopRotate may invalidate its AliasSet because SSAUpdater does not update the AliasSet properly. This patch teaches SSAUpdater to notify AliasSet that it made changes. The testcase in PR12901 is too big to be useful and I could not reduce it to a normal size. rdar://11872059 PR12901 llvm-svn: 161803
* [asan] remove the code for --asan-merge-callbacks as it appears to be a bad ↵Kostya Serebryany2012-08-131-78/+8
| | | | | | idea. (partly related to Bug 13225) llvm-svn: 161757
* Constify some basic blocks, no functionality change.Rafael Espindola2012-08-101-8/+8
| | | | llvm-svn: 161668
* Fix crash when when do lto on Bullet. Dynamic GEPs in SROA were incorrectly ↵Pete Cooper2012-08-101-3/+8
| | | | | | being applied to all accesses to an alloca, not just the ones which read from the GEP. Thanks to Evan for reducing the test. rdar://11861001 llvm-svn: 161654
* isAllocLikeFn is allowed to return true for functions which read memory; makeEli Friedman2012-08-081-2/+9
| | | | | | | sure we account for that correctly in DeadStoreElimination. Fixes a regression from r158919. PR13547. llvm-svn: 161468
* Avoid recomputing the unique exit blocks and their insert points when doingDan Gohman2012-08-081-11/+26
| | | | | | | | | multiple scalar promotions on a single loop. This also has the effect of preserving the order of stores sunk out of loops, which is aesthetically pleasing, and it happens to fix the testcase in PR13542, though it doesn't fix the underlying problem. llvm-svn: 161459
* Fix a serious typo in InstCombine's optimization of comparisons.Bob Wilson2012-08-071-1/+1
| | | | | | | | | An unsigned value converted to floating-point will always be greater than a negative constant. Unfortunately InstCombine reversed the check so that unsigned values were being optimized to always be greater than all positive floating-point constants. <rdar://problem/12029145> llvm-svn: 161452
* Move the "findUsedStructTypes" functionality outside of the Module class.Bill Wendling2012-08-031-2/+3
| | | | | | | | | The "findUsedStructTypes" method is very expensive to run. It needs to be optimized so that LTO can run faster. Splitting this method out of the Module class will help this occur. For instance, it can keep a list of seen objects so that it doesn't process them over and over again. llvm-svn: 161228
* remove tabs from my previous commit.Nuno Lopes2012-08-011-2/+2
| | | | | | Sorry, not used to this editor anymore.. XCode please come back; you're forgiven :) llvm-svn: 161120
* (hopefuly) fix the remaining cases where null wasnt expected (PR13497).Nuno Lopes2012-08-011-0/+4
| | | | | | I'll commit a test to the clang tree. llvm-svn: 161118
* Teach CodeGenPrep to look past bitcast when it's duplicating return instructionEvan Cheng2012-07-272-7/+34
| | | | | | | | into predecessor blocks to enable tail call optimization. rdar://11958338 llvm-svn: 160894
* fix infinite loop in instcombine in the presence of a (malformed) ↵Nuno Lopes2012-07-271-0/+4
| | | | | | | | self-referencing select inst. This can happen as long as the instruction is not reachable. Instcombine does generate these unreachable malformed selects when doing RAUW llvm-svn: 160874
* Simplify demanded bits of select sources where the condition is a constant ↵Pete Cooper2012-07-262-0/+34
| | | | | | vector llvm-svn: 160835
* Teach SimplifyDemandedBits how to look through fpext and fptrunc to simplify ↵Pete Cooper2012-07-261-0/+6
| | | | | | their operand llvm-svn: 160823
* do null checks for a few more Emit*() functions.Nuno Lopes2012-07-261-17/+15
| | | | | | Thanks Eli for noticing. llvm-svn: 160787
* Stop reassociate from looking through expressions of arbitrary complexity. ThisDuncan Sands2012-07-261-0/+2
| | | | | | is a temporary measure until my fix for PR13021 is ready. llvm-svn: 160778
* It's not safe to blindly remove invoke instructions. This happens when weNick Lewycky2012-07-251-1/+2
| | | | | | | encounter an invoke of an allocation function. This should fix the dragonegg bootstrap. Testcase to follow, later. llvm-svn: 160757
* revert r160742: it's breaking CMake buildNuno Lopes2012-07-251-4/+1
| | | | | | | original commit msg: MemoryBuiltins: add support to determine the size of strdup'ed non-constant strings llvm-svn: 160751
* MemoryBuiltins: add support to determine the size of strdup'ed non-constant ↵Nuno Lopes2012-07-251-1/+4
| | | | | | strings llvm-svn: 160742
* add EmitStrNLen()Nuno Lopes2012-07-251-0/+27
| | | | llvm-svn: 160741
* make all Emit*() functions consult the TargetLibraryInfo information before ↵Nuno Lopes2012-07-254-63/+126
| | | | | | | | | creating a call to a library function. Update all clients to pass the TLI information around. Previous draft reviewed by Eli. llvm-svn: 160733
* Don't delete one more instruction than we're allowed to. This should fix theNick Lewycky2012-07-241-1/+3
| | | | | | | Darwin bootstrap. Testcase exists but isn't fully reduced, I expect to commit the testcase this evening. llvm-svn: 160693
* Clean whitespaces.Nadav Rotem2012-07-2422-498/+500
| | | | llvm-svn: 160668
* Teach globalopt to not nuke all stores to globals. Keep them around of theyNick Lewycky2012-07-241-8/+177
| | | | | | | | | might be deliberate "one time" leaks, so that leak checkers can find them. This is a reapply of r160602 with the fix that this time I'm committing the code I thought I was committing last time; the I->eraseFromParent() goes *after* the break out of the loop. llvm-svn: 160664
* An objc_retain can serve as a may-use for a different pointer.Dan Gohman2012-07-231-1/+4
| | | | | | rdar://11931823. llvm-svn: 160637
* Suppress a warning.Nadav Rotem2012-07-231-1/+2
| | | | llvm-svn: 160629
* Fix a typo (the the => the)Sylvestre Ledru2012-07-232-3/+3
| | | | llvm-svn: 160621
* Move the initialization of the bounds checking pass. The pass itselfChandler Carruth2012-07-222-3/+3
| | | | | | moved earlier. This fixes some layering issues. llvm-svn: 160611
OpenPOWER on IntegriCloud