[PATCH] D70376: [LVI] Restructure caching

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 13 12:17:42 PDT 2020


nikic added a comment.

In D70376#2148174 <https://reviews.llvm.org/D70376#2148174>, @tejohnson wrote:

> It looks like I may not be able to share the obfuscated IR for this particular test case. I'll try to look for something else that demonstrates a compile time increase from the patch. But in any case, really any code that invokes LazyValueInfoCache::eraseValue on a whole lot of values in a function with a large number of BBs is going to suffer with a compile time increase from the change to the data structures. Here's the hot call path to it in my test case:
>
> llvm::detail::PassModel<llvm::Function, llvm::SimplifyCFGPass, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Function> >::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&)
>  llvm::SimplifyCFGPass::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&)
>  simplifyFunctionCFG(llvm::Function&, llvm::TargetTransformInfo const&, llvm::SimplifyCFGOptions const&)
>  llvm::removeUnreachableBlocks(llvm::Function&, llvm::DomTreeUpdater*, llvm::MemorySSAUpdater*)
>  llvm::BasicBlock::eraseFromParent()
>  llvm::BasicBlock::~BasicBlock()     
>  llvm::Value::deleteValue()               
>  llvm::Instruction::~Instruction()                          
>  llvm::ValueHandleBase::ValueIsDeleted(llvm::Value*)
>  (anonymous namespace)::LVIValueHandle::deleted()
>
> I think this is after JumpThreading, which presumably created all these simplify opportunities.


This looks fishy. LazyValueInfo should not be alive when SimplifyCFG gets run. SimplifyCFG does not depend on it, or preserve it.

Do you use the legacy PM or new PM?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70376/new/

https://reviews.llvm.org/D70376





More information about the llvm-commits mailing list