diff options
| author | Jessica Paquette <jpaquette@apple.com> | 2018-08-31 20:51:54 +0000 |
|---|---|---|
| committer | Jessica Paquette <jpaquette@apple.com> | 2018-08-31 20:51:54 +0000 |
| commit | 397c05dd7d8f4a99659d5f4e6fdd07f29a3bfd5e (patch) | |
| tree | fa0a1d945de5fa4c89c6a1f398b58602932063b2 /llvm | |
| parent | 42a4d0822e529b39cdc808e78ee0931bc2eb120e (diff) | |
| download | bcm5719-llvm-397c05dd7d8f4a99659d5f4e6fdd07f29a3bfd5e.tar.gz bcm5719-llvm-397c05dd7d8f4a99659d5f4e6fdd07f29a3bfd5e.zip | |
[NFC] Check if P is a pass manager on entry to emitInstrCountChangedRemark
There's no point in finding a function to use for remark output when we're
not going to emit anything.
llvm-svn: 341252
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/lib/IR/LegacyPassManager.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/IR/LegacyPassManager.cpp b/llvm/lib/IR/LegacyPassManager.cpp index 3c97d337321..cfec2c98f20 100644 --- a/llvm/lib/IR/LegacyPassManager.cpp +++ b/llvm/lib/IR/LegacyPassManager.cpp @@ -144,6 +144,13 @@ unsigned PMDataManager::initSizeRemarkInfo(Module &M) { void PMDataManager::emitInstrCountChangedRemark(Pass *P, Module &M, int64_t Delta, unsigned CountBefore) { + // If it's a pass manager, don't emit a remark. (This hinges on the assumption + // that the only passes that return non-null with getAsPMDataManager are pass + // managers.) The reason we have to do this is to avoid emitting remarks for + // CGSCC passes. + if (P->getAsPMDataManager()) + return; + // We need a function containing at least one basic block in order to output // remarks. Since it's possible that the first function in the module doesn't // actually contain a basic block, we have to go and find one that's suitable @@ -157,13 +164,6 @@ void PMDataManager::emitInstrCountChangedRemark(Pass *P, Module &M, // We found a function containing at least one basic block. Function *F = &*It; - - // If it's a pass manager, don't emit a remark. (This hinges on the assumption - // that the only passes that return non-null with getAsPMDataManager are pass - // managers.) The reason we have to do this is to avoid emitting remarks for - // CGSCC passes. - if (P->getAsPMDataManager()) - return; int64_t CountAfter = static_cast<int64_t>(CountBefore) + Delta; BasicBlock &BB = *F->begin(); OptimizationRemarkAnalysis R("size-info", "IRSizeChange", |

