summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG
Commit message (Collapse)AuthorAgeFilesLines
* Use stripPointerCasts instead of partially rewriting it.Dale Johannesen2009-08-061-4/+2
| | | | llvm-svn: 78350
* Add assertion checks after the calls to LowerFormalArguments, LowerCall,Dan Gohman2009-08-061-1/+34
| | | | | | | and LowerReturn, to verify that the targets' hooks have respected some of their postconditions. llvm-svn: 78312
* Remove an over-aggressive assert. Functions with empty struct returnDan Gohman2009-08-061-3/+0
| | | | | | | types don't have any return values, from CodeGen's perspective. This fixes PR4688. llvm-svn: 78311
* Fix a few places in DAGCombiner that were creating all-ones-bitsDan Gohman2009-08-061-5/+17
| | | | | | | | and high-bits values in ways that weren't correct for integer types wider than 64 bits. This fixes a miscompile in PPMacroExpansion.cpp in clang on x86-64. llvm-svn: 78295
* Major calling convention code refactoring.Dan Gohman2009-08-059-514/+386
| | | | | | | | | | | | | | | | | | | Instead of awkwardly encoding calling-convention information with ISD::CALL, ISD::FORMAL_ARGUMENTS, ISD::RET, and ISD::ARG_FLAGS nodes, TargetLowering provides three virtual functions for targets to override: LowerFormalArguments, LowerCall, and LowerRet, which replace the custom lowering done on the special nodes. They provide the same information, but in a more immediately usable format. This also reworks much of the target-independent tail call logic. The decision of whether or not to perform a tail call is now cleanly split between target-independent portions, and the target dependent portion in IsEligibleForTailCallOptimization. This also synchronizes all in-tree targets, to help enable future refactoring and feature work. llvm-svn: 78142
* Propogate the Depth argument when callingDan Gohman2009-08-041-1/+2
| | | | | | | | | TLI.computeMaskedBitsForTargetNode from ComputeMaskedBits, since the former may call back into the latter. This fixes a major compile time problem on a testcase that happnened to hit this in a particularly bad way, PR4643. llvm-svn: 78023
* Revert 77974. It breaks 3 of the ARM tests.Bob Wilson2009-08-031-8/+0
| | | | llvm-svn: 77982
* Allow targets to custom handle softening of results or operands before ↵Sanjiv Gupta2009-08-031-0/+8
| | | | | | trying the standard stuff. llvm-svn: 77974
* llvm_report_error already prints "LLVM ERROR:". So stop reporting errors ↵Benjamin Kramer2009-08-031-6/+5
| | | | | | like "LLVM ERROR: llvm: error:" or "LLVM ERROR: ERROR:". llvm-svn: 77971
* Avoid forming a SELECT_CC in a type that the target doesn'tDan Gohman2009-08-021-1/+2
| | | | | | | | | | | | | | | | | | | support. This isn't immediately interesting, because Legalize ends up lowering SELECT_CC if the target doesn't support it, but this simplifies the process. Also, if the SELECT_CC would be expanded in Legalize, it can potentially end up with two copies of the condition expression. By leaving it as SELECT+SETCC, the SELECT can be expanded into two SELECTs that use a single SETCC. The two comparisons are usually CSE'd, but depending on when various expressions get legalized, the comparison expression could involve calls to library functions, such that the comparison expression may not be able to be CSE'd. This will be needed by a future patch. llvm-svn: 77896
* Print the target flags as an int instead of a char, as they aren'tDan Gohman2009-08-011-4/+4
| | | | | | actually characters. llvm-svn: 77794
* Delete a redundant variable.Dan Gohman2009-08-011-1/+0
| | | | llvm-svn: 77774
* Minor code simplifications.Dan Gohman2009-08-011-8/+8
| | | | llvm-svn: 77769
* SelectionDAGISel no longer needs to check hasAvailableExternallyLinkage,Dan Gohman2009-08-011-5/+0
| | | | | | | as it is now a MachineFunctionPass, and MachineFunctionPass now handles this. llvm-svn: 77760
* SelectionDAGISel does not "preserve all", since it makes lots of changesDan Gohman2009-07-311-1/+3
| | | | | | to the MachineFunction. llvm-svn: 77753
* Use a range insert instead of an explicit loop.Dan Gohman2009-07-311-2/+1
| | | | llvm-svn: 77752
* Allow target intrinsics that return multiple values, i.e., struct types,Bob Wilson2009-07-311-15/+9
| | | | | | | | | | | | | | | | | | | | | | | | in SelectionDAGLowering::visitTargetIntrinsic. This removes a bit of special-case code for vector types. After staring at it for a while, I managed to convince myself that it is not necessary. The only case where TLI.getValueType() differs from MVT::getMVT is for iPTR, so this code could potentially make a difference for a vector of pointers. But, it looks like that is not supported. Calling TLI.getValueType() on a vector of pointers leads to the following sequence of calls: TargetLowering::getValueType MVT::getMVT MVT::getVectorVT(iPTR, num elements) MVT::getExtendedVectorVT MVT::getTypeForMVT for iPTR assertion fails "Type is not extended!" So, unless I'm really missing something, this bit of code is irrelevant to the current version of LLVM, which is consistent with the fact that I don't see this code in other similar places. llvm-svn: 77747
* Move a few more APIs back to 2.5 forms. The only remaining ones left to ↵Owen Anderson2009-07-311-2/+2
| | | | | | | | change back are metadata related, which I'm waiting on to avoid conflicting with Devang. llvm-svn: 77721
* Reapply r77654 with a fix: MachineFunctionPass's getAnalysisUsageDan Gohman2009-07-311-4/+7
| | | | | | | | shouldn't do AU.setPreservesCFG(), because even though CodeGen passes don't modify the LLVM IR CFG, they may modify the MachineFunction CFG, and passes like MachineLoop are registered with isCFGOnly set to true. llvm-svn: 77691
* Move getTrue() and getFalse() to 2.5-like APIs.Owen Anderson2009-07-311-4/+4
| | | | llvm-svn: 77685
* Revert r77654, it appears to be causing llvm-gcc bootstrap failures, and manyDaniel Dunbar2009-07-311-7/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | failures when building assorted projects with clang. --- Reverse-merging r77654 into '.': U include/llvm/CodeGen/Passes.h U include/llvm/CodeGen/MachineFunctionPass.h U include/llvm/CodeGen/MachineFunction.h U include/llvm/CodeGen/LazyLiveness.h U include/llvm/CodeGen/SelectionDAGISel.h D include/llvm/CodeGen/MachineFunctionAnalysis.h U include/llvm/Function.h U lib/Target/CellSPU/SPUISelDAGToDAG.cpp U lib/Target/PowerPC/PPCISelDAGToDAG.cpp U lib/CodeGen/LLVMTargetMachine.cpp U lib/CodeGen/MachineVerifier.cpp U lib/CodeGen/MachineFunction.cpp U lib/CodeGen/PrologEpilogInserter.cpp U lib/CodeGen/MachineLoopInfo.cpp U lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp D lib/CodeGen/MachineFunctionAnalysis.cpp D lib/CodeGen/MachineFunctionPass.cpp U lib/CodeGen/LiveVariables.cpp llvm-svn: 77661
* Manage MachineFunctions with an analysis Pass instead of the AnnotableDan Gohman2009-07-311-4/+7
| | | | | | | mechanism. To support this, make MachineFunctionPass a little more complete. llvm-svn: 77654
* Move more code back to 2.5 APIs.Owen Anderson2009-07-301-2/+1
| | | | llvm-svn: 77635
* Allow targets to define libcall names for mem(cpy,set,move) intrinsics, ↵Sanjiv Gupta2009-07-302-3/+9
| | | | | | rather than hardcoding them in DAG lowering. llvm-svn: 77586
* Optimize some common usage patterns of atomic built-ins ↵Evan Cheng2009-07-301-0/+1
| | | | | | | | | | | | __sync_add_and_fetch() and __sync_sub_and_fetch. When the return value is not used (i.e. only care about the value in the memory), x86 does not have to use add to implement these. Instead, it can use add, sub, inc, dec instructions with the "lock" prefix. This is currently implemented using a bit of instruction selection trick. The issue is the target independent pattern produces one output and a chain and we want to map it into one that just output a chain. The current trick is to select it into a merge_values with the first definition being an implicit_def. The proper solution is to add new ISD opcodes for the no-output variant. DAG combiner can then transform the node before it gets to target node selection. Problem #2 is we are adding a whole bunch of x86 atomic instructions when in fact these instructions are identical to the non-lock versions. We need a way to add target specific information to target nodes and have this information carried over to machine instructions. Asm printer (or JIT) can use this information to add the "lock" prefix. llvm-svn: 77582
* Move types back to the 2.5 API.Owen Anderson2009-07-297-44/+32
| | | | llvm-svn: 77516
* inline the global 'getInstrOperandRegClass' function into its callersChris Lattner2009-07-291-7/+8
| | | | | | now that TargetOperandInfo does the heavy lifting. llvm-svn: 77508
* Remove now unused Context variables.Benjamin Kramer2009-07-291-1/+0
| | | | llvm-svn: 77495
* Move ConstantExpr to 2.5 API.Owen Anderson2009-07-291-1/+1
| | | | llvm-svn: 77494
* Return ConstantVector to 2.5 API.Owen Anderson2009-07-282-2/+2
| | | | llvm-svn: 77366
* Change ConstantArray to 2.5 API.Owen Anderson2009-07-281-1/+1
| | | | llvm-svn: 77347
* Rip all of the global variable lowering logic out of TargetAsmInfo. SinceChris Lattner2009-07-281-5/+9
| | | | | | | | | | | | | | | | | | | | it is highly specific to the object file that will be generated in the end, this introduces a new TargetLoweringObjectFile interface that is implemented for each of ELF/MachO/COFF/Alpha/PIC16 and XCore. Though still is still a brutal and ugly refactoring, this is a major step towards goodness. This patch also: 1. fixes a bunch of dangling pointer problems in the PIC16 backend. 2. disables the TargetLowering copy ctor which PIC16 was accidentally using. 3. gets us closer to xcore having its own crazy target section flags and pic16 not having to shadow sections with its own objects. 4. fixes wierdness where ELF targets would set CStringSection but not CStringSection_. Factor the code better. 5. fixes some bugs in string lowering on ELF targets. llvm-svn: 77294
* Move ConstantFP construction back to the 2.5-ish API.Owen Anderson2009-07-272-5/+3
| | | | llvm-svn: 77247
* Reorganize code a bit to reduce indentation. No visible functionality Eli Friedman2009-07-261-287/+287
| | | | | | change. llvm-svn: 77171
* Remove Value::getNameLenDaniel Dunbar2009-07-261-18/+6
| | | | llvm-svn: 77148
* Convert a few more things to use raw_ostream.Dan Gohman2009-07-252-26/+27
| | | | llvm-svn: 77039
* More migration to raw_ostream, the water has dried up around the iostream hole.Daniel Dunbar2009-07-251-1/+2
| | | | | | | | | | - Some clients which used DOUT have moved to DEBUG. We are deprecating the "magic" DOUT behavior which avoided calling printing functions when the statement was disabled. In addition to being unnecessary magic, it had the downside of leaving code in -Asserts builds, and of hiding potentially unnecessary computations. llvm-svn: 77019
* Revert the ConstantInt constructors back to their 2.5 forms where possible, ↵Owen Anderson2009-07-244-4/+4
| | | | | | thanks to contexts-on-types. More to come. llvm-svn: 77011
* Add support for promoting SETCC operations.Jakob Stoklund Olesen2009-07-244-13/+20
| | | | llvm-svn: 76987
* Move more to raw_ostream, provide support for writing MachineBasicBlock,Daniel Dunbar2009-07-241-4/+4
| | | | | | LiveInterval, etc to raw_ostream. llvm-svn: 76965
* Switch to getNameStr().Daniel Dunbar2009-07-242-4/+4
| | | | llvm-svn: 76962
* "fix" PR4612, which is a crash on:Chris Lattner2009-07-231-1/+5
| | | | | | | | | | %0 = malloc [3758096384 x i32] The "malloc" instruction doesn't support 64-bits correctly (see PR715), and should be removed. Victor is actively working on fixing this, in the meantime just don't crash. llvm-svn: 76899
* Get rid of the Pass+Context magic.Owen Anderson2009-07-223-7/+7
| | | | llvm-svn: 76702
* Remove shift amount flavor. It isn't actually complete enough to Eli Friedman2009-07-211-1/+0
| | | | | | | | be useful, and it's currently unused. (Some issues: it isn't actually rich enough to capture the semantics on many architectures, and semantics can vary depending on the type being shifted.) llvm-svn: 76633
* Rename getConstantInt{True|False} to get{True|False} at Chris' behest.Owen Anderson2009-07-211-4/+4
| | | | llvm-svn: 76598
* Simplify / normalize some uses of Value::getName.Daniel Dunbar2009-07-211-1/+1
| | | | llvm-svn: 76553
* Fix a dagga combiner bug: avoid creating illegal constant.Evan Cheng2009-07-211-9/+12
| | | | | | | | Is this really a winning transformation? fold (shl (srl x, c1), c2) -> (shl (and x, (shl -1, c1)), (sub c2, c1)) or (srl (and x, (shl -1, c1)), (sub c1, c2)) llvm-svn: 76535
* Move a bit more state over to the LLVMContext.Owen Anderson2009-07-211-4/+6
| | | | llvm-svn: 76533
* Move stripping of bitcasts in inline asm argumentsDale Johannesen2009-07-202-12/+7
| | | | | | | to a place where it affects everything. Occurs only on calls AFAIK. llvm-svn: 76502
* Fix some minor MSVC compiler warnings.Daniel Dunbar2009-07-191-2/+2
| | | | llvm-svn: 76356
OpenPOWER on IntegriCloud