This adds a -normalize-opaque-pointers option to opt, which is intended to allow running most of our test both in typed and opaque pointer mode.
In opaque pointer mode, this option does nothing. In typed pointer mode, before we print the module, we first import it into a new context with opaque pointers enabled, and then print the result. This happens after the IR has been verified with typed pointers.
The idea here is that running the verifier is sufficient to ensure that the typed pointer IR is consistent (has all the necessary bitcasts and matching types), and we can then print it with opaque pointers, so the output is the same as in proper opaque pointer mode.
This will not hold up if the pass does anything fancy with opaque pointers, but I think it will allow us to cover a significant portion of tests while still fully supporting both modes. I've included sample EarlyCSE test changes here.
clang-format: please reformat the code