diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2018-10-15 10:04:59 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2018-10-15 10:04:59 +0000 |
commit | edb12a838a22f212d7bee970ff637192f7ea8576 (patch) | |
tree | b8ceecb3e12339436c13c2fb2e84ffc813ce8224 /llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp | |
parent | ae98759ec5634759f15fe103b0c637e6f836829f (diff) | |
download | bcm5719-llvm-edb12a838a22f212d7bee970ff637192f7ea8576.tar.gz bcm5719-llvm-edb12a838a22f212d7bee970ff637192f7ea8576.zip |
[TI removal] Make variables declared as `TerminatorInst` and initialized
by `getTerminator()` calls instead be declared as `Instruction`.
This is the biggest remaining chunk of the usage of `getTerminator()`
that insists on the narrow type and so is an easy batch of updates.
Several files saw more extensive updates where this would cascade to
requiring API updates within the file to use `Instruction` instead of
`TerminatorInst`. All of these were trivial in nature (pervasively using
`Instruction` instead just worked).
llvm-svn: 344502
Diffstat (limited to 'llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp')
-rw-r--r-- | llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp b/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp index ac851f660d9..4790c9e5cfe 100644 --- a/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp +++ b/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp @@ -586,7 +586,7 @@ void FuncPGOInstrumentation<Edge, BBInfo>::computeCFGHash() { std::vector<char> Indexes; JamCRC JC; for (auto &BB : F) { - const TerminatorInst *TI = BB.getTerminator(); + const Instruction *TI = BB.getTerminator(); for (unsigned I = 0, E = TI->getNumSuccessors(); I != E; ++I) { BasicBlock *Succ = TI->getSuccessor(I); auto BI = findBBInfo(Succ); @@ -698,7 +698,7 @@ BasicBlock *FuncPGOInstrumentation<Edge, BBInfo>::getInstrBB(Edge *E) { // Instrument the SrcBB if it has a single successor, // otherwise, the DestBB if this is not a critical edge. - TerminatorInst *TI = SrcBB->getTerminator(); + Instruction *TI = SrcBB->getTerminator(); if (TI->getNumSuccessors() <= 1) return SrcBB; if (!E->IsCritical) @@ -1167,7 +1167,7 @@ void PGOUseFunc::setBranchWeights() { // Generate MD_prof metadata for every branch instruction. LLVM_DEBUG(dbgs() << "\nSetting branch weights.\n"); for (auto &BB : F) { - TerminatorInst *TI = BB.getTerminator(); + Instruction *TI = BB.getTerminator(); if (TI->getNumSuccessors() < 2) continue; if (!(isa<BranchInst>(TI) || isa<SwitchInst>(TI) || @@ -1213,7 +1213,7 @@ void PGOUseFunc::annotateIrrLoopHeaderWeights() { // to become an irreducible loop header after the indirectbr tail // duplication. if (BFI->isIrrLoopHeader(&BB) || isIndirectBrTarget(&BB)) { - TerminatorInst *TI = BB.getTerminator(); + Instruction *TI = BB.getTerminator(); const UseBBInfo &BBCountInfo = getBBInfo(&BB); setIrrLoopHeaderMetadata(M, TI, BBCountInfo.CountValue); } |