[PATCH] D117778: [OpaquePtrs] Add -normalize-opaque-pointers option

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 20 05:43:28 PST 2022


nikic created this revision.
nikic added a reviewer: opaque-pointers.
nikic requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

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.


https://reviews.llvm.org/D117778

Files:
  llvm/test/Transforms/EarlyCSE/commute.ll
  llvm/test/Transforms/EarlyCSE/flags.ll
  llvm/test/Transforms/EarlyCSE/guards.ll
  llvm/test/Transforms/EarlyCSE/invariant-loads.ll
  llvm/test/Transforms/EarlyCSE/invariant.start.ll
  llvm/test/Transforms/EarlyCSE/masked-intrinsics-unequal-masks.ll
  llvm/test/Transforms/EarlyCSE/masked-intrinsics.ll
  llvm/test/Transforms/EarlyCSE/noalias-scope-decl.ll
  llvm/test/Transforms/EarlyCSE/phi.ll
  llvm/tools/opt/NewPMDriver.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117778.401609.patch
Type: text/x-patch
Size: 77248 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220120/18fdec89/attachment.bin>


More information about the llvm-commits mailing list