I’m generating assembly from a module like this:
TM->addPassesToEmitFile(pass, os, nullptr, CGFT_AssemblyFile, false);
pass.run(M);
I get the assembly output, as expected, but this is also mutating my module – eliminating some dead code and optimizing away a (not-dead) zext instruction – in ways that are undesirable for my use case. Assuming that this is a feature and not a bug, can I prevent these transformations from happening? (If not, I can always make a copy of the module first, but that seems clumsy.) Thanks.