some of Basic blocks are deleted after running embedded ExecutionEngine

Hi llvm-ers,

I have integrated an ExecutionEngine in my pass, before I run the execution engine, I check the program has 32 basic blocks. However, after I run the execution engine, the number of basic blocks is 30. Two basic blocks are deleted by the embedded JIT execution engine.

Does the ExecutionEngine perform any optimization? If yes, how can I disable it?

Thanks,
Henry

+Lang for jit things

Hi Henry,

The ExecutionEngine owns any module that you pass to it, and it may make modifications to the module even at O0. If you want to preserve the existing module as-is you’ll need to clone it and pass the clone to the ExecutionEngine instead.

Cheers,
Lang.

Hi Lang,

You are right. :slight_smile:
I succeed after passing the cloned module to the ExecutionEngine.

Thanks,
Henry