I operate on IR, which should later-on be lowered on different target
machines. Due to the generation of the IR via partly random processes, I
have lots of ineffective instruction in there.
Every now and then i'd like to cut back all the fuzz.
I can do this e.g. via opt -o3 -S input.ll -o output.ll
which however applies machine dependent optimizations.
What would be the 'simplify as much as possible without machine
dependent stuff' approach using opt?
Another option instead of the commandline opt would be to use the (new)
passbuilder. As a starter, I tried to apply the PerModuleDefaultPipeline.
My Idea was that I could later reduce this to only applying
However, the following results in a transformed .bc file, for which
llvm-dis reports 'malformed block'.
I can not figure out whats the problem here.
Also, the verifierPass does not report any problems (might be because I
add it too late)?
What am I missing here?
// Register all the basic analyses with the managers.
passBuilder.crossRegisterProxies(LAM, FAM, CGAM, MAM);
false); //debug logging=false