[llvm-dev] transformation passes (e.g. adce) as analysis only?

alexp via llvm-dev llvm-dev at lists.llvm.org
Sun Feb 24 23:16:20 PST 2019


Hi all,

I wonder if (and how) I could feed some module or individual functions
into transform passes and getting back the transformation result (not so
important) with information about which elemnt (global, instruction,
function argument etc.) of the untransformed would be transformed (e.g.
removed)?

Example e.g. aggressive dead code removal:
The constructor of AggressiveDeadCodeRemoval class executes:

initialize
markLiveInstructions
removeDeadInstructions (actually perfomrs the removal, however it seems
it can also re-label instructions as newly dead?)

and thereby populates the maps blockInfo and InstInfo, which holds the
information about the liveness (of blocks and instructions).
-> given these, I would then know which instruction / block of the
untransformed function is dead.

However, it seems that there is no public access to this information.

And more complex: what if I would like to know for a given module which
global, argument, instruction, block, etc. would be removed (which
conditional branch becomes unconditional etc.) by a set of complex
iterative transformations like e.g. -o3.

Is there a common approach to such an analysis? Where can I find it /
find some documentation about it?

Thanks
Alex



More information about the llvm-dev mailing list