|
44 | 44 | using namespace llvm;
|
45 | 45 | using namespace llvm::PatternMatch;
|
46 | 46 |
|
47 |
| -STATISTIC(NumElim, "Number of blocks eliminated"); |
| 47 | +STATISTIC(NumBlocksElim, "Number of blocks eliminated"); |
| 48 | +STATISTIC(NumCmpUses, "Number of uses of Cmp expressions replaced with uses of " |
| 49 | + "sunken Cmps"); |
| 50 | +STATISTIC(NumCastUses, "Number of uses of Cast expressions replaced with uses " |
| 51 | + "of sunken Casts"); |
| 52 | +STATISTIC(NumMemoryInsts, "Number of memory instructions whose address " |
| 53 | + "computations were sunk"); |
| 54 | +STATISTIC(NumExtsMoved, "Number of [s|z]ext instructions combined with loads"); |
| 55 | +STATISTIC(NumExtUses, "Number of uses of [s|z]ext instructions optimized"); |
48 | 56 |
|
49 | 57 | static cl::opt<bool>
|
50 | 58 | CriticalEdgeSplit("cgp-critical-edge-splitting",
|
@@ -310,7 +318,7 @@ void CodeGenPrepare::EliminateMostlyEmptyBlock(BasicBlock *BB) {
|
310 | 318 | PFI->removeEdge(ProfileInfo::getEdge(BB, DestBB));
|
311 | 319 | }
|
312 | 320 | BB->eraseFromParent();
|
313 |
| - ++NumElim; |
| 321 | + ++NumBlocksElim; |
314 | 322 |
|
315 | 323 | DEBUG(dbgs() << "AFTER:\n" << *DestBB << "\n\n\n");
|
316 | 324 | }
|
@@ -489,6 +497,7 @@ static bool OptimizeNoopCopyExpression(CastInst *CI, const TargetLowering &TLI){
|
489 | 497 |
|
490 | 498 | // Replace a use of the cast with a use of the new cast.
|
491 | 499 | TheUse = InsertedCast;
|
| 500 | + ++NumCastUses; |
492 | 501 | }
|
493 | 502 |
|
494 | 503 | // If we removed all uses, nuke the cast.
|
@@ -546,6 +555,7 @@ static bool OptimizeCmpExpression(CmpInst *CI) {
|
546 | 555 |
|
547 | 556 | // Replace a use of the cmp with a use of the new cmp.
|
548 | 557 | TheUse = InsertedCmp;
|
| 558 | + ++NumCmpUses; |
549 | 559 | }
|
550 | 560 |
|
551 | 561 | // If we removed all uses, nuke the cmp.
|
@@ -793,6 +803,7 @@ bool CodeGenPrepare::OptimizeMemoryInst(Instruction *MemoryInst, Value *Addr,
|
793 | 803 | // we don't want to match some completely different instruction.
|
794 | 804 | SunkAddrs[Addr] = 0;
|
795 | 805 | }
|
| 806 | + ++NumMemoryInsts; |
796 | 807 | return true;
|
797 | 808 | }
|
798 | 809 |
|
@@ -858,6 +869,7 @@ bool CodeGenPrepare::MoveExtToFormExtLoad(Instruction *I) {
|
858 | 869 | // can fold it.
|
859 | 870 | I->removeFromParent();
|
860 | 871 | I->insertAfter(LI);
|
| 872 | + ++NumExtsMoved; |
861 | 873 | return true;
|
862 | 874 | }
|
863 | 875 |
|
@@ -929,7 +941,7 @@ bool CodeGenPrepare::OptimizeExtUses(Instruction *I) {
|
929 | 941 |
|
930 | 942 | // Replace a use of the {s|z}ext source with a use of the result.
|
931 | 943 | TheUse = InsertedTrunc;
|
932 |
| - |
| 944 | + ++NumExtUses; |
933 | 945 | MadeChange = true;
|
934 | 946 | }
|
935 | 947 |
|
|
0 commit comments