summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/TailDuplication.cpp
Commit message (Collapse)AuthorAgeFilesLines
* CodeGen: Canonicalize access to function attributes, NFCDuncan P. N. Exon Smith2015-02-141-2/+1
| | | | | | | | | | | | | | | | | Canonicalize access to function attributes to use the simpler API. getAttributes().getAttribute(AttributeSet::FunctionIndex, Kind) => getFnAttribute(Kind) getAttributes().hasAttribute(AttributeSet::FunctionIndex, Kind) => hasFnAttribute(Kind) Also, add `Function::getFnStackAlignment()`, and canonicalize: getAttributes().getStackAlignment(AttributeSet::FunctionIndex) => getFnStackAlignment() llvm-svn: 229208
* Have MachineFunction cache a pointer to the subtarget to make lookupsEric Christopher2014-08-051-2/+2
| | | | | | | | | | | shorter/easier and have the DAG use that to do the same lookup. This can be used in the future for TargetMachine based caching lookups from the MachineFunction easily. Update the MIPS subtarget switching machinery to update this pointer at the same time it runs. llvm-svn: 214838
* Changed the liveness tracking in the RegisterScavengerPedro Artigas2014-08-041-3/+1
| | | | | | | | to use register units instead of registers. reviewed by Jakob Stoklund Olesen. llvm-svn: 214798
* Remove the TargetMachine forwards for TargetSubtargetInfo basedEric Christopher2014-08-041-2/+3
| | | | | | information and update all callers. No functional change. llvm-svn: 214781
* Convert more loops to range-based equivalentsAlexey Samsonov2014-04-301-3/+1
| | | | llvm-svn: 207714
* [Modules] Remove potential ODR violations by sinking the DEBUG_TYPEChandler Carruth2014-04-221-1/+2
| | | | | | | | | | | | define below all header includes in the lib/CodeGen/... tree. While the current modules implementation doesn't check for this kind of ODR violation yet, it is likely to grow support for it in the future. It also removes one layer of macro pollution across all the included headers. Other sub-trees will follow. llvm-svn: 206837
* [C++11] More 'nullptr' conversion. In some cases just using a boolean check ↵Craig Topper2014-04-141-11/+11
| | | | | | instead of comparing to nullptr. llvm-svn: 206142
* Disable each MachineFunctionPass for 'optnone' functions, unless thatPaul Robinson2014-03-311-0/+3
| | | | | | | pass normally runs at optimization level None, or is part of the register allocation pipeline. llvm-svn: 205228
* Switch a number of loops in lib/CodeGen over to range-based for-loops, now thatOwen Anderson2014-03-171-5/+3
| | | | | | the MachineRegisterInfo iterators are compatible with it. llvm-svn: 204075
* Phase 2 of the great MachineRegisterInfo cleanup. This time, we're changingOwen Anderson2014-03-131-4/+4
| | | | | | | | | | operator* on the by-operand iterators to return a MachineOperand& rather than a MachineInstr&. At this point they almost behave like normal iterators! Again, this requires making some existing loops more verbose, but should pave the way for the big range-based for-loop cleanups in the future. llvm-svn: 203865
* [C++11] Add 'override' keyword to virtual methods that override their base ↵Craig Topper2014-03-071-2/+2
| | | | | | class. llvm-svn: 203220
* Replace OwningPtr<T> with std::unique_ptr<T>.Ahmed Charles2014-03-061-2/+1
| | | | | | | | | | This compiles with no changes to clang/lld/lldb with MSVC and includes overloads to various functions which are used by those projects and llvm which have OwningPtr's as parameters. This should allow out of tree projects some time to move. There are also no changes to libs/Target, which should help out of tree targets have time to move, if necessary. llvm-svn: 203083
* [C++11] Replace llvm::next and llvm::prior with std::next and std::prev.Benjamin Kramer2014-03-021-3/+3
| | | | | | Remove the old functions. llvm-svn: 202636
* Pass edges weights to MachineBasicBlock::addSuccessor in TailDuplicatePass toAkira Hatanaka2014-02-121-2/+14
| | | | | | | | preserve branch probability information. <rdar://problem/15893208> llvm-svn: 201245
* Remove several unused variables.Rafael Espindola2013-10-011-2/+0
| | | | | | Patch by Alp Toker. llvm-svn: 191757
* Fix build by replacing '>>' with '> >'Tobias Grosser2013-07-141-7/+5
| | | | llvm-svn: 186276
* Use SmallVectorImpl& instead of SmallVector to avoid repeating small vector ↵Craig Topper2013-07-141-13/+13
| | | | | | size. llvm-svn: 186274
* Move all of the header files which are involved in modelling the LLVM IRChandler Carruth2013-01-021-1/+1
| | | | | | | | | | | | | | | | | | | | | 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
* Remove the Function::getFnAttributes method in favor of using the AttributeSetBill Wendling2012-12-301-2/+2
| | | | | | | | | 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
* Use MachineInstrBuilder in a few CodeGen passes.Jakob Stoklund Olesen2012-12-201-4/+3
| | | | | | This automatically passes a context pointer to MI->addOperand(). llvm-svn: 170711
* Rename the 'Attributes' class to 'Attribute'. It's going to represent a ↵Bill Wendling2012-12-191-1/+1
| | | | | | single attribute in the future. llvm-svn: 170502
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-031-9/+9
| | | | | | | | | | | | | | | | | Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] llvm-svn: 169131
* Create enums for the different attributes.Bill Wendling2012-10-091-1/+2
| | | | | | | We use the enums to query whether an Attributes object has that attribute. The opaque layer is responsible for knowing where that specific attribute is stored. llvm-svn: 165488
* Remove the `hasFnAttr' method from Function.Bill Wendling2012-09-261-1/+1
| | | | | | | The hasFnAttr method has been replaced by querying the Attributes explicitly. No intended functionality change. llvm-svn: 164725
* Stop leaking RegScavengers from TailDuplication.Benjamin Kramer2012-06-061-3/+4
| | | | llvm-svn: 158069
* Teach taildup to update livein set. rdar://11538365Evan Cheng2012-05-301-0/+25
| | | | llvm-svn: 157663
* Constrain register classes in TailDup.Jakob Stoklund Olesen2012-05-201-3/+5
| | | | | | | When rewriting operands, make sure the new registers have a compatible register class. llvm-svn: 157163
* Make post-ra tail duplication bundle safe. No test case as recent codegenEvan Cheng2012-02-201-3/+6
| | | | | | flow changes have already hidden the bug. rdar://10893812 llvm-svn: 150949
* Codegen pass definition cleanup. No functionality.Andrew Trick2012-02-081-4/+4
| | | | | | | | | | | | | Moving toward a uniform style of pass definition to allow easier target configuration. Globally declare Pass ID. Globally declare pass initializer. Use INITIALIZE_PASS consistently. Add a call to the initializer from CodeGen.cpp. Remove redundant "createPass" functions and "getPassName" methods. While cleaning up declarations, cleaned up comments (sorry for large diff). llvm-svn: 150100
* Move pass configuration out of pass constructors: TailDuplicate::PreRegAllocAndrew Trick2012-02-081-6/+7
| | | | llvm-svn: 150091
* Add bundle aware API for querying instruction properties and switch the codeEvan Cheng2011-12-071-5/+5
| | | | | | | | | | | | | | generator to it. For non-bundle instructions, these behave exactly the same as the MC layer API. For properties like mayLoad / mayStore, look into the bundle and if any of the bundled instructions has the property it would return true. For properties like isPredicable, only return true if *all* of the bundled instructions have the property. For properties like canFoldAsLoad, isCompare, conservatively return false for bundles. llvm-svn: 146026
* First chunk of MachineInstr bundle support.Evan Cheng2011-12-061-2/+1
| | | | | | | | | 1. Added opcode BUNDLE 2. Taught MachineInstr class to deal with bundled MIs 3. Changed MachineBasicBlock iterator to skip over bundled MIs; added an iterator to walk all the MIs 4. Taught MachineBasicBlock methods about bundled MIs llvm-svn: 145975
* Trim an unneeded header.Jakob Stoklund Olesen2011-08-091-0/+1
| | | | llvm-svn: 137184
* Move most of the pre BB code to TailDuplicateAndUpdate. Change theRafael Espindola2011-07-041-112/+125
| | | | | | HasIndirectbr variable to be just that. No functionality change. llvm-svn: 134371
* Reduce indentation and fix the count of how many PHIs we have inserted.Rafael Espindola2011-07-041-75/+80
| | | | llvm-svn: 134370
* - Rename TargetInstrDesc, TargetOperandInfo to MCInstrDesc and MCOperandInfo andEvan Cheng2011-06-281-2/+2
| | | | | | | | sink them into MC layer. - Added MCInstrInfo, which captures the tablegen generated static data. Chang TargetInstrInfo so it's based off MCInstrInfo. llvm-svn: 134021
* SimplifyRafael Espindola2011-06-241-14/+6
| | | | llvm-svn: 133798
* Now that bb with phis are not considered simple, duplicate them even ifRafael Espindola2011-06-241-12/+18
| | | | | | we cannot duplicate to every predecessor. llvm-svn: 133797
* Simplify now that blocks with phis are not considered simple.Rafael Espindola2011-06-241-15/+0
| | | | llvm-svn: 133793
* Move more logic to shouldTailDuplicate and only duplicate regular bb beforeRafael Espindola2011-06-231-21/+45
| | | | | | | | | | register allocation if it has a indirectbr or if we can duplicate it to every predecessor. This fixes the SingleSource/Benchmarks/Shootout-C++/matrix.cpp regression but keeps the previous improvements to sunspider. llvm-svn: 133682
* Reenable tail duplication of bb with just an unconditional jump, butRafael Espindola2011-06-221-4/+4
| | | | | | don't remove blocks that have their address taken. llvm-svn: 133659
* Revert r133607. This is causing failures in the Clang gccTestSuite.Chad Rosier2011-06-221-3/+3
| | | | | | Specifically, gcc.c-torture/compile/pr21356.c. llvm-svn: 133646
* Reenable the optimization added in 133415, but change the definition of a ↵Rafael Espindola2011-06-221-3/+3
| | | | | | | | | "simple" bb to be one with only one unconditional branch and no phis. Duplicating the phis in this case is possible, but requeres liveness analysis or breaking edges. llvm-svn: 133607
* Disable again.Rafael Espindola2011-06-201-1/+1
| | | | llvm-svn: 133446
* Re enable 133415 with two fixesRafael Espindola2011-06-201-3/+8
| | | | | | | | * Don't introduce a duplicated bb in the CFG * When making a branch unconditional, clear the PredCond array so that it is really unconditional. llvm-svn: 133432
* Disable the logic added by rafael in commit 133415 to see if it brings theDuncan Sands2011-06-201-1/+1
| | | | | | | | dragonegg buildbots back to life. Original commit message: Teach early dup how to duplicate basic blocks with one successor and only phi instructions into more complex blocks. llvm-svn: 133430
* Fix MSVC build. next() function already exists in the MSVC headers. This ↵Francois Pichet2011-06-201-1/+1
| | | | | | create a overload conflict. Make sure we pick up the llvm one. llvm-svn: 133416
* Teach early dup how to duplicate basic blocks with one successor and only ↵Rafael Espindola2011-06-201-2/+142
| | | | | | | | phi instructions into more complex blocks. llvm-svn: 133415
* Two fixes relating to debug value:Rafael Espindola2011-06-171-0/+10
| | | | | | | | * We should change the generated code because of a debug use. * Avoid creating debug uses of undef, as they become a kill. Test to follow. llvm-svn: 133255
* Enable early duplication of small blocks. There are still improvements toRafael Espindola2011-06-171-29/+32
| | | | | | be made, but this is already a win. llvm-svn: 133240
OpenPOWER on IntegriCloud