summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Make sure both PendingLoads and PendingExports are flushedDale Johannesen2008-04-041-1/+4
| | | | | | | | | | before an invoke. Failure to do this causes references in the landing pad to variables that were not set. Fixes g++.dg/eh/delayslot1.C g++.dg/eh/fp-regs.C g++.old-deja/g++.brendan/eh1.C llvm-svn: 49243
* Recommitting EH patch; this should answer most of theDale Johannesen2008-04-021-51/+41
| | | | | | | | | | | | | | | review feedback. -enable-eh is still accepted but doesn't do anything. EH intrinsics use Dwarf EH if the target supports that, and are handled by LowerInvoke otherwise. The separation of the EH table and frame move data is, I think, logically figured out, but either one still causes full EH info to be generated (not sure how to split the metadata correctly). MachineModuleInfo::needsFrameInfo is no longer used and is removed. llvm-svn: 49064
* Revert 49006 for the moment.Dale Johannesen2008-04-011-13/+8
| | | | llvm-svn: 49046
* Emit exception handling info for functions which areDale Johannesen2008-03-311-8/+13
| | | | | | | | | | | not marked nounwind, or for all functions when -enable-eh is set, provided the target supports Dwarf EH. llvm-gcc generates nounwind in the right places; other FEs will need to do so also. Given such a FE, -enable-eh should no longer be needed. llvm-svn: 49006
* Fix "Control reaches the end of non-void function" warnings, Chris Lattner2008-03-301-0/+1
| | | | | | patch by David Chisnall. llvm-svn: 48963
* Avoid creating chain dependencies from CopyToReg nodes to load and storeDan Gohman2008-03-271-54/+72
| | | | | | | | | | | | | | | | | | nodes. This doesn't currently have much impact the generated code, but it does produce simpler-looking SelectionDAGs, and consequently simpler-looking ScheduleDAGs, because there are fewer spurious dependencies. In particular, CopyValueToVirtualRegister now uses the entry node as the input chain dependency for new CopyToReg nodes instead of calling getRoot and depending on the most recent memory reference. Also, rename UnorderedChains to PendingExports and pull it up from being a local variable in SelectionDAGISel::BuildSelectionDAG to being a member variable of SelectionDAGISel, so that it doesn't have to be passed around to all the places that need it. llvm-svn: 48893
* Introduce a new node for holding call argumentDuncan Sands2008-03-211-42/+32
| | | | | | | | | | | | | | | | | flags. This is needed by the new legalize types infrastructure which wants to expand the 64 bit constants previously used to hold the flags on 32 bit machines. There are two functional changes: (1) in LowerArguments, if a parameter has the zext attribute set then that is marked in the flags; before it was being ignored; (2) PPC had some bogus code for handling two word arguments when using the ELF 32 ABI, which was hard to convert because of the bogusness. As suggested by the original author (Nicolas Geoffray), I've disabled it for the moment. Tested with "make check" and the Ada ACATS testsuite. llvm-svn: 48640
* Do not generate special entries in the dwarf ehDuncan Sands2008-03-141-6/+2
| | | | | | table for nounwind calls. llvm-svn: 48373
* Don't try to extract an i32 from an f64. ThisDuncan Sands2008-03-121-10/+16
| | | | | | | | | | | | getCopyToParts problem was noticed by the new LegalizeTypes infrastructure. In order to avoid this kind of thing in the future I've added a check that EXTRACT_ELEMENT is only used with integers. Once LegalizeTypes is up and running most likely BUILD_PAIR and EXTRACT_ELEMENT can be removed, in favour of using apints instead. llvm-svn: 48294
* Initial codegen support for functions and calls with multiple return values.Dan Gohman2008-03-111-18/+51
| | | | llvm-svn: 48244
* Give TargetLowering::getSetCCResultType() a parameter so that ISD::SETCC'sScott Michel2008-03-101-3/+3
| | | | | | | | return ValueType can depend its operands' ValueType. This is a cosmetic change, no functionality impacted. llvm-svn: 48145
* Increase ISD::ParamFlags to 64 bits. Increase the ByValSizeDale Johannesen2008-03-101-13/+19
| | | | | | | | | | field to 32 bits, thus enabling correct handling of ByVal structs bigger than 0x1ffff. Abstract interface a bit. Fixes gcc.c-torture/execute/pr23135.c and gcc.c-torture/execute/pr28982b.c in gcc testsuite (were ICE'ing on ppc32, quietly producing wrong code on x86-32.) llvm-svn: 48122
* remove an extraneous (and ugly) default argument, thanks Duncan.Chris Lattner2008-03-091-2/+1
| | | | llvm-svn: 48117
* fp_round's produced by getCopyFromParts should always be exact, becauseChris Lattner2008-03-091-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | they are produced by calls (which are known exact) and by cross block copies which are known to be produced by extends. This improves: define double @test2() { %tmp85 = call double asm sideeffect "fld0", "={st(0)}"() ret double %tmp85 } from: _test2: subl $20, %esp # InlineAsm Start fld0 # InlineAsm End fstpl 8(%esp) movsd 8(%esp), %xmm0 movsd %xmm0, (%esp) fldl (%esp) addl $20, %esp #FP_REG_KILL ret to: _test2: # InlineAsm Start fld0 # InlineAsm End #FP_REG_KILL ret by avoiding a f64 <-> f80 trip llvm-svn: 48108
* extend fp values with FP_EXTEND not FP_ROUND.Chris Lattner2008-03-091-3/+6
| | | | llvm-svn: 48097
* Implement x86 support for @llvm.prefetch. It corresponds to prefetcht{0|1|2} ↵Evan Cheng2008-03-081-4/+10
| | | | | | and prefetchnta instructions. llvm-svn: 48042
* Use the new APInt-enabled form of getConstant instead of convertingDan Gohman2008-02-291-1/+1
| | | | | | an APInt into a uint64_t to call getConstant. llvm-svn: 47742
* Refactor inline asm constraint matching code out of SDIsel into TargetLowering.Evan Cheng2008-02-261-91/+15
| | | | llvm-svn: 47587
* Convert MaskedValueIsZero and all its users to use APInt. Also addDan Gohman2008-02-251-10/+10
| | | | | | a SignBitIsZero function to simplify a common use case. llvm-svn: 47561
* Pass alignment on ByVal parameters, from FE, allDale Johannesen2008-02-221-0/+9
| | | | | | the way through. It is now used for codegen. llvm-svn: 47484
* Make the clobber analysis a bit more smart: we only are careful about Chris Lattner2008-02-211-3/+13
| | | | | | | early clobbers if the clobber list contains a *register* not some thing like {memory}, {dirflag} etc. llvm-svn: 47457
* Treat clobber operands like early clobbers: if we haveChris Lattner2008-02-211-0/+16
| | | | | | | | | any, we force sdisel to do all regalloc for an asm. This leads to gross but correct codegen. This fixes the rest of PR2078. llvm-svn: 47454
* Atomic op support. If any gcc test uses __sync builtins, it might start ↵Andrew Lenharth2008-02-211-1/+33
| | | | | | failing on archs that haven't implemented them yet llvm-svn: 47430
* Add support for matching mem operands. This fixes PR1133, patch byChris Lattner2008-02-211-1/+7
| | | | | | Eli Friedman. This implements CodeGen/Generic/2008-02-20-MatchingMem.ll. llvm-svn: 47428
* Fix a (harmless) but where vregs were added to the used reg lists for Chris Lattner2008-02-211-9/+26
| | | | | | | | | | inline asms. Fix PR2078 by marking aliases of registers used when a register is marked used. This prevents EAX from being allocated when AX is listed in the clobber set for the asm. llvm-svn: 47426
* assert is more effective reminder then FIXME tag for unimplemented features.Devang Patel2008-02-201-1/+1
| | | | llvm-svn: 47388
* Update gcc 4.3 warnings fix patch with recent head changesAnton Korobeynikov2008-02-201-1/+1
| | | | llvm-svn: 47368
* Add GetResultInst. First step for multiple return value support.Devang Patel2008-02-191-0/+4
| | | | llvm-svn: 47348
* llvm.memory.barrier, and impl for x86 and alphaAndrew Lenharth2008-02-161-0/+9
| | | | llvm-svn: 47204
* In TargetLowering::LowerCallTo, don't assert thatDuncan Sands2008-02-141-10/+16
| | | | | | | | | | | | | | | | | the return value is zero-extended if it isn't sign-extended. It may also be any-extended. Also, if a floating point value was returned in a larger floating point type, pass 1 as the second operand to FP_ROUND, which tells it that all the precision is in the original type. I think this is right but I could be wrong. Finally, when doing libcalls, set isZExt on a parameter if it is "unsigned". Currently isSExt is set when signed, and nothing is set otherwise. This should be right for all calls to standard library routines. llvm-svn: 47122
* In SDISel, for targets that support FORMAL_ARGUMENTS nodes, lower thisChris Lattner2008-02-131-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | node as soon as we create it in SDISel. Previously we would lower it in legalize. The problem with this is that it only exposes the argument loads implied by FORMAL_ARGUMENTs after legalize, so that only dag combine 2 can hack on them. This causes us to miss some optimizations because datatype expansion also happens here. Exposing the loads early allows us to do optimizations on them. For example we now compile arg-cast.ll to: _foo: movl $2147483647, %eax andl 8(%esp), %eax ret where we previously produced: _foo: subl $12, %esp movsd 16(%esp), %xmm0 movsd %xmm0, (%esp) movl $2147483647, %eax andl 4(%esp), %eax addl $12, %esp ret It might also make sense to do this for ISD::CALL nodes, which have implicit stores on many targets. llvm-svn: 47054
* Generalize getCopyFromParts and getCopyToParts toDuncan Sands2008-02-121-113/+215
| | | | | | | | | | | | handle arbitrary precision integers and any number of parts. For example, on a 32 bit machine an i50 corresponds to two i32 parts. getCopyToParts will extend the i50 to an i64 then write half of the i64 to each part; getCopyFromParts will combine the two i32 parts into an i64 then truncate the result to i50. llvm-svn: 47024
* Generalize the handling of call and return arguments,Duncan Sands2008-02-111-136/+85
| | | | | | | in preparation for apint support. These changes are intended to have no functional effect. llvm-svn: 46967
* Rename MRegisterInfo to TargetRegisterInfo.Dan Gohman2008-02-101-6/+7
| | | | llvm-svn: 46930
* SDIsel processes llvm.dbg.declare by recording the variable debug ↵Evan Cheng2008-02-021-6/+4
| | | | | | | | | information descriptor and its corresponding stack frame index in MachineModuleInfo. This only works if the local variable is "homed" in the stack frame. It does not work for byval parameter, etc. Added ISD::DECLARE node type to represent llvm.dbg.declare intrinsic. Now the intrinsic calls are lowered into a SDNode and lives on through out the codegen passes. For now, since all the debugging information recording is done at isel time, when a ISD::DECLARE node is selected, it has the side effect of also recording the variable. This is a short term solution that should be fixed in time. llvm-svn: 46659
* Remove the nasty LABEL hack with a much less evil one. Now ↵Evan Cheng2008-02-011-6/+14
| | | | | | llvm.dbg.func.start implies a stoppoint is set. SelectionDAGISel records a new source line but does not create a ISD::LABEL node for this special stoppoint. Asm printer will magically print this label. This ensures nothing is emitted before. llvm-svn: 46635
* Add an extra operand to LABEL nodes which distinguishes between debug, EH, ↵Evan Cheng2008-01-311-8/+14
| | | | | | or misc labels. This fixes the EH breakage. However I am not convinced this is *the* solution. llvm-svn: 46609
* Rename ISD::FLT_ROUNDS to ISD::FLT_ROUNDS_ to avoid conflictingDan Gohman2008-01-311-1/+1
| | | | | | with the real FLT_ROUNDS (defined in <float.h>). llvm-svn: 46587
* Even though InsertAtEndOfBasicBlock is an ugly hack it still deserves a ↵Evan Cheng2008-01-301-4/+4
| | | | | | | | proper name. Rename it to EmitInstrWithCustomInserter since it does not necessarily insert instruction at the end. llvm-svn: 46562
* Handle 'X' constraint in asm's better.Dale Johannesen2008-01-291-19/+34
| | | | llvm-svn: 46485
* fix long lines.Chris Lattner2008-01-251-2/+3
| | | | llvm-svn: 46355
* Forgot these.Evan Cheng2008-01-241-4/+2
| | | | llvm-svn: 46292
* * Introduce a new SelectionDAG::getIntPtrConstant methodChris Lattner2008-01-171-19/+14
| | | | | | | | | | | | | and switch various codegen pieces and the X86 backend over to using it. * Add some comments to SelectionDAGNodes.h * Introduce a second argument to FP_ROUND, which indicates whether the FP_ROUND changes the value of its input. If not it is safe to xform things like fp_extend(fp_round(x)) -> x. llvm-svn: 46125
* For PR1839: add initial support for __builtin_trap. llvm-gcc part is missedAnton Korobeynikov2008-01-151-0/+5
| | | | | | as well as PPC codegen llvm-svn: 46001
* Remove the assumption that byval has been applied toDuncan Sands2008-01-131-12/+12
| | | | | | a pointer to a struct. llvm-svn: 45939
* Enabling the target-independent garbage collection infrastructure by hooking itGordon Henriksen2008-01-071-8/+34
| | | | | | | | | up to the various compiler pipelines. This doesn't actually add support for any GC algorithms, which means it temporarily breaks a few tests. To be fixed shortly. llvm-svn: 45669
* Rename SSARegMap -> MachineRegisterInfo in keeping with the idea Chris Lattner2007-12-311-13/+13
| | | | | | | | | | | | | | that "machine" classes are used to represent the current state of the code being compiled. Given this expanded name, we can start moving other stuff into it. For now, move the UsedPhysRegs and LiveIn/LoveOuts vectors from MachineFunction into it. Update all the clients to match. This also reduces some needless #includes, such as MachineModuleInfo from MachineFunction. llvm-svn: 45467
* use simplified operand addition methods.Chris Lattner2007-12-301-17/+25
| | | | llvm-svn: 45436
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-291-2/+2
| | | | llvm-svn: 45418
* Simplify LowerCallTo by using a callsite.Duncan Sands2007-12-191-41/+27
| | | | llvm-svn: 45198
OpenPOWER on IntegriCloud