mirror of
				https://github.com/c64scene-ar/llvm-6502.git
				synced 2025-10-30 16:17:05 +00:00 
			
		
		
		
	Add some more statistics to CodeGenPrepare.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122891 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
		| @@ -45,6 +45,8 @@ using namespace llvm; | |||||||
| using namespace llvm::PatternMatch; | using namespace llvm::PatternMatch; | ||||||
|  |  | ||||||
| STATISTIC(NumBlocksElim, "Number of blocks eliminated"); | STATISTIC(NumBlocksElim, "Number of blocks eliminated"); | ||||||
|  | STATISTIC(NumPHIsElim, "Number of trivial PHIs eliminated"); | ||||||
|  | STATISTIC(NumGEPsElim, "Number of GEPs converted to casts"); | ||||||
| STATISTIC(NumCmpUses, "Number of uses of Cmp expressions replaced with uses of " | STATISTIC(NumCmpUses, "Number of uses of Cmp expressions replaced with uses of " | ||||||
|                       "sunken Cmps"); |                       "sunken Cmps"); | ||||||
| STATISTIC(NumCastUses, "Number of uses of Cast expressions replaced with uses " | STATISTIC(NumCastUses, "Number of uses of Cast expressions replaced with uses " | ||||||
| @@ -981,6 +983,7 @@ bool CodeGenPrepare::OptimizeBlock(BasicBlock &BB) { | |||||||
|       if (Value *V = SimplifyInstruction(P)) { |       if (Value *V = SimplifyInstruction(P)) { | ||||||
|         P->replaceAllUsesWith(V); |         P->replaceAllUsesWith(V); | ||||||
|         P->eraseFromParent(); |         P->eraseFromParent(); | ||||||
|  |         ++NumPHIsElim; | ||||||
|       } |       } | ||||||
|     } else if (CastInst *CI = dyn_cast<CastInst>(I)) { |     } else if (CastInst *CI = dyn_cast<CastInst>(I)) { | ||||||
|       // If the source of the cast is a constant, then this should have |       // If the source of the cast is a constant, then this should have | ||||||
| @@ -1020,6 +1023,7 @@ bool CodeGenPrepare::OptimizeBlock(BasicBlock &BB) { | |||||||
|                                           GEPI->getName(), GEPI); |                                           GEPI->getName(), GEPI); | ||||||
|         GEPI->replaceAllUsesWith(NC); |         GEPI->replaceAllUsesWith(NC); | ||||||
|         GEPI->eraseFromParent(); |         GEPI->eraseFromParent(); | ||||||
|  |         ++NumGEPsElim; | ||||||
|         MadeChange = true; |         MadeChange = true; | ||||||
|         BBI = NC; |         BBI = NC; | ||||||
|       } |       } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user