summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* backing out r99170 because it still fails on clang-x86_64-darwin10-fntGabor Greif2010-03-224-7/+7
| | | | llvm-svn: 99171
* Now that hopefully all direct accesses to InvokeInst operands are fixedGabor Greif2010-03-224-7/+7
| | | | | | we can reapply the InvokeInst operand reordering patch. (see r98957). llvm-svn: 99170
* Add a setCalledFunction member to InvokeInst (like in CallInst)Gabor Greif2010-03-202-3/+3
| | | | | | | and use this (as well as getCalledValue) to access the callee, instead of {g|s}etOperand(0). llvm-svn: 99084
* Clear the SCEVExpander's insertion point after making deletions,Dan Gohman2010-03-201-0/+4
| | | | | | | | | | | | | | so that the SCEVExpander doesn't retain a dangling pointer as its insert position. The dangling pointer in this case wasn't ever used to insert new instructions, but it was causing trouble with SCEVExpander's code for automatically advancing its insert position past debug intrinsics. This fixes use-after-free errors that valgrind noticed in test/Transforms/IndVarSimplify/2007-06-06-DeleteDanglesPtr.ll and test/Transforms/IndVarSimplify/exit_value_tests.ll. llvm-svn: 99036
* back out r98957, it broke ↵Gabor Greif2010-03-194-7/+7
| | | | | | http://smooshlab.apple.com:8010/builders/clang-x86_64-darwin10-fnt/builds/703 in the nightly test suite llvm-svn: 98958
* Recommit r80858 again (which has been backed out in r80871).Gabor Greif2010-03-194-7/+7
| | | | | | | | | | | This time I did a self-hosted bootstrap on Linux x86-64, with no problems. Let's see how darwin 64-bit self-hosting goes. At the first sign of failure I'll back this out. Maybe the valgrind bots give me a hint of what may be wrong (it at all). llvm-svn: 98957
* str[r]chr returns its pointer argument so we cannot mark it as nocapture. ↵Benjamin Kramer2010-03-161-1/+0
| | | | | | Thanks to Duncan for spotting my mistake. llvm-svn: 98671
* Mark str[r]chr readonly.Benjamin Kramer2010-03-161-1/+10
| | | | llvm-svn: 98663
* Skip debug info intrinsics.Devang Patel2010-03-151-0/+4
| | | | llvm-svn: 98584
* Skip debug info intrinsics.Devang Patel2010-03-151-0/+4
| | | | llvm-svn: 98581
* In "empty" bb, the return instruction may not be first instruction, if dbg ↵Devang Patel2010-03-151-1/+1
| | | | | | value intrinsics are present in this bb. Use terminator to find return instructions. llvm-svn: 98565
* Skip over debug info when trying to merge two return BBs.Bill Wendling2010-03-141-4/+9
| | | | llvm-svn: 98491
* Make returns more consistent with others.Bill Wendling2010-03-141-2/+2
| | | | llvm-svn: 98490
* Add a virtual destructor and give vtable a home.Benjamin Kramer2010-03-121-0/+2
| | | | llvm-svn: 98376
* Factor checked library call optimization into a common helper class and use itBenjamin Kramer2010-03-123-200/+128
| | | | | | to unify the almost identical code in CodeGenPrepare and InstCombineCalls. llvm-svn: 98338
* Whoops this already existed.Nate Begeman2010-03-111-4/+0
| | | | llvm-svn: 98297
* Add a handful of additional useful pass manager things to the C APINate Begeman2010-03-111-0/+15
| | | | llvm-svn: 98296
* stpcpy is so similar to strcpy, it doesn't deserve a complete copy of the ↵Benjamin Kramer2010-03-113-58/+11
| | | | | | __strcpy_chk -> strcpy code. llvm-svn: 98284
* Lower stpcpy_chk when possible.Eric Christopher2010-03-113-6/+40
| | | | llvm-svn: 98274
* Fix typo.Eric Christopher2010-03-111-1/+1
| | | | llvm-svn: 98260
* Do some final lowering in CodeGenPrepare of _chk calls similar toEric Christopher2010-03-111-0/+134
| | | | | | | | that in InstCombineCalls. More call lowering needed. llvm-svn: 98228
* Add strncpy libcall creator. Use it when it should be used.Eric Christopher2010-03-112-1/+22
| | | | llvm-svn: 98219
* Add a DominatorTree argument to isLCSSA so that it doesn't have toDan Gohman2010-03-105-12/+5
| | | | | | | compute a set of reachable blocks for itself each time it is called, which is fairly frequently. llvm-svn: 98179
* Fix a comment.Dan Gohman2010-03-101-1/+1
| | | | llvm-svn: 98122
* Try to keep the cached inliner costs around for a bit longer for big functions.Jakob Stoklund Olesen2010-03-093-6/+12
| | | | | | | | | | | | | | | The Caller cost info would be reset everytime a callee was inlined. If the caller has lots of calls and there is some mutual recursion going on, the caller cost info could be calculated many times. This patch reduces inliner runtime from 240s to 0.5s for a function with 20000 small function calls. This is a more conservative version of r98089 that doesn't break the clang test CodeGenCXX/temp-order.cpp. That test relies on rather extreme inlining for constant folding. llvm-svn: 98099
* Revert r98089, it was breaking a clang test.Jakob Stoklund Olesen2010-03-093-12/+6
| | | | llvm-svn: 98094
* Try to keep the cached inliner costs around for a bit longer for big functions.Jakob Stoklund Olesen2010-03-093-6/+12
| | | | | | | | | | | The Caller cost info would be reset everytime a callee was inlined. If the caller has lots of calls and there is some mutual recursion going on, the caller cost info could be calculated many times. This patch reduces inliner runtime from 240s to 0.5s for a function with 20000 small function calls. llvm-svn: 98089
* Add inlining threshold to log output.Jakob Stoklund Olesen2010-03-091-1/+4
| | | | llvm-svn: 98024
* Re-commit 97860 with fix. getMallocAllocatedType may return null.Evan Cheng2010-03-081-0/+10
| | | | llvm-svn: 98000
* Avoid using DIDescriptor.isNull(). Devang Patel2010-03-081-3/+3
| | | | | | This is a first step towards eliminating checks in Descriptor constructors. llvm-svn: 97975
* Revert r97947.Devang Patel2010-03-081-3/+3
| | | | llvm-svn: 97963
* Avoid using DIDescriptor.isNull().Devang Patel2010-03-081-3/+3
| | | | | | This is a first step towards eliminating unncessary constructor checks in light weight DIDescriptor wrappers. llvm-svn: 97947
* Let the fallthrough handle whether or not we've changed anythingEric Christopher2010-03-061-1/+3
| | | | | | before we try to optimize. llvm-svn: 97876
* Migrate _chk call lowering from SimplifyLibCalls to InstCombine. StubEric Christopher2010-03-063-136/+128
| | | | | | | | out the remainder of the calls that we should lower in some way and move the tests to the new correct directory. Fix up tests that are now optimized more than they were before by -instcombine. llvm-svn: 97875
* Temporarily revert:Eric Christopher2010-03-061-10/+0
| | | | | | | | | | | | | Log: Transform @llvm.objectsize to integer if the argument is a result of malloc of known size. Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp llvm/trunk/test/Transforms/InstCombine/objsize.ll It appears to be causing swb and nightly test failures. llvm-svn: 97866
* Transform @llvm.objectsize to integer if the argument is a result of malloc ↵Evan Cheng2010-03-061-0/+10
| | | | | | of known size. llvm-svn: 97860
* Update CMake build.Ted Kremenek2010-03-051-0/+1
| | | | llvm-svn: 97846
* Move SimplifyLibCalls's LibCall builders to a separate file so theyEric Christopher2010-03-052-386/+357
| | | | | | | | can be used in more places. Add an argument for the TargetData that most of them need. Update for the getInt8PtrTy() change. Should be no functionality change. llvm-svn: 97844
* Safely turn memset_chk etc. to non-chk variant if the known object size is ↵Evan Cheng2010-03-051-13/+19
| | | | | | >= memset / memcpy / memmove size. llvm-svn: 97828
* Instcombine should turn llvm.objectsize of a alloca with static size to an ↵Evan Cheng2010-03-051-9/+22
| | | | | | integer. llvm-svn: 97827
* fix PR6512, a case where instcombine would incorrectly merge loadsChris Lattner2010-03-051-0/+2
| | | | | | from different addr spaces. llvm-svn: 97813
* Fix PR6503. This turned into a much more interesting and nasty bug. Various Chris Lattner2010-03-053-139/+107
| | | | | | | | | | | parts of the cmp|cmp and cmp&cmp folding logic wasn't prepared for vectors (unrelated to the bug but noticed while in the code) and the code was *definitely* not safe to use by the (cast icmp)|(cast icmp) handling logic that I added in r95855. Fix all this up by changing the various routines to more consistently use IRBuilder and not pass in the I which had the wrong type. llvm-svn: 97801
* simplify some functions and make them work with vectorChris Lattner2010-03-051-62/+25
| | | | | | compares, noticed by inspection. llvm-svn: 97795
* fix a nice subtle reassociate bug which would only occurChris Lattner2010-03-051-5/+21
| | | | | | | in a very specific use pattern embodied in the carefully reduced testcase. llvm-svn: 97794
* Move GetStringLength and helper from SimplifyLibCalls to ValueTracking.Eric Christopher2010-03-051-124/+0
| | | | | | No functionality change. llvm-svn: 97793
* Add missing break for Intrinsic::objectsize case. It was falling through to ↵Evan Cheng2010-03-051-0/+1
| | | | | | the following Intrinsic::bswap code. I have no idea why it wasn't breaking stuff. llvm-svn: 97774
* Make SCEVExpander and LSR more aggressive about hoisting expressions outDan Gohman2010-03-031-4/+24
| | | | | | of loops. llvm-svn: 97642
* This test case:Bill Wendling2010-03-031-2/+4
| | | | | | | | | | | | | | | | | | | | | long test(long x) { return (x & 123124) | 3; } Currently compiles to: _test: orl $3, %edi movq %rdi, %rax andq $123127, %rax ret This is because instruction and DAG combiners canonicalize (or (and x, C), D) -> (and (or, D), (C | D)) However, this is only profitable if (C & D) != 0. It gets in the way of the 3-addressification because the input bits are known to be zero. llvm-svn: 97616
* Non-affine post-inc SCEV expansions have more code which must beDan Gohman2010-03-021-2/+6
| | | | | | | emitted after the increment. Make sure the insert position reflects this. This fixes PR6453. llvm-svn: 97537
* Floating-point add, sub, and mul are now spelled fadd, fsub, and fmul,Dan Gohman2010-03-022-4/+4
| | | | | | respectively. llvm-svn: 97531
OpenPOWER on IntegriCloud