summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAge
* Make tool_output_file's raw_ostream instance a member variable insteadDan Gohman2010-09-01
| | | | | | | | | | | of a base class. This makes it possible to unregister the file from FilesToRemove when the file is done. Also, this eliminates the need for formatted_tool_output_file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112706 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an interface for unregistering a file from the FilesToRemove list.Dan Gohman2010-09-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112705 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the SSAUpdator to turn calls to eh.exception that are not in aDuncan Sands2010-09-01
| | | | | | | | | landing pad into uses of registers rather than loads from a stack slot. Doesn't touch the 'orrible hack code - Bill needs to persuade me harder :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112702 91177308-0d34-0410-b5e6-96231b3b80d8
* If PrototypeValue is erased in the middle of using the SSAUpdatorDuncan Sands2010-09-01
| | | | | | | | then the SSAUpdator may access freed memory. Instead, simply pass in the type and name explicitly, which is all that was used anyway. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112699 91177308-0d34-0410-b5e6-96231b3b80d8
* add a gross hack to work around a problem that Argiris reportedChris Lattner2010-09-01
| | | | | | | | | | | | | | on llvmdev: SRoA is introducing MMX datatypes like <1 x i64>, which then cause random problems because the X86 backend is producing mmx stuff without inserting proper emms calls. In the short term, force off MMX datatypes. In the long term, the X86 backend should not select generic vector types to MMX registers. This is being worked on, but won't be done in time for 2.8. rdar://8380055 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112696 91177308-0d34-0410-b5e6-96231b3b80d8
* Use movlps, movlpd, movss and movsd specific nodes instead of pattern ↵Bruno Cardoso Lopes2010-09-01
| | | | | | matching with movlp pattern fragment git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112694 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert 112442 and 112440 until the compile time problems introducedDan Gohman2010-09-01
| | | | | | | by 112440 are resolved. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112692 91177308-0d34-0410-b5e6-96231b3b80d8
* minor change, simplify some logicBruno Cardoso Lopes2010-09-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112689 91177308-0d34-0410-b5e6-96231b3b80d8
* Move some functions around so they can be used for some other to come functionBruno Cardoso Lopes2010-09-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112687 91177308-0d34-0410-b5e6-96231b3b80d8
* Use absolute label for DW_AT_stmt_list if a target does not prefer offset here.Devang Patel2010-08-31
| | | | | | | This patch was developed on top of original patch by Artur Pietrek. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112678 91177308-0d34-0410-b5e6-96231b3b80d8
* licm is wasting time hoisting constant foldable operations,Chris Lattner2010-08-31
| | | | | | | | instead of hoisting them, just fold them away. This occurs in the testcase for PR8041, for example. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112669 91177308-0d34-0410-b5e6-96231b3b80d8
* This is the second of three patches to implement support for the .loc directiveKevin Enderby2010-08-31
| | | | | | | | | | | and output the dwarf line number tables. This takes the current loc info after an instruction is assembled and saves the needed info into an object that has vector and for each section. These objects will be used for the final patch to build and emit the encoded dwarf line number tables. Again for now this is only in the Mach-O streamer but at some point will move to a more generic place. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112668 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply r112432, now that the real problem is addressed.Dan Gohman2010-08-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112667 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply r112433, now that the real problem is addressed.Dan Gohman2010-08-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112666 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r110916. This patch is buggy because the code inside theDan Gohman2010-08-31
| | | | | | | inner loop doesn't update all the variables in the outer loop. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112665 91177308-0d34-0410-b5e6-96231b3b80d8
* We have a chance for an optimization. Consider this code:Bill Wendling2010-08-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | int x(int t) { if (t & 256) return -26; return 0; } We generate this: tst.w r0, #256 mvn r0, #25 it eq moveq r0, #0 while gcc generates this: ands r0, r0, #256 it ne mvnne r0, #25 bx lr Scandalous really! During ISel time, we can look for this particular pattern. One where we have a "MOVCC" that uses the flag off of a CMPZ that itself is comparing an AND instruction to 0. Something like this (greatly simplified): %r0 = ISD::AND ... ARMISD::CMPZ %r0, 0 @ sets [CPSR] %r0 = ARMISD::MOVCC 0, -26 @ reads [CPSR] All we have to do is convert the "ISD::AND" into an "ARM::ANDS" that sets [CPSR] when it's zero. The zero value will all ready be in the %r0 register and we only need to change it if the AND wasn't zero. Easy! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112664 91177308-0d34-0410-b5e6-96231b3b80d8
* Some fixes for NetBSDAnton Korobeynikov2010-08-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112662 91177308-0d34-0410-b5e6-96231b3b80d8
* Use x86 specific MOVSLDUP node, add more patterns to match it and remove ↵Bruno Cardoso Lopes2010-08-31
| | | | | | useless load nodes git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112661 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply r112623. Included additional check for unused byval argument.Devang Patel2010-08-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112659 91177308-0d34-0410-b5e6-96231b3b80d8
* Use x86 specific MOVSHDUP node and add more patterns to match itBruno Cardoso Lopes2010-08-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112657 91177308-0d34-0410-b5e6-96231b3b80d8
* And ANDS pattern to match the t2ANDS pattern.Bill Wendling2010-08-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112654 91177308-0d34-0410-b5e6-96231b3b80d8
* Make %EFLAGS unallocatable.Jakob Stoklund Olesen2010-08-31
| | | | | | | No CCR virtual registers should exist, and %EFLAGS is used in ways that can surprise RegAllocFast. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112650 91177308-0d34-0410-b5e6-96231b3b80d8
* Track liveness of unallocatable, unreserved registers in machine DCE.Jakob Stoklund Olesen2010-08-31
| | | | | | | | | | | | | Reserved registers are unpredictable, and are treated as always live by machine DCE. Allocatable registers are never reserved, and can be used for virtual registers. Unreserved, unallocatable registers can not be used for virtual registers, but otherwise behave like a normal allocatable register. Most targets only have the flag register in this set. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112649 91177308-0d34-0410-b5e6-96231b3b80d8
* Use MOVHLPS node instead of matching using movhlps and movhlps_undef pattern ↵Bruno Cardoso Lopes2010-08-31
| | | | | | fragments git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112644 91177308-0d34-0410-b5e6-96231b3b80d8
* tidy upChris Lattner2010-08-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112643 91177308-0d34-0410-b5e6-96231b3b80d8
* Use MOVLHPS and MOVHLPS x86 nodes whenever possible. Also remove some ↵Bruno Cardoso Lopes2010-08-31
| | | | | | useless nodes git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112642 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r112432. It appears to be exposing a problem in the emacs build.Dan Gohman2010-08-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112638 91177308-0d34-0410-b5e6-96231b3b80d8
* More cleanups of my JumpThreading transforms, including extracting some ↵Owen Anderson2010-08-31
| | | | | | duplicated code into a helper function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112634 91177308-0d34-0410-b5e6-96231b3b80d8
* Ignore unallocatable registers in RegAllocFast.Jakob Stoklund Olesen2010-08-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112632 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r112623. It is causing self host build failures.Devang Patel2010-08-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112631 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an RAII helper to make cleanup of the RecursionSet more fool-proof.Owen Anderson2010-08-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112628 91177308-0d34-0410-b5e6-96231b3b80d8
* Only try to clean up the current block if we changed that block already.Owen Anderson2010-08-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112625 91177308-0d34-0410-b5e6-96231b3b80d8
* SP relative offsets need to be adjusted by the local allocation size whenJim Grosbach2010-08-31
| | | | | | | determining if they're likely to be in range of the SP when resolving frame references. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112624 91177308-0d34-0410-b5e6-96231b3b80d8
* Remember byval argument's frame index during argument lowering and use this ↵Devang Patel2010-08-31
| | | | | | | | | info to emit debug info. Fixes Radar 8367011. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112623 91177308-0d34-0410-b5e6-96231b3b80d8
* this assert should just be a condition, since this function is just asking ifJim Grosbach2010-08-31
| | | | | | the offset is legally encodable, not actually trying to do the encoding. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112622 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor my fix for PR5652 to terminate the predecessor lookups after the ↵Owen Anderson2010-08-31
| | | | | | first failure. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112620 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve virtual frame base register allocation heuristics.Jim Grosbach2010-08-31
| | | | | | | | | | | | | | | | | | 1. Allocate them in the entry block of the function to enable function-wide re-use. The instructions to create them should be re-materializable, so there shouldn't be additional cost compared to creating them local to the basic blocks where they are used. 2. Collect all of the frame index references for the function and sort them by the local offset referenced. Iterate over the sorted list to allocate the virtual base registers. This enables creation of base registers optimized for positive-offset access of frame references. (Note: This may be appropriate to later be a target hook to do the sorting in a target appropriate manner. For now it's done here for simplicity.) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112609 91177308-0d34-0410-b5e6-96231b3b80d8
* Speculatively revert r112433.Dan Gohman2010-08-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112608 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow creation of SHT_NULL sections, from Roman Divacky.Benjamin Kramer2010-08-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112605 91177308-0d34-0410-b5e6-96231b3b80d8
* Stop using the dom frontier in DwarfEHPrepare by not promoting alloca'sDuncan Sands2010-08-31
| | | | | | | | | any more. I plan to reimplement alloca promotion using SSAUpdater later. It looks like Bill's URoR logic really always needs domtree, so the pass now always asks for domtree info. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112597 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix an infinite loop; merging two functions will create a new function (if theNick Lewycky2010-08-31
| | | | | | | | | | two are weak, we make them thunks to a new strong function) so don't iterate through the function list as we're modifying it. Also add back the outermost loop which got removed during the cleanups. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112595 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't perform an extra traversal of the function just to do cleanup. We can ↵Owen Anderson2010-08-31
| | | | | | safely simplify instructions after each block has been processed without worrying about iterator invalidation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112594 91177308-0d34-0410-b5e6-96231b3b80d8
* - Cleanup some whitespaces.Bill Wendling2010-08-31
| | | | | | | | - Convert {0,1} and friends into 0b01, which is identical and more consistent. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112593 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename ValuePropagation to a more descriptive CorrelatedValuePropagation.Owen Anderson2010-08-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112591 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename file to something more descriptive.Owen Anderson2010-08-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112590 91177308-0d34-0410-b5e6-96231b3b80d8
* More Chris-inspired JumpThreading fixes: use ConstantExpr to correctly ↵Owen Anderson2010-08-31
| | | | | | | | | | constant-fold undef, and be more careful with its return value. This actually exposed an infinite recursion bug in ComputeValueKnownInPredecessors which theoretically already existed (in JumpThreading's handling of and/or of i1's), but never manifested before. This patch adds a tracking set to prevent this case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112589 91177308-0d34-0410-b5e6-96231b3b80d8
* Cleanup Whitespace.Michael J. Spencer2010-08-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112587 91177308-0d34-0410-b5e6-96231b3b80d8
* System: Fix getMagicNumber on windows.Michael J. Spencer2010-08-31
| | | | | | | | | | getMagicNumber was treating the _binary_ data it read in as a null terminated string. This resulted in the std::string calculating the length, and causing an assert in other code that assumed that the length it passed was the same as the length of the string it would get back. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112586 91177308-0d34-0410-b5e6-96231b3b80d8
* Offset is not always unsigned number.Devang Patel2010-08-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112584 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify.Devang Patel2010-08-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112583 91177308-0d34-0410-b5e6-96231b3b80d8