summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* another fix for PR3354Chris Lattner2009-01-201-0/+5
| | | | llvm-svn: 62561
* Doxygen-ify comments.Bill Wendling2009-01-191-45/+43
| | | | llvm-svn: 62546
* Fix a problem exposed by PR3354: simplifycfg was making a potentiallyChris Lattner2009-01-191-1/+14
| | | | | | trapping instruction be executed unconditionally. llvm-svn: 62541
* improve compatibility with cygwin, patch by Jay Foad!Chris Lattner2009-01-191-1/+1
| | | | llvm-svn: 62535
* Fix PR3353, infinitely jump threading an infinite loop make from switches.Chris Lattner2009-01-191-0/+5
| | | | llvm-svn: 62529
* Temporarily revert r62487. It's causing this error during a release bootstrap ofBill Wendling2009-01-191-77/+2
| | | | | | | | | | | | | | | | llvm-gcc. Most likely, it's miscompiling one of the "gen*" programs: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm-gcc.obj/./prev-gcc/xgcc -B/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm-gcc.obj/./prev-gcc/ -B/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm-gcc.install/i386-apple-darwin9.6.0/bin/ -c -g -O2 -mdynamic-no-pic -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -mdynamic-no-pic -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -Ibuild -I../../llvm-gcc.src/gcc -I../../llvm-gcc.src/gcc/build -I../../llvm-gcc.src/gcc/../include -I./../intl -I../../llvm-gcc.src/gcc/../libcpp/include -I../../llvm-gcc.src/gcc/../libdecnumber -I../libdecnumber -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.obj/include -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/include -DENABLE_LLVM -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.obj/../llvm.src/include -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -o build/gencondmd.o build/gencondmd.c ../../llvm-gcc.src/gcc/config/i386/mmx.md:926: error: expected '}' before ')' token ../../llvm-gcc.src/gcc/config/i386/mmx.md:926: warning: excess elements in struct initializer ../../llvm-gcc.src/gcc/config/i386/mmx.md:926: warning: (near initialization for 'insn_conditions[4]') ../../llvm-gcc.src/gcc/config/i386/mmx.md:926: error: expected '}' before ')' token ../../llvm-gcc.src/gcc/config/i386/mmx.md:926: error: expected ',' or ';' before ')' token ../../llvm-gcc.src/gcc/config/i386/mmx.md:927: error: expected identifier or '(' before ',' token ../../llvm-gcc.src/gcc/config/i386/sse.md:3458: error: expected identifier or '(' before ',' token ... llvm-svn: 62506
* Fix PR3016, a bug which can occur do to an invalid assumption:Chris Lattner2009-01-191-2/+77
| | | | | | | | | we assumed a CFG structure that would be valid when all code in the function is reachable, but not all code is necessarily reachable. Do a simple, but horrible, CFG walk to check for this case. llvm-svn: 62487
* reduce indentation by using 'continue', no functionality change.Chris Lattner2009-01-191-20/+22
| | | | llvm-svn: 62477
* Fix some problems in SpeculativelyExecuteBB. Basically,Chris Lattner2009-01-191-5/+16
| | | | | | | | | | because of dead code, a phi could use the speculated instruction that was not in "BB2". Make this check explicit and tighten up some other corners. This fixes PR3292. No testcase becauase this depends entirely on visitation order of blocks and requires a sequence of 8 passes to repro. llvm-svn: 62476
* Make this a bit more explicit about which cases need the Chris Lattner2009-01-181-2/+6
| | | | | | check. No functionality change. llvm-svn: 62474
* Fix rdar://6505632, an llc crash on 483.xalancbmkChris Lattner2009-01-181-1/+2
| | | | llvm-svn: 62470
* BasicAliasAnalysis and FunctionAttrs were bothDuncan Sands2009-01-181-81/+2
| | | | | | | | | doing very similar pointer capture analysis. Factor out the common logic. The new version is from FunctionAttrs since it does a better job than the version in BasicAliasAnalysis llvm-svn: 62461
* Fix copy and pasted typos that prevented strtok_r, realloc, getenv, ungetc,Nick Lewycky2009-01-181-22/+152
| | | | | | | | | | | | | | | | | | | putc, puts, perror, vscanf and vsscanf from getting annotations. Add annotations for eight printf functions, memalign, pread and pwrite. On Linux, llvm-gcc sometimes renames strdup, getc, putc, strtok_r, scanf and sscanf. Match the alternate function names. Fix a crash annotating opendir. Don't mark fsetpos's second parameter as nocapture. It's supposed to be captured. Do mark fopen's path and mode strings as nocapture. Mark ferror as readonly, but not fileno which may set errno. llvm-svn: 62456
* introduce typedef for complicated vector, and use it tooGabor Greif2009-01-171-2/+1
| | | | llvm-svn: 62384
* typoGabor Greif2009-01-161-1/+1
| | | | llvm-svn: 62377
* Fix PR3335 by not turning a store to one address space into a store to another.Chris Lattner2009-01-161-1/+5
| | | | llvm-svn: 62351
* reduce indentation by using early exits, no functionality change.Chris Lattner2009-01-161-44/+47
| | | | llvm-svn: 62350
* Clean up previous cast optimization a bit. Also make zext elimination a bit ↵Evan Cheng2009-01-161-30/+55
| | | | | | more aggressive: if it's not necessary to emit an AND (i.e. high bits are already zero), it's profitable to evaluate the operand at a different type. llvm-svn: 62297
* Add the private linkage.Rafael Espindola2009-01-1515-35/+38
| | | | llvm-svn: 62279
* avoid using iterators when they get invalidated potentiallyGabor Greif2009-01-151-4/+14
| | | | | | this fixes PR3332 llvm-svn: 62271
* Eliminate a redundant check.Evan Cheng2009-01-151-2/+1
| | | | llvm-svn: 62264
* - Teach CanEvaluateInDifferentType of this xform: sext (zext ty1), ty2 -> ↵Evan Cheng2009-01-151-22/+51
| | | | | | | | zext ty2 - Looking at the number of sign bits of the a sext instruction to determine whether new trunc + sext pair should be added when its source is being evaluated in a different type. llvm-svn: 62263
* Fix PR3325, a miscompilation of invokes by IPSCCP. Patch by Jay Foad!Chris Lattner2009-01-141-3/+2
| | | | llvm-svn: 62244
* Fix the time regression I introduced in 464.h264ref withDale Johannesen2009-01-141-44/+187
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | my earlier patch to this file. The issue there was that all uses of an IV inside a loop are actually references to Base[IV*2], and there was one use outside that was the same but LSR didn't see the base or the scaling because it didn't recurse into uses outside the loop; thus, it used base+IV*scale mode inside the loop instead of pulling base out of the loop. This was extra bad because register pressure later forced both base and IV into memory. Doing that recursion, at least enough to figure out addressing modes, is a good idea in general; the change in AddUsersIfInteresting does this. However, there were side effects.... It is also possible for recursing outside the loop to introduce another IV where there was only 1 before (if the refs inside are not scaled and the ref outside is). I don't think this is a common case, but it's in the testsuite. It is right to be very aggressive about getting rid of such introduced IVs (CheckForIVReuse and the handling of nonzero RewriteFactor in StrengthReduceStridedIVUsers). In the testcase in question the new IV produced this way has both a nonconstant stride and a nonzero base, neither of which was handled before. And when inserting new code that feeds into a PHI, it's right to put such code at the original location rather than in the PHI's immediate predecessor(s) when the original location is outside the loop (a case that couldn't happen before) (RewriteInstructionToUseNewBase); better to avoid making multiple copies of it in this case. Also, the mechanism for keeping SCEV's corresponding to GEP's no longer works, as the GEP might change after its SCEV is remembered, invalidating the SCEV, and we might get a bad SCEV value when looking up the GEP again for a later loop. This also couldn't happen before, as we weren't recursing into GEP's outside the loop. Also, when we build an expression that involves a (possibly non-affine) IV from a different loop as well as an IV from the one we're interested in (containsAddRecFromDifferentLoop), don't recurse into that. We can't do much with it and will get in trouble if we try to create new non-affine IVs or something. More testcases are coming. llvm-svn: 62212
* rewrite OptimizeAwayTrappingUsesOfLoads to 1) avoid a temporaryChris Lattner2009-01-141-24/+26
| | | | | | | | vector and extraneous loop over it, 2) not delete globals used by phis/selects etc which could actually be useful. This fixes PR3321. Many thanks to Duncan for narrowing this down. llvm-svn: 62201
* Fix testsuite regressions from recursive inlining.Dale Johannesen2009-01-131-3/+3
| | | | llvm-svn: 62189
* Make instcombine ensure that all allocas are explicitly aligned at atDan Gohman2009-01-131-6/+11
| | | | | | least their preferred alignment. llvm-svn: 62176
* Correct a comment.Duncan Sands2009-01-131-1/+1
| | | | llvm-svn: 62165
* Enable recursive inlining. Reduce inlining thresholdDale Johannesen2009-01-122-8/+6
| | | | | | | back to 200; 400 seems to be too high, loses more than it gains. llvm-svn: 62107
* Rename getABITypeSize to getTypePaddedSize, asDuncan Sands2009-01-128-50/+52
| | | | | | suggested by Chris. llvm-svn: 62099
* Increase default inlining aggressiveness in partialDale Johannesen2009-01-111-2/+2
| | | | | | | | | compensation for turning off gcc's inliner. This gets us closer to the amount of inlining we were getting before. It is not a win on everything, of course, but seems to gain overall. llvm-svn: 62058
* Duncan is nervous about undefinedness of % with negatives. I'mChris Lattner2009-01-111-1/+1
| | | | | | not thrilled about 64-bit % in general, so rewrite to use * instead. llvm-svn: 62047
* do not generated GEPs into vectors where they don't already exist.Chris Lattner2009-01-111-4/+3
| | | | | | We should treat vectors as atomic types, not like arrays. llvm-svn: 62046
* Make a couple of cleanups to the instcombine bitcast/gep Chris Lattner2009-01-111-12/+13
| | | | | | | | | | | | | canonicalization transform based on duncan's comments: 1) improve the comment about %. 2) within our index loop make sure the offset stays within the *type size*, instead of within the *abi size*. This allows us to reason explicitly about landing in tail padding and means that issues like non-zero offsets into [0 x foo] types don't occur anymore. llvm-svn: 62045
* fix typo Duncan noticed.Chris Lattner2009-01-091-1/+1
| | | | llvm-svn: 61997
* Fix PR3304Chris Lattner2009-01-091-2/+12
| | | | llvm-svn: 61995
* Removed trailing whitespace from Makefiles.Misha Brukman2009-01-096-14/+14
| | | | llvm-svn: 61991
* Implement rdar://6480391, extending of equality icmp's to avoid a truncation.Chris Lattner2009-01-091-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I noticed this in the code compiled for a routine using std::map, which produced this code: %25 = tail call i32 @memcmp(i8* %24, i8* %23, i32 6) nounwind readonly %.lobit.i = lshr i32 %25, 31 ; <i32> [#uses=1] %tmp.i = trunc i32 %.lobit.i to i8 ; <i8> [#uses=1] %toBool = icmp eq i8 %tmp.i, 0 ; <i1> [#uses=1] br i1 %toBool, label %bb3, label %bb4 which compiled to: call L_memcmp$stub shrl $31, %eax testb %al, %al jne LBB1_11 ## with this change, we compile it to: call L_memcmp$stub testl %eax, %eax js LBB1_11 This triggers all the time in common code, with patters like this: %169 = and i32 %ply, 1 ; <i32> [#uses=1] %170 = trunc i32 %169 to i8 ; <i8> [#uses=1] %toBool = icmp ne i8 %170, 0 ; <i1> [#uses=1] %7 = lshr i32 %6, 24 ; <i32> [#uses=1] %9 = trunc i32 %7 to i8 ; <i8> [#uses=1] %10 = icmp ne i8 %9, 0 ; <i1> [#uses=1] etc llvm-svn: 61985
* Remove some old code that looks like a remanant from signed-types days.Chris Lattner2009-01-091-23/+0
| | | | llvm-svn: 61984
* Fix PR3298, a crash in Jump Threading. Apparently even Chris Lattner2009-01-091-0/+4
| | | | | | jump threading can have bugs, who knew? ;-) llvm-svn: 61983
* Fix part 3/2 of PR3290, making instcombine zap (gep(bitcast)) when possible.Chris Lattner2009-01-091-81/+116
| | | | llvm-svn: 61980
* move some code, check to see if the input to the GEP is a bitcastChris Lattner2009-01-091-23/+22
| | | | | | (which is constant time and cheap) before checking hasAllZeroIndices. llvm-svn: 61976
* Adjustments to last patch based on review.Dale Johannesen2009-01-094-11/+24
| | | | llvm-svn: 61969
* Do not inline functions with (dynamic) alloca intoDale Johannesen2009-01-081-2/+20
| | | | | | | | | | | functions that don't already have a (dynamic) alloca. Dynamic allocas cause inefficient codegen and we shouldn't propagate this (behavior follows gcc). Two existing tests assumed such inlining would be done; they are hacked by adding an alloca in the caller, preserving the point of the tests. llvm-svn: 61946
* This implements the second half of the fix for PR3290, handlingChris Lattner2009-01-081-2/+99
| | | | | | | | | loads from allocas that cover the entire aggregate. This handles some memcpy/byval cases that are produced by llvm-gcc. This triggers a few times in kc++ (with std::pair<std::_Rb_tree_const_iterator <kc::impl_abstract_phylum*>,bool>) and once in 176.gcc (with %struct..0anon). llvm-svn: 61915
* Whitespace - correct formatting.Duncan Sands2009-01-071-2/+2
| | | | llvm-svn: 61879
* Remove alloca tracking from nocapture analysis. Not onlyDuncan Sands2009-01-071-69/+16
| | | | | | | | | | was it not very helpful, it was also wrong! The problem is shown in the testcase: the alloca might be passed to a nocapture callee which dereferences it and returns the original pointer. But because it was a nocapture call we think we don't need to track its uses, but we do. llvm-svn: 61876
* Reorder these.Duncan Sands2009-01-071-24/+24
| | | | llvm-svn: 61873
* Use a switch rather than a sequence of "isa" tests.Duncan Sands2009-01-071-16/+32
| | | | llvm-svn: 61872
* The verifier checks that the aliasee is not null.Duncan Sands2009-01-071-2/+1
| | | | llvm-svn: 61870
OpenPOWER on IntegriCloud