aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Follow-up to r152620: restore JIT event listener tests to ↵Eli Bendersky2012-03-157-34/+32
| | | | | | unittest/ExecutionEngine/JIT git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152780 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a xform to the DAG combiner.Bill Wendling2012-03-151-0/+17
| | | | | | | | | | | | | Transform: (fsub x, (fadd x, y)) -> (fneg y) and (fsub x, (fadd y, x)) -> (fneg y) if 'unsafe math' is specified. <rdar://problem/7540295> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152777 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the basic inliner. This was added in 2007, and hasn't reallyChandler Carruth2012-03-153-238/+0
| | | | | | | changed since. No one was using it. It is yet another consumer of the InlineCost interface that I'd like to change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152769 91177308-0d34-0410-b5e6-96231b3b80d8
* Make the swap code here a bit more obvious what its doing... We'reChandler Carruth2012-03-151-1/+1
| | | | | | | essentially sorting the pair's arguments. I'd love to actually call sort here, but I'm just not that crazy. ;] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152764 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't assume that the arguments are processed in some particular order.Chandler Carruth2012-03-151-2/+4
| | | | | | | This appears to not be the case with dragonegg at least in some contexts. Hopefully will fix the bootstrap assert failure there. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152763 91177308-0d34-0410-b5e6-96231b3b80d8
* [avx] Add patterns for VINSERTF128rm.Chad Rosier2012-03-152-0/+25
| | | | | | | | | | | | | | | This results in things such as vmovaps -96(%rbx), %xmm1 vinsertf128 $1, %xmm1, %ymm0, %ymm0 to be combined to vinsertf128 $1, -96(%rbx), %ymm0, %ymm0 rdar://10643481 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152762 91177308-0d34-0410-b5e6-96231b3b80d8
* This pass didn't want the inline cost per-se, it just wants generic codeChandler Carruth2012-03-151-1/+1
| | | | | | metrics. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152760 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove all remnants of partial specialization in the cost computationChandler Carruth2012-03-152-81/+0
| | | | | | side of things. This is all dead code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152759 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed a transform crash when setting a negative size value for memset. ↵Aaron Ballman2012-03-152-2/+26
| | | | | | Fixes PR12202. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152756 91177308-0d34-0410-b5e6-96231b3b80d8
* [tsan] use FunctionBlackListKostya Serebryany2012-03-141-0/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152755 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] rename class BlackList to FunctionBlackList and move it into a ↵Kostya Serebryany2012-03-144-70/+120
| | | | | | separate file -- we will need the same functionality in ThreadSanitizer git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152753 91177308-0d34-0410-b5e6-96231b3b80d8
* Extend the inline cost calculation to account for bonuses due toChandler Carruth2012-03-145-16/+168
| | | | | | | | | | | | | | | | | | | | | | | | | | | correlated pairs of pointer arguments at the callsite. This is designed to recognize the common C++ idiom of begin/end pointer pairs when the end pointer is a constant offset from the begin pointer. With the C-based idiom of a pointer and size, the inline cost saw the constant size calculation, and this provides the same level of information for begin/end pairs. In order to propagate this information we have to search for candidate operations on a pair of pointer function arguments (or derived from them) which would be simplified if the pointers had a known constant offset. Then the callsite analysis looks for such pointer pairs in the argument list, and applies the appropriate bonus. This helps LLVM detect that half of bounds-checked STL algorithms (such as hash_combine_range, and some hybrid sort implementations) disappear when inlined with a constant size input. However, it's not a complete fix due the inaccuracy of our cost metric for constants in general. I'm looking into that next. Benchmarks showed no significant code size change, and very minor performance changes. However, specific code such as hashing is showing significantly cleaner inlining decisions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152752 91177308-0d34-0410-b5e6-96231b3b80d8
* When an invoke is marked with metadata indicating its unwind edgeDan Gohman2012-03-142-1/+38
| | | | | | | | should be ignored by ARC optimization, don't insert new ARC runtime calls in the unwind destination. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152748 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixes the MSVC build.Francois Pichet2012-03-141-4/+0
| | | | | | | | | | | | | | | | Commit r152704 exposed a latent MSVC limitation (aka bug). Both ilist and and iplist contains the same function: template<class InIt> void insert(iterator where, InIt first, InIt last) { for (; first != last; ++first) insert(where, *first); } Also ilist inherits from iplist and ilist contains a "using iplist<NodeTy>::insert". MSVC doesn't know which one to pick and complain with an error. I think it is safe to delete ilist::insert since it is redundant anyway. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152746 91177308-0d34-0410-b5e6-96231b3b80d8
* Change where we enable the heuristic that delays inlining into functionsChandler Carruth2012-03-141-7/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | which are small enough to themselves be inlined. Delaying in this manner can be harmful if the function is inelligible for inlining in some (or many) contexts as it pessimizes the code of the function itself in the event that inlining does not eventually happen. Previously the check was written to only do this delaying of inlining for static functions in the hope that they could be entirely deleted and in the knowledge that all callers of static functions will have the opportunity to inline if it is in fact profitable. However, with C++ we get two other important sources of functions where the definition is always available for inlining: inline functions and templated functions. This patch generalizes the inliner to allow linkonce-ODR (the linkage such C++ routines receive) to also qualify for this delay-based inlining. Benchmarking across a range of large real-world applications shows roughly 2% size increase across the board, but an average speedup of about 0.5%. Some benhcmarks improved over 2%, and the 'clang' binary itself (when bootstrapped with this feature) shows a 1% -O0 performance improvement when run over all Sema, Lex, and Parse source code smashed into a single file. A clean re-build of Clang+LLVM with a bootstrapped Clang shows approximately 2% improvement, but that measurement is often noisy. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152737 91177308-0d34-0410-b5e6-96231b3b80d8
* Some typos in lit command guideEli Bendersky2012-03-141-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152712 91177308-0d34-0410-b5e6-96231b3b80d8
* Silence operator precedence warnings.Benjamin Kramer2012-03-141-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152711 91177308-0d34-0410-b5e6-96231b3b80d8
* Update the "hello world" example to resemble what we currently output.Bill Wendling2012-03-141-15/+15
| | | | | | | Also do some minor reformatting. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152707 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor the inline cost bonus calculation for constants to useChandler Carruth2012-03-141-20/+26
| | | | | | | | a worklist rather than a recursive call. No functionality changed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152706 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply r152486 with a fix for the nightly testers.Bill Wendling2012-03-141-34/+128
| | | | | | | | | | There were cases where a value could be used and it's both crossing an invoke and NOT crossing an invoke. This could happen in the landing pads. In that case, we will demote the value to the stack like we did before. <rdar://problem/10609139> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152705 91177308-0d34-0410-b5e6-96231b3b80d8
* Insert the debugging instructions in one fell-swoop so that it doesn't call theBill Wendling2012-03-141-7/+8
| | | | | | | | expensive "getFirstTerminator" call. This reduces the time of compilation in PR12258 from >10 minutes to < 10 seconds. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152704 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean up removed file after r152620Eli Bendersky2012-03-141-0/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152703 91177308-0d34-0410-b5e6-96231b3b80d8
* Typo in lit command guideEli Bendersky2012-03-141-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152702 91177308-0d34-0410-b5e6-96231b3b80d8
* misched: implemented a framework for top-down or bottom-up scheduling.Andrew Trick2012-03-144-103/+282
| | | | | | | | | | | | | | | | | | | New flags: -misched-topdown, -misched-bottomup. They can be used with the default scheduler or with -misched=shuffle. Without either topdown/bottomup flag -misched=shuffle now alternates scheduling direction. LiveIntervals update is unimplemented with bottom-up scheduling, so only -misched-topdown currently works. Capped the ScheduleDAG hierarchy with a concrete ScheduleDAGMI class. ScheduleDAGMI is aware of the top and bottom of the unscheduled zone within the current region. Scheduling policy can be plugged into the ScheduleDAGMI driver by implementing MachineSchedStrategy. ConvergingScheduler is now the default scheduling algorithm. It exercises the new driver but still does no reordering. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152700 91177308-0d34-0410-b5e6-96231b3b80d8
* misched commentsAndrew Trick2012-03-141-0/+15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152699 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the DW_AT_MIPS_linkage name attribute when we don't need itEric Christopher2012-03-145-11/+66
| | | | | | | | | | | output (we're emitting a specification already and the information isn't changing). Saves 1% on the debug information for a build of llvm. Fixes rdar://11043421 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152697 91177308-0d34-0410-b5e6-96231b3b80d8
* Move APInt::operator[] inline.Benjamin Kramer2012-03-142-7/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152692 91177308-0d34-0410-b5e6-96231b3b80d8
* Move APInt::operator! inline, it's small and fuses well with surrounding ↵Benjamin Kramer2012-03-142-11/+9
| | | | | | code when inlined. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152688 91177308-0d34-0410-b5e6-96231b3b80d8
* Fortify r152675 a bit. Although I'm not able to come up with a test case ↵Evan Cheng2012-03-131-3/+11
| | | | | | that would trigger the truncation case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152678 91177308-0d34-0410-b5e6-96231b3b80d8
* DAG combine incorrectly optimize (i32 vextract (v4i16 load $addr), c) toEvan Cheng2012-03-132-4/+35
| | | | | | | | | | (i16 load $addr+c*sizeof(i16)) and replace uses of (i32 vextract) with the i16 load. It should issue an extload instead: (i32 extload $addr+c*sizeof(i16)). rdar://11035895 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152675 91177308-0d34-0410-b5e6-96231b3b80d8
* Target override to allow CodeGenPrepare to sink address operands to ↵Pete Cooper2012-03-132-0/+21
| | | | | | intrinsics in the same way it current does for loads and stores git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152666 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a sanity check in MemoryBuffer::getOpenFile() to make sure we don't hangArgyrios Kyrtzidis2012-03-131-1/+5
| | | | | | | | if the passed in FileSize is inaccurate. rdar://11034179 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152662 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove an old hack for pre-2005 MSVC. We don't support ancient microsoft ↵Benjamin Kramer2012-03-131-24/+0
| | | | | | compilers anymore. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152659 91177308-0d34-0410-b5e6-96231b3b80d8
* s/SjLjEHPass/SjLjEHPrepare/Bill Wendling2012-03-133-20/+20
| | | | | | | No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152658 91177308-0d34-0410-b5e6-96231b3b80d8
* Change the X86 assembler to not require a segment register on stringKevin Enderby2012-03-132-4/+8
| | | | | | | | instruction's destination operand like it does for the source operand. Also fix a typo in the comment for X86AsmParser::isSrcOp(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152654 91177308-0d34-0410-b5e6-96231b3b80d8
* enhance jump threading to preserve TBAA information when PRE'ing loads,Chris Lattner2012-03-134-9/+76
| | | | | | | | fixing rdar://11039258, an issue that came up when inspecting clang's bootstrapped codegen. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152635 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach globalopt how to evaluate an invoke with a non-void return type.Dan Gohman2012-03-132-5/+33
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152634 91177308-0d34-0410-b5e6-96231b3b80d8
* Generalize the "trunc(ptrtoint(x)) - trunc(ptrtoint(y)) ->Duncan Sands2012-03-133-17/+53
| | | | | | | trunc(ptrtoint(x-y))" optimization introduced by Chandler. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152626 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed comments for SwitchInst::addCase and for SwitchInst::removeCase.Stepan Dyatkovskiy2012-03-131-3/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152624 91177308-0d34-0410-b5e6-96231b3b80d8
* Uniformize the InstructionSimplify interface by ensuring that all routinesDuncan Sands2012-03-133-337/+281
| | | | | | | | | take a TargetLibraryInfo parameter. Internally, rather than passing TD, TLI and DT parameters around all over the place, introduce a struct for holding them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152623 91177308-0d34-0410-b5e6-96231b3b80d8
* Add profiling support for Intel Parallel Amplifier XE (VTune) for JITted ↵Eli Bendersky2012-03-1334-341/+2243
| | | | | | | | | | | | | code in LLVM. Also refactor the existing OProfile profiling code to reuse the same interfaces with the VTune profiling code. In addition, unit tests for the profiling interfaces were added. This patch was prepared by Andrew Kaylor and Daniel Malea, and reviewed in the llvm-commits list by Jim Grosbach git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152620 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused field from FixedLenDecoderEmitter. Move NumberedInstructions ↵Craig Topper2012-03-132-5/+3
| | | | | | declaration from class to run method since its only used there and was being reinitialized anyway. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152616 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a return type.Bill Wendling2012-03-131-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152614 91177308-0d34-0410-b5e6-96231b3b80d8
* Inline the d'tor and add an anchor instead.Bill Wendling2012-03-132-2/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152613 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor the SelectionDAG's 'dump' methods into their own .cpp file.Bill Wendling2012-03-133-633/+632
| | | | | | | No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152611 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed typo in comment.Lang Hames2012-03-131-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152610 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix regression from r151466: an we can't replace uses of an instruction ↵Eli Friedman2012-03-132-3/+26
| | | | | | reachable from the entry block with uses of an instruction not reachable from the entry block. PR12231. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152595 91177308-0d34-0410-b5e6-96231b3b80d8
* Address some review comments from Duncan. This moves the iterativeChandler Carruth2012-03-131-32/+23
| | | | | | | | | | | | | | | | | | | offset accumulation to use a boring APInt instead of ConstantExprs. I didn't go all the way to an 'int64_t' because I wanted APInt to handle any magic required to properly wrap the arithmetic when the pointer width is <64 bits. If there is a significant penalty from using APInt here, first off WTF, and secondly let me know and I'll do the math by hand. I've left one layer still operating w/ ConstantExpr because it makes the interface quite a bit simpler, and that one isn't iterative so has much lower cost. I suppose this may potentially speed up some strang compilation situations, but I don't really expect much. It should have no functional impact either way. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152590 91177308-0d34-0410-b5e6-96231b3b80d8
* lit: Pass %INCLUDE% to tests on Win32. clang may expect existence of ↵NAKAMURA Takumi2012-03-131-0/+1
| | | | | | %INCLUDE% in vcvarsall.bat. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152588 91177308-0d34-0410-b5e6-96231b3b80d8
* Change the second line of the test added for r152414 to use CHECK-NEXT.Kevin Enderby2012-03-121-1/+1
| | | | | | | Suggestion by Bill Wendling! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152582 91177308-0d34-0410-b5e6-96231b3b80d8