// -*- C++ -*- (c) 2015 Petr Rockai #include #include DIVINE_RELAX_WARNINGS #include #include #include DIVINE_UNRELAX_WARNINGS #include #include #include namespace lart { namespace interference { struct Pass : lart::Pass { std::unordered_map< llvm::Instruction *, std::unordered_set< llvm::Instruction * > > _interference; void annotate( llvm::Function &f ); void clear() { _interference.clear(); } void propagate( llvm::Instruction *def, llvm::Instruction *use ); llvm::PreservedAnalyses run( llvm::Module &m ) { updateIDs( m ); int total = 0; for ( auto f = m.begin(); f != m.end(); ++ f ) ++ total; int i = 0; for ( auto &f : m ) { std::cerr << " [" << (++i) << "/" << total << "] annotating function " << f.getName().str() << std::endl; annotate( f ); clear(); } return llvm::PreservedAnalyses::all(); } }; } }