search for: getpassregistry

Displaying 20 results from an estimated 102 matches for "getpassregistry".

2014 Jun 01
3
[LLVMdev] PassRegistry thread safety and ManagedStatic interaction
...afe, but there are mutexes and locking used in the code. This is actually creating a problem, because of a subtle bug involving static initialization order and shutdown. In particular, the RegisterPass<> static template will get invoked during static initialization and call PassRegistry::getPassRegistry()->registerPass(*this); Note that PassRegistry, however, is a ManagedStatic. So the call to getPassRegistry() creates the backing object of the ManagedStatic here. Then registerPass gets called, which attempts to lock the mutex. This will initialize the backing object of the SmartRWMutex. D...
2011 Nov 08
2
[LLVMdev] loadable passes with dependencies?
...o, "hello", "Hello World Pass", false, true) INITIALIZE_PASS_DEPENDENCY(DominatorTree) INITIALIZE_PASS_END(Hello, "hello", "Hello World Pass", false, true) class StaticInitializer { public: StaticInitializer() { PassRegistry &Registry = *PassRegistry::getPassRegistry(); initializeHelloPass(Registry); } }; static StaticInitializer InitializeEverything; Thanks again On Tue, Nov 8, 2011 at 10:18 AM, Tobias Grosser <tobias at grosser.es> wrote: > On 11/08/2011 03:40 PM, ret val wrote: >> >> I'm confused by your code. StaticInitializer...
2014 Jun 02
2
[LLVMdev] PassRegistry thread safety and ManagedStatic interaction
...is actually creating a problem, because of a subtle > bug > > involving static initialization order and shutdown. > > > > In particular, the RegisterPass<> static template will get invoked during > > static initialization and call > > > > PassRegistry::getPassRegistry()->registerPass(*this); > > > > Note that PassRegistry, however, is a ManagedStatic. So the call to > > getPassRegistry() creates the backing object of the ManagedStatic here. > > Then registerPass gets called, which attempts to lock the mutex. This > will > >...
2018 Sep 24
3
Porting Pass to New PassManager
...he new one has various benefits over legacy and wanted to clarify on something. Does creating the static RegisterPass struct register the pass with the new PassManager? It seems that RegisterPass does the same things that the INITIALIZE_PASS_* macros do but it registers the pass with PassRegistry::getPassRegistry(). What I'm not sure of is if this uses the new PassManager infrastructure. Exploring the code doesn't seem to show that this PassRegistry touches anything in the legacy namespace, but I wanted double confirmation on this. Thanks, Leonard
2011 Nov 08
0
[LLVMdev] loadable passes with dependencies?
...ScopInfoPass(Registry); 79 initializeTempScopInfoPass(Registry); 80 } 81 82 // Statically register all Polly passes such that they are available after 83 // loading Polly. 84 class StaticInitializer { 85 86 public: 87 StaticInitializer() { 88 PassRegistry &Registry = *PassRegistry::getPassRegistry(); 89 initializePollyPasses(Registry); 90 } 91 }; 92 93 static StaticInitializer InitializeEverything; For your example, the INITIALIZE_PASS_ macros create for your Hello pass a function initializeHelloPass(PassRegistry &). This function initializes your pass and all dependent pass...
2014 Jun 02
2
[LLVMdev] PassRegistry thread safety and ManagedStatic interaction
...; > involving static initialization order and shutdown. > >> > > >> > In particular, the RegisterPass<> static template will get invoked > >> > during > >> > static initialization and call > >> > > >> > PassRegistry::getPassRegistry()->registerPass(*this); > >> > > >> > Note that PassRegistry, however, is a ManagedStatic. So the call to > >> > getPassRegistry() creates the backing object of the ManagedStatic > here. > >> > Then registerPass gets called, which attempts to l...
2016 Feb 19
3
target triple in 3.8
I added your suggestion and am using this now llvm::legacy::FunctionPassManager *functionPassManager = new llvm::legacy::FunctionPassManager(Mod); llvm::PassRegistry &registry = *llvm::PassRegistry::getPassRegistry(); initializeScalarOpts(registry); functionPassManager->add( new llvm::TargetLibraryInfoWrapperPass(llvm::TargetLibraryInfoImpl(targetMachine->getTargetTriple())) ); still, LV: The Widest register is: 32 bits. so, unfortunately no change. If I dump the Module, it starts with: ; Modu...
2012 Jun 05
2
[LLVMdev] Function Pass Manager
...oes > nothing but throw the 'Unable to schedule' error. > > namespace { > struct MyPass : public FunctionPass { > static char ID; // Pass identification, replacement for typeid > MyPass() : FunctionPass(ID) { > initializeMyPassPass(*PassRegistry::getPassRegistry()); > } > virtual void getAnalysisUsage(AnalysisUsage&AU) const { > AU.addRequiredID(LoopSimplifyID); > AU.addPreservedID(LoopSimplifyID); > } > virtual bool runOnFunction(Function&F); > }; > } Is LoopSimplifyID an analysi...
2016 Mar 24
2
Help with pass manager
...izeAllTargetMCs(); >> InitializeAllAsmPrinters(); >> InitializeAllAsmParsers(); >> >> // Initialize codegen and IR passes used by llc so that the -print-after, >> // -print-before, and -stop-after options work. >> PassRegistry *Registry = PassRegistry::getPassRegistry(); >> initializeCore(*Registry); >> initializeCodeGen(*Registry); >> initializeLoopStrengthReducePass(*Registry); >> initializeLowerIntrinsicsPass(*Registry); >> initializeUnreachableBlockElimPass(*Registry); >> >> >> -- >> Mehdi &gt...
2016 Mar 24
0
Help with pass manager
The problems happens because PMTopLevelManager::findAnalysisPassInfo(AnalysisID AID) returns nullptr in PMTopLevelManager::addImmutablePass(ImmutablePass *P). This because PassRegistry::getPassRegistry()->getPassInfo(AID) call in it returns nullptr as well. Should I probably register the pass I want to add with PassRegistry::registerPass(const PassInfo &PI, bool ShouldFree) ? I didn’t do it because llc doesn’t do it either. Here is the assertion: Assertion failed: (PassInf && &quo...
2016 Mar 30
1
Help with pass manager
...Mar 24, 2016, at 10:41 AM, Lorenzo Laneve via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > The problems happens because PMTopLevelManager::findAnalysisPassInfo(AnalysisID AID) returns nullptr in PMTopLevelManager::addImmutablePass(ImmutablePass *P). > This because PassRegistry::getPassRegistry()->getPassInfo(AID) call in it returns nullptr as well. > Should I probably register the pass I want to add with PassRegistry::registerPass(const PassInfo &PI, bool ShouldFree) ? > I didn’t do it because llc doesn’t do it either. > > Here is the assertion: > Assertion failed:...
2012 Apr 12
0
[LLVMdev] Function Pass Manager
...h an example. It's a pass which does nothing but throw the 'Unable to schedule' error. namespace { struct MyPass : public FunctionPass { static char ID; // Pass identification, replacement for typeid MyPass() : FunctionPass(ID) { initializeMyPassPass(*PassRegistry::getPassRegistry()); } virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequiredID(LoopSimplifyID); AU.addPreservedID(LoopSimplifyID); } virtual bool runOnFunction(Function &F); }; } char MyPass::ID = 0; INITIALIZE_PASS_BEGIN(MyPass, "mypass", &q...
2013 Mar 15
2
[LLVMdev] write a simple MachineFunctionPass
...the pass to the following form : using namespace llvm; namespace { class CFGexplorator : public MachineFunctionPass { public: static char ID; // Pass identification, replacement for typeid CFGexplorator() : MachineFunctionPass(ID) { //initializeMemDepPrinterPass(*PassRegistry::getPassRegistry()); } private: virtual bool runOnMachineFunction(MachineFunction &MF); virtual void getAnalysisUsage(AnalysisUsage &AU) const { MachineFunctionPass::getAnalysisUsage(AU); } }; } // end anonymous namespace char CFGexplorator::ID = 0; static RegisterPass<CFGexp...
2011 Nov 08
2
[LLVMdev] loadable passes with dependencies?
I'm confused by your code. StaticInitializer seems to exist so you can create InitializeEverything, which doesn't get used. Do I need to do something along the lines of: static void registerPollyPasses(const llvm::PassManagerBuilder &Builder, llvm::PassManagerBase &PM) { PM.add(llvm::createPromoteMemoryToRegisterPass());
2011 Nov 08
4
[LLVMdev] loadable passes with dependencies?
...LIZE_PASS_DEPENDENCY(DominatorTree) >> INITIALIZE_PASS_END(Hello, "hello", "Hello World Pass", false, true) >> >> class StaticInitializer { >> public: >>        StaticInitializer() { >>                PassRegistry&Registry = *PassRegistry::getPassRegistry(); >>                initializeHelloPass(Registry); >>        } >> }; >> >> static StaticInitializer InitializeEverything; > > Looks good to me. Are you sure you call getAnalysis only for the > DominatorTree? What is the output of "grep getAnalysis YourPa...
2012 Mar 23
3
[LLVMdev] Function Pass Manager
Hi, I'm writing a function pass which is dynamically loaded by opt and I need some analysis and passes to be run before my pass: virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired<LoopInfo>(); AU.addPreserved<LoopInfo>(); AU.addRequiredID(LoopSimplifyID); AU.addPreservedID(LoopSimplifyID);
2011 Nov 08
0
[LLVMdev] loadable passes with dependencies?
...World Pass", false, true) > INITIALIZE_PASS_DEPENDENCY(DominatorTree) > INITIALIZE_PASS_END(Hello, "hello", "Hello World Pass", false, true) > > class StaticInitializer { > public: > StaticInitializer() { > PassRegistry&Registry = *PassRegistry::getPassRegistry(); > initializeHelloPass(Registry); > } > }; > > static StaticInitializer InitializeEverything; Looks good to me. Are you sure you call getAnalysis only for the DominatorTree? What is the output of "grep getAnalysis YourPass.cpp"? Cheers Tobi
2013 Jan 24
1
[LLVMdev] llvm pass INITIALIZE
...in my pass. Assertion `AA && "AA didn't call InitializeAliasAnalysis in its run method!"' failed. Then, I tried to use INITIALIZE_PASS_XXXX or INITIALIZE_AG_PASS template, together with `*llvm::createMyMemDepPrinter()` and `initializeMemDepPrinterPass(*PassRegistry::getPassRegistry())` methods. Therefore, I got two compilation errors: MyMemDepPrinter.cpp:101:1: error: ‘void llvm::initializeMyMemDepPrinterPass(llvm::PassRegistry&)’ should have been declared inside ‘llvm’ MyMemDepPrinter.cpp:104:43: error: ‘llvm::FunctionPass* llvm::createMyMemDepPrinter()’ should...
2016 Mar 24
2
Help with pass manager
...egistered targets. InitializeAllTargets(); InitializeAllTargetMCs(); InitializeAllAsmPrinters(); InitializeAllAsmParsers(); // Initialize codegen and IR passes used by llc so that the -print-after, // -print-before, and -stop-after options work. PassRegistry *Registry = PassRegistry::getPassRegistry(); initializeCore(*Registry); initializeCodeGen(*Registry); initializeLoopStrengthReducePass(*Registry); initializeLowerIntrinsicsPass(*Registry); initializeUnreachableBlockElimPass(*Registry); -- Mehdi > On Mar 24, 2016, at 9:59 AM, Lorenzo Laneve <lore97drk at icloud.com>...
2011 Nov 08
2
[LLVMdev] loadable passes with dependencies?
...D(Hello, "hello", "Hello World Pass", false, true) >> >> >> >> class StaticInitializer { >> >> public: >> >>        StaticInitializer() { >> >>                PassRegistry&Registry = >> >> *PassRegistry::getPassRegistry(); >> >>                initializeHelloPass(Registry); >> >>        } >> >> }; >> >> >> >> static StaticInitializer InitializeEverything; >> > >> > Looks good to me. Are you sure you call getAnalysis only for the >>...