summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Increase the initial vector size to be equivalent to the size of the DepsBill Wendling2012-01-311-2/+2
| | | | | | vector. This potentially saves a resizing. llvm-svn: 149369
* Cache the size of the vector instead of calling .size() all over the place.Bill Wendling2012-01-311-5/+5
| | | | llvm-svn: 149368
* eliminate the "string" form of ConstantArray::get, usingChris Lattner2012-01-311-1/+1
| | | | | | ConstantDataArray::getString instead. llvm-svn: 149365
* eliminate the last uses of GetConstantStringInfo from this file, I didn't ↵Chris Lattner2012-01-311-7/+7
| | | | | | realize I was that close... llvm-svn: 149354
* start moving SimplifyLibcalls over to getConstantStringInfo, which isChris Lattner2012-01-311-49/+53
| | | | | | dramatically more efficient than GetConstantStringInfo. llvm-svn: 149352
* enhance logic to support ConstantDataArray.Chris Lattner2012-01-311-8/+13
| | | | llvm-svn: 149340
* s/getInnerUnwindDest/getInnerResumeDest/gBill Wendling2012-01-311-4/+4
| | | | llvm-svn: 149328
* Remove ivar which is identical to another ivar.Bill Wendling2012-01-311-10/+6
| | | | llvm-svn: 149323
* Remove unused ivars and s/getOuterUnwindDest/getOuterResumeDest/g.Bill Wendling2012-01-311-9/+4
| | | | llvm-svn: 149322
* Remove more dead functions.Bill Wendling2012-01-311-211/+0
| | | | llvm-svn: 149318
* s/getInnerUnwindDestNewEH/getInnerUnwindDest/gBill Wendling2012-01-311-4/+3
| | | | llvm-svn: 149317
* Remove some unused, old-EH methods.Bill Wendling2012-01-311-116/+3
| | | | llvm-svn: 149316
* Get rid of references to dead intrinsics.Bill Wendling2012-01-311-53/+5
| | | | | | | The eh.selector and eh.resume intrinsics aren't used anymore. Get rid of some calls to them. llvm-svn: 149314
* Formatting cleanups. No functionality change.Bill Wendling2012-01-311-20/+20
| | | | llvm-svn: 149312
* Remove no-longer-useful dyn_casts and pals.Bill Wendling2012-01-311-21/+10
| | | | llvm-svn: 149307
* [asan] fix the ObjC support (asan Issue #33)Kostya Serebryany2012-01-301-13/+21
| | | | llvm-svn: 149300
* Typo.Chad Rosier2012-01-301-1/+1
| | | | llvm-svn: 149289
* Typo.Chad Rosier2012-01-301-1/+1
| | | | llvm-svn: 149275
* Fix compilation of ASan tests on OS X Lion (see ↵Alexander Potapenko2012-01-301-3/+15
| | | | | | | | http://code.google.com/p/address-sanitizer/issues/detail?id=32) The redzones emitted by AddressSanitizer for CFString instances confuse the linker and are of little use, so we shouldn't add them. llvm-svn: 149243
* Fix typo.Nick Lewycky2012-01-281-2/+2
| | | | llvm-svn: 149185
* [asan] correctly use ConstantExpr::getGetElementPtr. Catch by NAKAMURA TakumiKostya Serebryany2012-01-281-1/+1
| | | | llvm-svn: 149172
* continue making the world safe for ConstantDataVector. At this point,Chris Lattner2012-01-276-36/+61
| | | | | | | we should (theoretically optimize and codegen ConstantDataVector as well as ConstantVector. llvm-svn: 149116
* Continue improving support for ConstantDataAggregate, and use theChris Lattner2012-01-263-52/+20
| | | | | | new methods recently added to (sometimes greatly!) simplify code. llvm-svn: 149024
* some general cleanup, using new methods and tidying up old code.Chris Lattner2012-01-261-69/+26
| | | | llvm-svn: 149006
* Gracefully degrade precision in branch probability numbers.Nick Lewycky2012-01-251-17/+72
| | | | llvm-svn: 148946
* use Constant::getAggregateElement to simplify a bunch of code.Chris Lattner2012-01-252-78/+24
| | | | llvm-svn: 148934
* use ConstantVector::getSplat in a few places.Chris Lattner2012-01-253-5/+4
| | | | llvm-svn: 148929
* [asan] enable asan only for the functions that have Attribute::AddressSafetyKostya Serebryany2012-01-241-0/+1
| | | | llvm-svn: 148846
* basic instcombine support for CDS.Chris Lattner2012-01-242-14/+32
| | | | llvm-svn: 148806
* Implemented AddressSanitizer::getPassName()Alexander Potapenko2012-01-231-0/+5
| | | | llvm-svn: 148697
* More dead code removal (using -Wunreachable-code)David Blaikie2012-01-206-8/+1
| | | | llvm-svn: 148578
* Handle a corner case with IV chain collection with bailout instead of assert.Andrew Trick2012-01-201-2/+6
| | | | | | Fixes PR11783: bad cast to AddRecExpr. llvm-svn: 148572
* Extend Attributes to 64 bitsKostya Serebryany2012-01-202-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Problem: LLVM needs more function attributes than currently available (32 bits). One such proposed attribute is "address_safety", which shows that a function is being checked for address safety (by AddressSanitizer, SAFECode, etc). Solution: - extend the Attributes from 32 bits to 64-bits - wrap the object into a class so that unsigned is never erroneously used instead - change "unsigned" to "Attributes" throughout the code, including one place in clang. - the class has no "operator uint64 ()", but it has "uint64_t Raw() " to support packing/unpacking. - the class has "safe operator bool()" to support the common idiom: if (Attributes attr = getAttrs()) useAttrs(attr); - The CTOR from uint64_t is marked explicit, so I had to add a few explicit CTOR calls - Add the new attribute "address_safety". Doing it in the same commit to check that attributes beyond first 32 bits actually work. - Some of the functions from the Attribute namespace are worth moving inside the class, but I'd prefer to have it as a separate commit. Tested: "make check" on Linux (32-bit and 64-bit) and Mac (10.6) built/run spec CPU 2006 on Linux with clang -O2. This change will break clang build in lib/CodeGen/CGCall.cpp. The following patch will fix it. llvm-svn: 148553
* SCEVExpander fixes. Affects LSR and indvars.Andrew Trick2012-01-202-11/+23
| | | | | | | | | | | | | | | | LSR has gradually been improved to more aggressively reuse existing code, particularly existing phi cycles. This exposed problems with the SCEVExpander's sloppy treatment of its insertion point. I applied some rigor to the insertion point problem that will hopefully avoid an endless bug cycle in this area. Changes: - Always used properlyDominates to check safe code hoisting. - The insertion point provided to SCEV is now considered a lower bound. This is usually a block terminator or the use itself. Under no cirumstance may SCEVExpander insert below this point. - LSR is reponsible for finding a "canonical" insertion point across expansion of different expressions. - Robust logic to determine whether IV increments are in "expanded" form and/or can be safely hoisted above some insertion point. Fixes PR11783: SCEVExpander assert. llvm-svn: 148535
* Set the "tail" flag on pattern-matched objc_storeStrong calls.Dan Gohman2012-01-191-0/+32
| | | | | | rdar://10531041. llvm-svn: 148490
* Actually, this code handles wrapped sets just fine. Noticed by inspection.Nick Lewycky2012-01-191-3/+1
| | | | llvm-svn: 148487
* Add a depth limit to avoid runaway recursion.Dan Gohman2012-01-181-3/+7
| | | | llvm-svn: 148419
* Use llvm.global_ctors to locate global constructors insteadDan Gohman2012-01-181-6/+19
| | | | | | of recognizing them by name. llvm-svn: 148416
* Remove trailing spaces and unneeded includes.Jakub Staszak2012-01-181-134/+131
| | | | llvm-svn: 148415
* Add a new ObjC ARC optimization pass to eliminate unneededDan Gohman2012-01-172-1/+118
| | | | | | autorelease push+pop pairs. llvm-svn: 148330
OpenPOWER on IntegriCloud