summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
* Don't call destructors on MachineInstr and MachineOperand.Jakob Stoklund Olesen2013-01-053-30/+13
| | | | | | | | | | | | | | | | | | | | The series of patches leading up to this one makes llc -O0 run 8% faster. When deallocating a MachineFunction, there is no need to visit all MachineInstr and MachineOperand objects to deallocate them. All their memory come from a BumpPtrAllocator that is about to be purged, and they have empty destructors anyway. This only applies when deallocating the MachineFunction. DeleteMachineInstr() should still be used to recycle MI memory during the codegen passes. Remove the LeakDetector support for MachineInstr. I've never seen it used before, and now it definitely doesn't work. With this patch, leaked MachineInstrs would be much less of a problem since all of their memory will be reclaimed by ~MachineFunction(). llvm-svn: 171599
* Use ArrayRecycler for MachineInstr operand lists.Jakob Stoklund Olesen2013-01-052-74/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of an std::vector<MachineOperand>, use MachineOperand arrays from an ArrayRecycler living in MachineFunction. This has several advantages: - MachineInstr now has a trivial destructor, making it possible to delete them in batches when destroying MachineFunction. This will be enabled in a later patch. - Bypassing malloc() and free() can be faster, depending on the system library. - MachineInstr objects and their operands are allocated from the same BumpPtrAllocator, so they will usually be next to each other in memory, providing better locality of reference. - Reduce MachineInstr footprint. A std::vector is 24 bytes, the new operand array representation only uses 8+4+1 bytes in MachineInstr. - Better control over operand array reallocations. In the old representation, the use-def chains would be reordered whenever a std::vector reached its capacity. The new implementation never changes the use-def chain order. Note that some decisions in the code generator depend on the use-def chain orders, so this patch may cause different assembly to be produced in a few cases. llvm-svn: 171598
* Add MachineRegisterInfo::moveOperands().Jakob Stoklund Olesen2013-01-051-0/+49
| | | | | | | | | | | | | This function works like memmove() for MachineOperands, except it also updates any use-def chains containing the moved operands. The use-def chains are updated without affecting the order of operands in the list. That isn't possible when using the removeRegOperandFromUseList() and addRegOperandToUseList() functions. Callers to follow soon. llvm-svn: 171597
* Move an assertion so it doesn't dereference end().Jakob Stoklund Olesen2013-01-041-4/+3
| | | | | | The R600 target has test cases that exercises this code. llvm-svn: 171538
* Add a name for the anonymous type we're creating for subrangeEric Christopher2013-01-041-0/+3
| | | | | | | | types and a FIXME for what we should be doing. Should solve the immediacy of PR12069 where our debug info is crashing another tool. llvm-svn: 171536
* small fixes to enable the reuse of the pass manager across multiple modulesPedro Artigas2013-01-041-1/+3
| | | | llvm-svn: 171475
* Fix PR14732 by handling all kinds of IMPLICIT_DEF live ranges.Jakob Stoklund Olesen2013-01-031-8/+37
| | | | | | | | | | | | | | | | Most IMPLICIT_DEF instructions are removed by the ProcessImplicitDefs pass, and a few are reinserted by PHIElimination when a PHI argument is <undef>. RegisterCoalescer was assuming that all IMPLICIT_DEF live ranges look like those created by PHIElimination, and that their live range never leaves the basic block. The PR14732 test case does tricks with PHI nodes that causes a longer IMPLICIT_DEF live range to appear. This happens very rarely, but RegisterCoalescer should be able to handle it. llvm-svn: 171435
* DAGCombiner: Avoid generating illegal vector INT_TO_FP nodesTom Stellard2013-01-021-4/+5
| | | | | | | | | | | | | | DAGCombiner::reduceBuildVecConvertToConvertBuildVec() was making two mistakes: 1. It was checking the legality of scalar INT_TO_FP nodes and then generating vector nodes. 2. It was passing the result value type to TargetLoweringInfo::getOperationAction() when it should have been passing the value type of the first operand. llvm-svn: 171420
* Move all of the header files which are involved in modelling the LLVM IRChandler Carruth2013-01-0266-195/+195
| | | | | | | | | | | | | | | | | | | | | into their new header subdirectory: include/llvm/IR. This matches the directory structure of lib, and begins to correct a long standing point of file layout clutter in LLVM. There are still more header files to move here, but I wanted to handle them in separate commits to make tracking what files make sense at each layer easier. The only really questionable files here are the target intrinsic tablegen files. But that's a battle I'd rather not fight today. I've updated both CMake and Makefile build systems (I think, and my tests think, but I may have missed something). I've also re-sorted the includes throughout the project. I'll be committing updates to Clang, DragonEgg, and Polly momentarily. llvm-svn: 171366
* Resort the #include lines in include/... and lib/... with theChandler Carruth2013-01-021-1/+1
| | | | | | | | | | utils/sort_includes.py script. Most of these are updating the new R600 target and fixing up a few regressions that have creeped in since the last time I sorted the includes. llvm-svn: 171362
* Support ppcf128 in SelectionDAG::getConstantFPHal Finkel2012-12-301-1/+2
| | | | | | | | Fixes pr14751. Patch by Kai; Thanks! llvm-svn: 171261
* convert a bunch of callers from DataLayout::getIndexedOffset() to ↵Nuno Lopes2012-12-301-9/+5
| | | | | | | | | GEP::accumulateConstantOffset(). The later API is nicer than the former, and is correct regarding wrap-around offsets (if anyone cares). There are a few more places left with duplicated code, which I'll remove soon. llvm-svn: 171259
* Remove the Function::getRetAttributes method in favor of using the ↵Bill Wendling2012-12-303-15/+15
| | | | | | AttributeSet accessor method. llvm-svn: 171256
* Remove Function::getParamAttributes and use the AttributeSet accessor ↵Bill Wendling2012-12-301-8/+8
| | | | | | methods instead. llvm-svn: 171255
* Remove the Function::getFnAttributes method in favor of using the AttributeSetBill Wendling2012-12-3010-31/+41
| | | | | | | | | directly. This is in preparation for removing the use of the 'Attribute' class as a collection of attributes. That will shift to the AttributeSet class instead. llvm-svn: 171253
* Refactor DAGCombinerInfo. Change the different booleans that indicate if we ↵Nadav Rotem2012-12-272-3/+3
| | | | | | | | are before or after different runs of DAGCo, with the CombineLevel enum. Also, added a new API for checking if we are running before or after the LegalizeVectorOps phase. llvm-svn: 171142
* For the dwarf5 split debug info code split out the string sectionEric Christopher2012-12-272-21/+53
| | | | | | per compile unit/skeleton compile unit. Update tests accordingly. llvm-svn: 171133
* Rename LLVMContext diagnostic handler types and functions.Bob Wilson2012-12-251-5/+5
| | | | | | | | | These are now generally used for all diagnostics from the backend, not just for inline assembly, so this drops the "InlineAsm" from the names. No functional change. (I've left aliases for the old names but only for long enough to let me switch over clang to use the new ones.) llvm-svn: 171047
* Add LLVMContext::emitWarning methods and use them. <rdar://problem/12867368>Bob Wilson2012-12-241-14/+22
| | | | | | | | | When the backend is used from clang, it should produce proper diagnostics instead of just printing messages to errs(). Other clients may also want to register their own error handlers with the LLVMContext, and the same handler should work for warnings in the same way as the existing emitError methods. llvm-svn: 171041
* Remove a special case that doesn't seem necessary any longer.Jakob Stoklund Olesen2012-12-221-13/+2
| | | | | | | Back when this exception was added, it was skipping a lot more code, but now it just looks like a premature optimization. llvm-svn: 170989
* Use getNumOperands() instead of Operands.size().Jakob Stoklund Olesen2012-12-221-11/+11
| | | | | | | The representation of the Operands array is going to change soon so it can be allocated from a BumpPtrAllocator. llvm-svn: 170988
* Remove duplicate includes.Roman Divacky2012-12-213-3/+0
| | | | llvm-svn: 170902
* Add targets to skip running the GC passes.Evan Cheng2012-12-211-3/+10
| | | | llvm-svn: 170836
* Require the two-argument MI::addOperand(MF, MO) for dangling instructions.Jakob Stoklund Olesen2012-12-201-1/+9
| | | | | | | | | | | Instructions that are inserted in a basic block can still be decorated with addOperand(MO). Make the two-argument addOperand() function contain the actual implementation. This function will now always have a valid MF reference that it can use for memory allocation. llvm-svn: 170798
* Add an MF argument to MI::copyImplicitOps().Jakob Stoklund Olesen2012-12-201-2/+3
| | | | | | | | | This function is often used to decorate dangling instructions, so a context reference is required to allocate memory for the operands. Also add a corresponding MachineInstrBuilder method. llvm-svn: 170797
* Use two-arg addOperand(MF, MO) internally in MachineInstr when possible.Jakob Stoklund Olesen2012-12-202-8/+8
| | | | llvm-svn: 170796
* Whitespace and 80-column cleanup.Eric Christopher2012-12-205-25/+31
| | | | llvm-svn: 170771
* Start splitting out the debug string section handling by moving itEric Christopher2012-12-206-40/+63
| | | | | | into the DwarfUnits class. llvm-svn: 170770
* Remove two dead functions.Jakob Stoklund Olesen2012-12-201-35/+0
| | | | llvm-svn: 170766
* Use MachineInstrBuilder for PHI nodes in SelectionDAGISel.Jakob Stoklund Olesen2012-12-201-50/+25
| | | | llvm-svn: 170716
* Use MachineInstrBuilder in InstrEmitter.Jakob Stoklund Olesen2012-12-202-79/+73
| | | | | | | | | | | | This is supposed to be a mechanical change with no functional effects. InstrEmitter can generate all types of MachineOperands which revealed that MachineInstrBuilder was missing a few methods, added by this patch. Besides providing a context pointer to MI::addOperand(), MachineInstrBuilder seems like a better fit for this code. llvm-svn: 170712
* Use MachineInstrBuilder in a few CodeGen passes.Jakob Stoklund Olesen2012-12-205-18/+12
| | | | | | This automatically passes a context pointer to MI->addOperand(). llvm-svn: 170711
* Do not introduce vector operations in functions marked with noimplicitfloat.Bob Wilson2012-12-201-2/+5
| | | | | | <rdar://problem/12879313> llvm-svn: 170630
* Add a missing 'else'. Found by grep '} if'Dmitri Gribenko2012-12-191-1/+1
| | | | | | No testcase because it is apparently not so trivial to construct. llvm-svn: 170595
* Split out abbreviations for the skeleton info from the rest ofEric Christopher2012-12-192-19/+63
| | | | | | the abbreviations. Part of implementing split dwarf. llvm-svn: 170589
* Remove the explicit MachineInstrBuilder(MI) constructor.Jakob Stoklund Olesen2012-12-191-5/+4
| | | | | | | | | | | | | Use the version that also takes an MF reference instead. It would technically be possible to extract an MF reference from the MI as MI->getParent()->getParent(), but that would not work for MIs that are not inserted into any basic block. Given the reasonably small number of places this constructor was used at all, I preferred the compile time check to a run time assertion. llvm-svn: 170588
* Change AsmOperandInfo::ConstraintVT to MVT, instead of EVT.Patrik Hagglund2012-12-192-8/+9
| | | | | | Accordingly, add MVT::getVT. llvm-svn: 170550
* Split the usage of 'EVT PartVT' into 'MVT PartVT' and 'EVT PartEVT'.Patrik Hagglund2012-12-191-38/+38
| | | | llvm-svn: 170540
* Change RegVT in BitTestBlock and RegsForValue, to contain MVTs,Patrik Hagglund2012-12-192-14/+13
| | | | | | instead of EVTs. llvm-svn: 170538
* Change TargetLowering::getTypeForExtArgOrReturn to take and returnPatrik Hagglund2012-12-191-1/+1
| | | | | | MVTs, instead of EVTs. llvm-svn: 170537
* Change a parameter of TargetLowering::getVectorTypeBreakdown to MVT,Patrik Hagglund2012-12-192-14/+19
| | | | | | from EVT. llvm-svn: 170536
* Change TargetLowering::RegisterTypeForVT to contain MVTs, instead ofPatrik Hagglund2012-12-195-18/+18
| | | | | | EVTs. llvm-svn: 170535
* Change TargetLowering::TransformToType to contain MVTs, instead ofPatrik Hagglund2012-12-191-4/+4
| | | | | | EVTs. llvm-svn: 170534
* Change TargetLowering::findRepresentativeClass to take an MVT, insteadPatrik Hagglund2012-12-191-2/+2
| | | | | | of EVT. llvm-svn: 170532
* Change TargetLowering::getTypeToPromoteTo to take and return MVTs,Patrik Hagglund2012-12-192-9/+9
| | | | | | instead of EVTs. llvm-svn: 170529
* Change TargetLowering::isCondCodeLegal to take an MVT, instead of EVT.Patrik Hagglund2012-12-192-12/+15
| | | | llvm-svn: 170524
* Change TargetLowering::getCondCodeAction to take an MVT, instead ofPatrik Hagglund2012-12-192-4/+4
| | | | | | EVT. llvm-svn: 170522
* Change TargetLowering::getTruncStoreAction to take MVTs, instead of EVTs.Patrik Hagglund2012-12-192-3/+4
| | | | llvm-svn: 170510
* Optimized load + SIGN_EXTEND patterns in the X86 backend.Elena Demikhovsky2012-12-191-0/+1
| | | | llvm-svn: 170506
* After reducing the size of an operation in the DAG we zero-extend the reducedNadav Rotem2012-12-191-2/+5
| | | | | | | | bitwidth op back to the original size. If we reduce ANDs then this can cause an endless loop. This patch changes the ZEXT to ANY_EXTEND if the demanded bits are equal or smaller than the size of the reduced operation. llvm-svn: 170505
OpenPOWER on IntegriCloud