summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
* Add a new TargetInstrInfo MachineInstr opcode, COPY_TO_SUBCLASS.Dan Gohman2009-04-132-75/+170
| | | | | | | | | | | | | | | | This will be used to replace things like X86's MOV32to32_. Enhance ScheduleDAGSDNodesEmit to be more flexible and robust in the presense of subregister superclasses and subclasses. It can now cope with the definition of a virtual register being in a subclass of a use. Re-introduce the code for recording register superreg classes and subreg classes. This is needed because when subreg extracts and inserts get coalesced away, the virtual registers are left in the correct subclass. llvm-svn: 68961
* Don't abort on an aliasing physical register that does not haveDan Gohman2009-04-131-1/+1
| | | | | | a live interval. This is needed for some upcoming subreg changes. llvm-svn: 68956
* When assigning a physical register to a MachineOperand, setDan Gohman2009-04-131-1/+10
| | | | | | | | | the subreg field to 0, since the subreg field is only used for virtual register subregs. This doesn't change current functionality; it just eliminates bogus noise from debug output. llvm-svn: 68955
* Add an assertion to verify that a copy was actually emitted.Dan Gohman2009-04-131-1/+2
| | | | llvm-svn: 68953
* Add a new "available_externally" linkage type. This is intendedChris Lattner2009-04-133-3/+14
| | | | | | | | to support C99 inline, GNU extern inline, etc. Related bugzilla's include PR3517, PR3100, & PR2933. Nothing uses this yet, but it appears to work. llvm-svn: 68940
* make UpdateValueMap handle the possiblity that we could beChris Lattner2009-04-121-1/+1
| | | | | | copying into the right register, avoiding a copy. llvm-svn: 68889
* optimize FastISel::UpdateValueMap to avoid duplicate map lookups,Chris Lattner2009-04-121-7/+12
| | | | | | and make it return the assigned register. llvm-svn: 68888
* Revert r68847. It breaks the build on non-Darwin targets, with this messageDan Gohman2009-04-113-161/+6
| | | | | | | from the assembler: Error: unknown pseudo-op: `.debug_inlined' llvm-svn: 68863
* Keep track of inlined functions and their locations. This information is ↵Devang Patel2009-04-113-6/+161
| | | | | | | | collected when nested llvm.dbg.func.start intrinsics are seen. (Right now, inliner removes nested llvm.dbg.func.start intrinisics during inlining.) Create debug_inlined dwarf section using these information. This info is used by gdb, at least on Darwin, to enable better experience debugging inlined functions. See DwarfWriter.cpp for more information on structure of debug_inlined section. llvm-svn: 68847
* DebugLabelFolder ruthlessly deletes redundant labels. However, sometimes the ↵Devang Patel2009-04-101-1/+1
| | | | | | redundant labels is referenced by debug info somewhere else. This patch provies a way so that dwarf writer can mark labels as used. llvm-svn: 68813
* Clean up a bunch of whitespace issues and fix a comment typo.Bob Wilson2009-04-101-72/+74
| | | | | | No functional changes. llvm-svn: 68808
* fix two problems with machine sinking:Chris Lattner2009-04-101-12/+26
| | | | | | | | | | | 1. Sinking would crash when the first instruction of a block was sunk due to iterator problems. 2. Instructions could be sunk to their current block, causing an infinite loop. This fixes PR3968 llvm-svn: 68787
* Now that register classes have names, include the name in debug output.Dan Gohman2009-04-101-2/+4
| | | | llvm-svn: 68786
* Pass in the std::string parameter instead of returning it by value.Bill Wendling2009-04-102-25/+28
| | | | llvm-svn: 68747
* Constify getter methods.Bill Wendling2009-04-102-2/+3
| | | | llvm-svn: 68745
* Remove the obsolete SelectionDAG::getNodeValueTypes and simplifyDan Gohman2009-04-094-57/+41
| | | | | | code that uses it by using SelectionDAG::getVTList instead. llvm-svn: 68744
* StringMap<DIE*>::iterator::first() returns a pointer to the first character ofBill Wendling2009-04-092-4/+8
| | | | | | | | the key. This will cause it to create a new std::string, which isn't wanted. Instead, pass back the "const char*". Modify the EmitString() method to take a "const char*". llvm-svn: 68741
* Silence unused variable warning.Devang Patel2009-04-091-1/+1
| | | | llvm-svn: 68735
* ignore register zero in isRegTiedToUseOperand, following the example ofChris Lattner2009-04-091-1/+1
| | | | | | isRegTiedToDefOperand. Thanks to Bob for pointing this out! llvm-svn: 68734
* Use a StringMap instead of std::map for storing std::string->DIE* maps. ThisBill Wendling2009-04-091-10/+10
| | | | | | gives a micro speedup in the Dwarf writer. llvm-svn: 68728
* llvm.dbg.func_start also defines beginning of function scope.Devang Patel2009-04-091-7/+3
| | | | llvm-svn: 68727
* Fix pr3954. The register scavenger asserts for inline assembly withBob Wilson2009-04-098-22/+28
| | | | | | | | | | | | register destinations that are tied to source operands. The TargetInstrDescr::findTiedToSrcOperand method silently fails for inline assembly. The existing MachineInstr::isRegReDefinedByTwoAddr was very close to doing what is needed, so this revision makes a few changes to that method and also renames it to isRegTiedToUseOperand (for consistency with the very similar isRegTiedToDefOperand and because it handles both two-address instructions and inline assembly with tied registers). llvm-svn: 68714
* reg0 references are not real registers. This fixes a crash on the Chris Lattner2009-04-091-1/+1
| | | | | | attached testcase. llvm-svn: 68712
* Generalize ExtendUsesToFormExtLoad to be usable for ANY_EXTEND,Dan Gohman2009-04-092-45/+78
| | | | | | | | | | | | | | | in addition to ZERO_EXTEND and SIGN_EXTEND. Fix a bug in the way it checked for live-out values, and simplify the way it find users by using SDNode::use_iterator's (relatively) new features. Also, make it slightly more permissive on targets with free truncates. In SelectionDAGBuild, avoid creating ANY_EXTEND nodes that are larger than necessary. If the target's SwitchAmountTy has enough bits, use it. This exposes the truncate to optimization early, enabling more optimizations. llvm-svn: 68670
* Don't copy the operand of a SwitchInst into virtual registers asDan Gohman2009-04-091-3/+13
| | | | | | | | | | eagerly. This helps avoid CopyToReg nodes in some cases where they aren't needed, and also helps subsequent optimizer heuristics in cases where the extra nodes would cause the node to appear to have multiple results. This doesn't have a significant impact currently; it'll help an upcoming change. llvm-svn: 68667
* If subprogram type is not tagged as DW_TAG_subroutine_type then use it ↵Devang Patel2009-04-081-2/+3
| | | | | | directly as a return value type. llvm-svn: 68647
* Soft float support for FREM.Duncan Sands2009-04-082-0/+14
| | | | llvm-svn: 68614
* Soft float support for undef. Reported by Xerxes Rånby.Duncan Sands2009-04-082-0/+6
| | | | llvm-svn: 68607
* change printStringChar to emit characters as unsigned char instead of char,Chris Lattner2009-04-081-9/+5
| | | | | | | | | | | avoiding sign extension for the top octet. For "negative" chars, we'd print stuff like: .asciz "\702... now we print: .asciz "\302... llvm-svn: 68577
* Implement support for using modeling implicit-zero-extension on x86-64Dan Gohman2009-04-086-53/+220
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with SUBREG_TO_REG, teach SimpleRegisterCoalescing to coalesce SUBREG_TO_REG instructions (which are similar to INSERT_SUBREG instructions), and teach the DAGCombiner to take advantage of this on targets which support it. This eliminates many redundant zero-extension operations on x86-64. This adds a new TargetLowering hook, isZExtFree. It's similar to isTruncateFree, except it only applies to actual definitions, and not no-op truncates which may not zero the high bits. Also, this adds a new optimization to SimplifyDemandedBits: transform operations like x+y into (zext (add (trunc x), (trunc y))) on targets where all the casts are no-ops. In contexts where the high part of the add is explicitly masked off, this allows the mask operation to be eliminated. Fix the DAGCombiner to avoid undoing these transformations to eliminate casts on targets where the casts are no-ops. Also, this adds a new two-address lowering heuristic. Since two-address lowering runs before coalescing, it helps to be able to look through copies when deciding whether commuting and/or three-address conversion are profitable. Also, fix a bug in LiveInterval::MergeInClobberRanges. It didn't handle the case that a clobber range extended both before and beyond an existing live range. In that case, multiple live ranges need to be added. This was exposed by the new subreg coalescing code. Remove 2008-05-06-SpillerBug.ll. It was bugpoint-reduced, and the spiller behavior it was looking for no longer occurrs with the new instruction selection. llvm-svn: 68576
* Revert prev. patch for now.Devang Patel2009-04-071-4/+6
| | | | llvm-svn: 68569
* Right now DBG_LABEL are required for llvm.dbg.region_start and ↵Devang Patel2009-04-071-6/+4
| | | | | | llvm.dbg.region_end in non-fast mode also. llvm-svn: 68559
* Don't attempt to handle aggregate argument values in FastISel; letDan Gohman2009-04-071-1/+5
| | | | | | SelectionDAG do those. This fixes PR3955. llvm-svn: 68546
* Fix a TargetLowering optimization so that it doesn't duplicateDan Gohman2009-04-031-0/+1
| | | | | | loads when an input node has multiple uses. llvm-svn: 68398
* Delete ISD::INSERT_SUBREG and ISD::EXTRACT_SUBREG, which are unused.Dan Gohman2009-04-032-20/+0
| | | | | | | Note that these are distinct from TargetInstrInfo::INSERT_SUBREG and TargetInstrInfo::EXTRACT_SUBREG, which are used. llvm-svn: 68355
* To convert the StopPoint insn into an assembler directive by ISel, we need ↵Sanjiv Gupta2009-04-021-0/+4
| | | | | | to have access to the line number field. So we convert that info as an operand by custom handling DBG_STOPPOINT in legalize. llvm-svn: 68329
* Fully general expansion of integer shift of any size.Evan Cheng2009-03-312-3/+81
| | | | llvm-svn: 68134
* Reapply 68073, with fixes. EH Landing-pad basic blocks are notDan Gohman2009-03-311-0/+10
| | | | | | | | entered via fall-through. Don't miss fallthroughs from blocks terminated by conditional branches. Also, move isOnlyReachableByFallthrough out of line. llvm-svn: 68129
* Minor top-level comment fix.Dan Gohman2009-03-311-1/+1
| | | | llvm-svn: 68113
* Oy! When reverting r68073, I added in experimental code. Sorry...Bill Wendling2009-03-314-95/+32
| | | | llvm-svn: 68099
* Remove the "fast" cases for spill and restore point determination, as these ↵Owen Anderson2009-03-311-126/+59
| | | | | | | | were subtlely wrong in obscure cases. Patch the testcase to account for this change. llvm-svn: 68093
* Revert r68073. It's causing a failure in the Apple-style builds.Bill Wendling2009-03-314-32/+95
| | | | llvm-svn: 68092
* Fix live-out reg logic to not insert over-aggressive AssertZExtDan Gohman2009-03-311-3/+3
| | | | | | instructions. This fixes lua. llvm-svn: 68083
* Turn a 2-address instruction into a 3-address one when it's profitable even ↵Evan Cheng2009-03-301-21/+68
| | | | | | | | | | | | | if the two-address operand is killed. e.g. %reg1024<def> = MOV r1 %reg1025<def> = ADD %reg1024, %reg1026 r0 = MOV %reg1025 If it's not possible / profitable to commute ADD, then turning ADD into a LEA saves a copy. llvm-svn: 68065
* Balance out quote in debug output.Bill Wendling2009-03-301-1/+1
| | | | llvm-svn: 68059
* Fix grammar-o in comment.Bill Wendling2009-03-301-1/+1
| | | | llvm-svn: 68057
* Constify arguments in isSuccessor and isLayoutSuccessor.Dan Gohman2009-03-301-2/+2
| | | | llvm-svn: 68054
* Fix PR3899: add support for extracting floats from vectorsDuncan Sands2009-03-293-0/+22
| | | | | | | when using -soft-float. Based on a patch by Jakob Stoklund Olesen. llvm-svn: 67996
* Make check in CheckTailCallReturnConstraints for ignorable instructions betweenArnold Schwaighofer2009-03-281-18/+32
| | | | | | | a CALL and a RET node more generic. Add a test for tail calls with a void return. llvm-svn: 67943
* Enable tail call optimization for functions that return a struct (bug 3664) ↵Arnold Schwaighofer2009-03-281-0/+24
| | | | | | and for functions that return types that need extending (e.g i1). llvm-svn: 67934
OpenPOWER on IntegriCloud