[LLVMdev] Using the StructurizeCFG pass

Félix Cloutier felixcca at yahoo.ca
Tue Jun 16 19:33:58 PDT 2015


Hi all,

I'm trying to add the StructurizeCFG pass with a legacy::PassManager:

	legacy::PassManager pm;
	pm.add(createTypeBasedAliasAnalysisPass());
	pm.add(createScopedNoAliasAAPass());
	pm.add(createBasicAliasAnalysisPass());
	// other passes
	pm.add(createStructurizeCFGPass());
	pm.run(*module);

But I get this error when I attempt to to run it:

Pass 'Structurize control flow' is not initialized.
Verify if there is a pass dependency cycle.
Required Passes:
	Lower SwitchInst's to branches
	Dominator Tree Construction
Assertion failed: (PI && "Expected required passes to be initialized"), function schedulePass, file /path/to/llvm/lib/IR/LegacyPassManager.cpp, line 640.

StructurizeCFG calls initializeStructurizeCFGPass from its constructor, so it would seem to me that the pass should have been initialized. Predictably, explicitly calling it myself does not change anything.

There appears to be only one use of StructurizeCFG (from the AMD GPU backend), and I'm not familiar enough with the backend architecture to figure out what it's doing that I'm not.

Am I missing something obvious?

Félix
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150616/e5394dc8/attachment.html>


More information about the llvm-dev mailing list