aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* 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). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149468 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149457 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149445 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149369 91177308-0d34-0410-b5e6-96231b3b80d8
* Cache the size of the vector instead of calling .size() all over the place.Bill Wendling2012-01-311-5/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149368 91177308-0d34-0410-b5e6-96231b3b80d8
* eliminate the "string" form of ConstantArray::get, usingChris Lattner2012-01-311-1/+1
| | | | | | | ConstantDataArray::getString instead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149365 91177308-0d34-0410-b5e6-96231b3b80d8
* eliminate the last uses of GetConstantStringInfo from this file, I didn't ↵Chris Lattner2012-01-311-7/+7
| | | | | | realize I was that close... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149354 91177308-0d34-0410-b5e6-96231b3b80d8
* start moving SimplifyLibcalls over to getConstantStringInfo, which isChris Lattner2012-01-311-49/+53
| | | | | | | dramatically more efficient than GetConstantStringInfo. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149352 91177308-0d34-0410-b5e6-96231b3b80d8
* enhance logic to support ConstantDataArray.Chris Lattner2012-01-311-8/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149340 91177308-0d34-0410-b5e6-96231b3b80d8
* s/getInnerUnwindDest/getInnerResumeDest/gBill Wendling2012-01-311-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149328 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove ivar which is identical to another ivar.Bill Wendling2012-01-311-10/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149323 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused ivars and s/getOuterUnwindDest/getOuterResumeDest/g.Bill Wendling2012-01-311-9/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149322 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove more dead functions.Bill Wendling2012-01-311-211/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149318 91177308-0d34-0410-b5e6-96231b3b80d8
* s/getInnerUnwindDestNewEH/getInnerUnwindDest/gBill Wendling2012-01-311-4/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149317 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove some unused, old-EH methods.Bill Wendling2012-01-311-116/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149316 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149314 91177308-0d34-0410-b5e6-96231b3b80d8
* Formatting cleanups. No functionality change.Bill Wendling2012-01-311-20/+20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149312 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove no-longer-useful dyn_casts and pals.Bill Wendling2012-01-311-21/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149307 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] fix the ObjC support (asan Issue #33)Kostya Serebryany2012-01-301-13/+21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149300 91177308-0d34-0410-b5e6-96231b3b80d8
* Typo.Chad Rosier2012-01-301-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149289 91177308-0d34-0410-b5e6-96231b3b80d8
* Typo.Chad Rosier2012-01-301-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149275 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149243 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix typo.Nick Lewycky2012-01-281-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149185 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] correctly use ConstantExpr::getGetElementPtr. Catch by NAKAMURA TakumiKostya Serebryany2012-01-281-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149172 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149116 91177308-0d34-0410-b5e6-96231b3b80d8
* Continue improving support for ConstantDataAggregate, and use theChris Lattner2012-01-263-52/+20
| | | | | | | new methods recently added to (sometimes greatly!) simplify code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149024 91177308-0d34-0410-b5e6-96231b3b80d8
* some general cleanup, using new methods and tidying up old code.Chris Lattner2012-01-261-69/+26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149006 91177308-0d34-0410-b5e6-96231b3b80d8
* Gracefully degrade precision in branch probability numbers.Nick Lewycky2012-01-251-17/+72
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148946 91177308-0d34-0410-b5e6-96231b3b80d8
* use Constant::getAggregateElement to simplify a bunch of code.Chris Lattner2012-01-252-78/+24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148934 91177308-0d34-0410-b5e6-96231b3b80d8
* use ConstantVector::getSplat in a few places.Chris Lattner2012-01-253-5/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148929 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] enable asan only for the functions that have Attribute::AddressSafetyKostya Serebryany2012-01-241-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148846 91177308-0d34-0410-b5e6-96231b3b80d8
* basic instcombine support for CDS.Chris Lattner2012-01-242-14/+32
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148806 91177308-0d34-0410-b5e6-96231b3b80d8
* Implemented AddressSanitizer::getPassName()Alexander Potapenko2012-01-231-0/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148697 91177308-0d34-0410-b5e6-96231b3b80d8
* More dead code removal (using -Wunreachable-code)David Blaikie2012-01-206-8/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148578 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148572 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148553 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148535 91177308-0d34-0410-b5e6-96231b3b80d8
* Set the "tail" flag on pattern-matched objc_storeStrong calls.Dan Gohman2012-01-191-0/+32
| | | | | | | rdar://10531041. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148490 91177308-0d34-0410-b5e6-96231b3b80d8
* Actually, this code handles wrapped sets just fine. Noticed by inspection.Nick Lewycky2012-01-191-3/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148487 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a depth limit to avoid runaway recursion.Dan Gohman2012-01-181-3/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148419 91177308-0d34-0410-b5e6-96231b3b80d8
* Use llvm.global_ctors to locate global constructors insteadDan Gohman2012-01-181-6/+19
| | | | | | | of recognizing them by name. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148416 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove trailing spaces and unneeded includes.Jakub Staszak2012-01-181-134/+131
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148415 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new ObjC ARC optimization pass to eliminate unneededDan Gohman2012-01-172-1/+118
| | | | | | | autorelease push+pop pairs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148330 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new PassManagerBuilder customization point,Dan Gohman2012-01-171-0/+2
| | | | | | | | EP_ModuleOptimizerEarly, to allow passes to be added before the main ModulePass optimizers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148329 91177308-0d34-0410-b5e6-96231b3b80d8
* LSR fix: broaden the check for loop preheaders.Andrew Trick2012-01-171-5/+13
| | | | | | | | It's becoming clear that LoopSimplify needs to unconditionally create loop preheaders. But that is a bigger fix. For now, continuing to hack LSR. Fixes rdar://10701050 "Cannot split an edge from an IndirectBrInst" assert. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148288 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unreachable code. (replace with llvm_unreachable to help GCC where ↵David Blaikie2012-01-173-3/+0
| | | | | | necessary) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148284 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed comment in loop-unswitch.Stepan Dyatkovskiy2012-01-161-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148252 91177308-0d34-0410-b5e6-96231b3b80d8
* Cosmetic patch for r148215.Stepan Dyatkovskiy2012-01-151-13/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148216 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixup for r148132. Type replacement for LoopsProperties: from DenseMap to ↵Stepan Dyatkovskiy2012-01-151-114/+180
| | | | | | | | | | std::map, since we need to keep a valid pointer to properties of current loop. Message for r148132: LoopUnswitch: All helper data that is collected during loop-unswitch iterations was moved to separated class (LUAnalysisCache). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148215 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix an unused variable warning that Chad noticed.Dan Gohman2012-01-141-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148164 91177308-0d34-0410-b5e6-96231b3b80d8