summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Revert r160602.Nick Lewycky2012-07-211-177/+8
| | | | llvm-svn: 160603
* Teach globalopt to play nice with leak checkers. This is a reapplication ofNick Lewycky2012-07-211-8/+177
| | | | | | | | r160529 that was subsequently reverted. The fix was to not call GV->eraseFromParent() right before the caller does the same. The existing testcases already caught this bug if run under valgrind. llvm-svn: 160602
* move the bounds checking pass to the instrumentation folder, where it ↵Nuno Lopes2012-07-203-2/+2
| | | | | | | | belongs. I dunno why in the world I dropped it in the Scalar folder in the first place. No functionality change. llvm-svn: 160587
* Fix assertion in jump threading (PR13405).Richard Osborne2012-07-201-0/+2
| | | | | | | | GetBestDestForJumpOnUndef() assumes there is at least 1 successor, which isn't true if the block ends in an indirect branch with no successors. Fix this by bailing out earlier in this case. llvm-svn: 160546
* [asan] make sure that the crash callbacks do not get merged (Chandler's ↵Kostya Serebryany2012-07-201-4/+16
| | | | | | idea: insert an empty InlineAsm). Change the order in which the new BBs are inserted: the slow path BB is insert between old BBs, the crash BB is inserted at the end. Don't create an empty BB (introduced by recent commits). Update the test. The experimental code that does manual crash callback merge will most likely be deleted later. llvm-svn: 160544
* Revert r160529 due to crashes.Nick Lewycky2012-07-191-171/+8
| | | | llvm-svn: 160532
* Don't wipe out global variables that are probably storing pointers to heapNick Lewycky2012-07-191-8/+171
| | | | | | memory. This makes clang play nice with leak checkers. llvm-svn: 160529
* Replace some explicit compare loops with std::equal.Benjamin Kramer2012-07-191-4/+1
| | | | | | No functionality change. llvm-svn: 160501
* Remove tabs.Bill Wendling2012-07-193-12/+12
| | | | llvm-svn: 160477
* indvars: drive by heuristics fix.Andrew Trick2012-07-181-1/+1
| | | | | | Minor oversight noticed by inspection. Sorry no unit test. llvm-svn: 160422
* indvars: Linear function test replace should avoid reusing undef.Andrew Trick2012-07-181-5/+67
| | | | | | | | | | | | | | | | | | | | | | | Fixes PR13371: indvars pass incorrectly substitutes 'undef' values. I do not like this fix. It's needed until/unless the meaning of undef changes. It attempts to be complete according to the IR spec, but I don't have much confidence in the implementation given the difficulty testing undefined behavior. Worse, this invalidates some of my hard-fought work on indvars and LSR to optimize pointer induction variables. It results benchmark regressions, which I'll track internally. On x86_64 no LTO I see: -3% huffbench -3% 400.perlbench -8% fhourstones My only suggestion for recovering is to change the meaning of undef. If we could trust an arbitrary instruction to produce a some real value that can be manipulated (e.g. incremented) according to non-undef rules, then this case could be easily handled with SCEV. llvm-svn: 160421
* Back out r160101 and instead implement a dag combine to recover from ↵Evan Cheng2012-07-171-7/+0
| | | | | | instcombine transformation. llvm-svn: 160387
* [asan] more code to merge crash callbacks. Doesn't fully work yet, but ↵Kostya Serebryany2012-07-171-12/+58
| | | | | | allows to hold performance experiments llvm-svn: 160361
* Reapply r160340. LSR: Limit CollectSubexprs.Andrew Trick2012-07-171-28/+52
| | | | | | Speculatively fix crashes by code inspection. Can't reproduce them yet. llvm-svn: 160344
* Revert "LSR: try not to blow up solving combinatorial problems brute force."Andrew Trick2012-07-171-51/+28
| | | | | | Some units tests crashed on a different platform. llvm-svn: 160341
* LSR: try not to blow up solving combinatorial problems brute force.Andrew Trick2012-07-171-28/+51
| | | | | | | | | | This places limits on CollectSubexprs to constrains the number of reassociation possibilities. It limits the recursion depth and skips over chains of nested recurrences outside the current loop. Fixes PR13361. Although underlying SCEV behavior is still potentially bad. llvm-svn: 160340
* fix PR13339 (remove the predecessor from the unwind BB when removing an invoke)Nuno Lopes2012-07-161-0/+1
| | | | llvm-svn: 160325
* [asan] a bit more refactoring, addressed some of the style comments from ↵Kostya Serebryany2012-07-161-17/+39
| | | | | | chandlerc, partially implemented crash callback merging (under flag) llvm-svn: 160290
* [asan] refactor instrumentation to allow merging the crash callbacks (not ↵Kostya Serebryany2012-07-161-48/+93
| | | | | | fully implemented yet, no functionality change except the BB order) llvm-svn: 160284
* [asan] initialize asan error callbacks in runOnModule instead of doing that ↵Kostya Serebryany2012-07-161-8/+20
| | | | | | on-demand llvm-svn: 160269
* Revert r160254 temporarily.Chandler Carruth2012-07-161-16/+16
| | | | | | | | | | | | It turns out that ASan relied on the at-the-end block insertion order to (purely by happenstance) disable some LLVM optimizations, which in turn start firing when the ordering is made more "normal". These optimizations in turn merge many of the instrumentation reporting calls which breaks the return address based error reporting in ASan. We're looking at several different options for fixing this. llvm-svn: 160256
* Teach AddressSanitizer to create basic blocks in a more natural order.Chandler Carruth2012-07-161-16/+16
| | | | | | | | | This is particularly useful to the backend code generators which try to process things in the incoming function order. Also, cleanup some uses of IRBuilder to be a bit simpler and more clear. llvm-svn: 160254
* Move llvm/Support/TypeBuilder.h -> llvm/TypeBuilder.h. This completesChandler Carruth2012-07-151-1/+1
| | | | | | | | | | | | the move of *Builder classes into the Core library. No uses of this builder in Clang or DragonEgg I could find. If there is a desire to have an IR-building-support library that contains all of these builders, that can be easily added, but currently it seems likely that these add no real overhead to VMCore. llvm-svn: 160243
* Move llvm/Support/MDBuilder.h to llvm/MDBuilder.h, to live withChandler Carruth2012-07-152-5/+5
| | | | | | | | | | | IRBuilder, DIBuilder, etc. This is the proper layering as MDBuilder can't be used (or implemented) without the Core Metadata representation. Patches to Clang and Dragonegg coming up. llvm-svn: 160237
* LSR Fix: check SCEV expression safety before expansion.Andrew Trick2012-07-131-1/+1
| | | | | | | | | | All SCEV expressions used by LSR formulae must be safe to expand. i.e. they may not contain UDiv unless we can prove nonzero denominator. Fixes PR11356: LSR hoists UDiv. llvm-svn: 160205
* Make helper functions static.Benjamin Kramer2012-07-131-1/+1
| | | | llvm-svn: 160173
* Instcombine was transforming:Evan Cheng2012-07-121-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | %shr = lshr i64 %key, 3 %0 = load i64* %val, align 8 %sub = add i64 %0, -1 %and = and i64 %sub, %shr ret i64 %and to: %shr = lshr i64 %key, 3 %0 = load i64* %val, align 8 %sub = add i64 %0, 2305843009213693951 %and = and i64 %sub, %shr ret i64 %and The demanded bit optimization is actually a pessimization because add -1 would be codegen'ed as a sub 1. Teach the demanded constant shrinking optimization to check for negated constant to make sure it is actually reducing the width of the constant. rdar://11793464 llvm-svn: 160101
* instcombine: merge the functions that remove dead allocas and dead ↵Nuno Lopes2012-07-094-122/+73
| | | | | | | | | mallocs/callocs/... This patch removes ~70 lines in InstCombineLoadStoreAlloca.cpp and makes both functions a bit more aggressive than before :) In theory, we can be more aggressive when removing an alloca than a malloc, because an alloca pointer should never escape, but we are not taking advantage of this anyway llvm-svn: 159952
* teach instcombine to remove allocated buffers even if there are stores, ↵Nuno Lopes2012-07-061-2/+25
| | | | | | | | | | | | memcpy/memmove/memset, and objectsize users. This means we can do cheap DSE for heap memory. Nothing is done if the pointer excapes or has a load. The churn in the tests is mostly due to objectsize, since we want to make sure we don't delete the malloc call before evaluating the objectsize (otherwise it becomes -1/0) llvm-svn: 159876
* [tsan] fix compile-time falilure found while building Chromium with tsan ↵Kostya Serebryany2012-07-051-0/+5
| | | | | | (tsan issue #3). A unit test will follow separately. llvm-svn: 159736
* Reverted r156659, due to probable performance regressions, DenseMap should ↵Stepan Dyatkovskiy2012-07-041-5/+4
| | | | | | | | | | be used here: IntegersSubsetMapping - Replaced type of Items field from std::list with std::map. In neares future I'll test it with DenseMap and do the correspond replacement if possible. llvm-svn: 159703
* BoundsChecking: optimize out the check for offset < 0 if size is known to ↵Nuno Lopes2012-07-031-7/+10
| | | | | | | | be >= 0 (signed). (LLVM optimizers cannot do this optimization by themselves) llvm-svn: 159668
* Part of r159527. Splitted into series of patches and gone with fixed PR13256:Stepan Dyatkovskiy2012-07-031-4/+5
| | | | | | | | IntegersSubsetMapping - Replaced type of Items field from std::list with std::map. In neares future I'll test it with DenseMap and do the correspond replacement if possible. llvm-svn: 159659
* Revert "IntRange:" as it appears to be breaking self hosting.Eric Christopher2012-07-022-90/+152
| | | | | | This reverts commit b2833d9dcba88c6f0520cad760619200adc0442c. llvm-svn: 159618
* GlobalOpt forgot to handle bitcast when analyzing globals. Found by inspection.Duncan Sands2012-07-021-0/+2
| | | | llvm-svn: 159546
* fix the regression I introduced in r159385 (it's necessary to update PHI ↵Nuno Lopes2012-07-021-0/+3
| | | | | | nodes in unwind BB llvm-svn: 159534
* IntRange:Stepan Dyatkovskiy2012-07-022-152/+90
| | | | | | | | | | | | | | | | | | | | | | - Changed isSingleNumber method behaviour. Now this flag is calculated on demand. IntegersSubsetMapping - Optimized diff operation. - Replaced type of Items field from std::list with std::map. - Added new methods: bool isOverlapped(self &RHS) void add(self& RHS, SuccessorClass *S) void detachCase(self& NewMapping, SuccessorClass *Succ) void removeCase(SuccessorClass *Succ) SuccessorClass *findSuccessor(const IntTy& Val) const IntTy* getCaseSingleNumber(SuccessorClass *Succ) IntegersSubsetTest - DiffTest: Added checks for successors. SimplifyCFG Updated SwitchInst usage (now it is case-ragnes compatible) for - SimplifyEqualityComparisonWithOnlyPredecessor - FoldValueComparisonIntoPredecessors llvm-svn: 159527
* [asan] small code simplificationKostya Serebryany2012-07-021-18/+14
| | | | llvm-svn: 159522
* Don't reinsert the 'atexit' function if it already exists.Bill Wendling2012-06-301-2/+1
| | | | llvm-svn: 159491
* revert r159440. As Duncan pointed out, the test for invoke is not needed at ↵Nuno Lopes2012-06-291-2/+1
| | | | | | this point llvm-svn: 159471
* CodeGenPrepare: Don't crash when TLI is not available.Benjamin Kramer2012-06-291-1/+2
| | | | | | This happens when codegenprepare is invoked via opt. llvm-svn: 159457
* Rework this to clarify where the removal of nodes from the queue isDuncan Sands2012-06-291-8/+9
| | | | | | really happening. No intended functionality change. llvm-svn: 159451
* ignore 'invoke new' in isInstructionTriviallyDead, since most callers are ↵Nuno Lopes2012-06-291-1/+2
| | | | | | not ready to handle invokes. instcombine will take care of this. llvm-svn: 159440
* Fix a reassociate crash on sozefx when compiling with dragonegg+gcc-4.7 due toDuncan Sands2012-06-291-5/+13
| | | | | | | the optimizers producing a multiply expression with more multiplications than the original (!). llvm-svn: 159426
* Move llvm/Support/IRBuilder.h -> llvm/IRBuilder.hChandler Carruth2012-06-2919-110/+110
| | | | | | | | | | | | | | | | | This was always part of the VMCore library out of necessity -- it deals entirely in the IR. The .cpp file in fact was already part of the VMCore library. This is just a mechanical move. I've tried to go through and re-apply the coding standard's preferred header sort, but at 40-ish files, I may have gotten some wrong. Please let me know if so. I'll be committing the corresponding updates to Clang and Polly, and Duncan has DragonEgg. Thanks to Bill and Eric for giving the green light for this bit of cleanup. llvm-svn: 159421
* The DIBuilder class is just a wrapper around debug info creationBill Wendling2012-06-293-3/+3
| | | | | | | (a.k.a. MDNodes). The module doesn't belong in Analysis. Move it to the VMCore instead. llvm-svn: 159414
* make simplifyCFG erase invokes to readonly/readnone functionsNuno Lopes2012-06-281-6/+7
| | | | llvm-svn: 159385
* make instcombine produce calls to llvm.donothing instead of a random intrinsicNuno Lopes2012-06-281-7/+4
| | | | llvm-svn: 159384
OpenPOWER on IntegriCloud