mirror of
				https://github.com/c64scene-ar/llvm-6502.git
				synced 2025-10-30 16:17:05 +00:00 
			
		
		
		
	Make the pre-split-limit option more useful by using a per-function counter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63091 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
		| @@ -38,7 +38,7 @@ using namespace llvm; | |||||||
|  |  | ||||||
| static cl::opt<int> PreSplitLimit("pre-split-limit", cl::init(-1), cl::Hidden); | static cl::opt<int> PreSplitLimit("pre-split-limit", cl::init(-1), cl::Hidden); | ||||||
|  |  | ||||||
| STATISTIC(NumSplits, "Number of intervals split"); | STATISTIC(NumTotalSplits, "Number of intervals split"); | ||||||
| STATISTIC(NumRemats, "Number of intervals split by rematerialization"); | STATISTIC(NumRemats, "Number of intervals split by rematerialization"); | ||||||
| STATISTIC(NumFolds, "Number of intervals split with spill folding"); | STATISTIC(NumFolds, "Number of intervals split with spill folding"); | ||||||
| STATISTIC(NumRenumbers, "Number of intervals renumbered into new registers"); | STATISTIC(NumRenumbers, "Number of intervals renumbered into new registers"); | ||||||
| @@ -78,6 +78,8 @@ namespace { | |||||||
|     // Def2SpillMap - A map from a def instruction index to spill index. |     // Def2SpillMap - A map from a def instruction index to spill index. | ||||||
|     DenseMap<unsigned, unsigned> Def2SpillMap; |     DenseMap<unsigned, unsigned> Def2SpillMap; | ||||||
|      |      | ||||||
|  |     unsigned NumSplits; | ||||||
|  |  | ||||||
|   public: |   public: | ||||||
|     static char ID; |     static char ID; | ||||||
|     PreAllocSplitting() : MachineFunctionPass(&ID) {} |     PreAllocSplitting() : MachineFunctionPass(&ID) {} | ||||||
| @@ -1191,6 +1193,7 @@ bool PreAllocSplitting::runOnMachineFunction(MachineFunction &MF) { | |||||||
|   LSs    = &getAnalysis<LiveStacks>(); |   LSs    = &getAnalysis<LiveStacks>(); | ||||||
|  |  | ||||||
|   bool MadeChange = false; |   bool MadeChange = false; | ||||||
|  |   NumSplits = 0; | ||||||
|  |  | ||||||
|   // Make sure blocks are numbered in order. |   // Make sure blocks are numbered in order. | ||||||
|   MF.RenumberBlocks(); |   MF.RenumberBlocks(); | ||||||
| @@ -1218,5 +1221,8 @@ bool PreAllocSplitting::runOnMachineFunction(MachineFunction &MF) { | |||||||
|  |  | ||||||
|   MadeChange |= removeDeadSpills(Split); |   MadeChange |= removeDeadSpills(Split); | ||||||
|    |    | ||||||
|  |   if (NumSplits) | ||||||
|  |     NumTotalSplits += NumSplits; | ||||||
|  |  | ||||||
|   return MadeChange; |   return MadeChange; | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user