[PATCH] D109290: [OpaquePtr] Forbid mixing typed and opaque pointers

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 8 13:21:54 PDT 2021


dblaikie added a comment.

In D109290#2988806 <https://reviews.llvm.org/D109290#2988806>, @nikic wrote:

> For most codegen tests (that produce assembly), output for opaque pointers is the same, so that's an easy case :) For IR tests that contain pointers but don't do anything opaque pointer specific, an idea I had was to use these two run lines:
>
>   ; RUN: opt -S -passes=xxx -opaque-pointers < %s | FileCheck %s
>   ; RUN: opt -S -passes=xxx < %s | opt -S -opaque-pointers | FileCheck %s
>
> What the second line does is run the test with typed pointers and then strip pointer types afterwards, which should usually give it the same output as working with opaque pointers from the start. This way we won't be testing the exact output under typed pointers anymore, but we do test that all pointer types are consistent (due to verifier after first `opt` invocation), and I think that's all that really matters.
>
> This should allow us to gradually enable opaque pointer testing while ensuring that we're not missing any typed pointer bitcasts.

triples the number of tool invocations, though - which seems a bit concerning. Maybe if we built the option to do the -S -opaque-pointers dance into opt that'd be better for test execution performance?

& having both opaque and non-opaque testing on for everyone (2 x commands for every test) might be a bit much - I was thinking more likely a buildbot/mode where the tests could be run in opaque mode instead, maybe with an "known good" list/marker/indicator of some kind (I guess maybe whatever opt "opacify typed pointers on output" flag could also be seen as an indicator that the test was also acceptable to run in true opaque pointers mod).


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109290/new/

https://reviews.llvm.org/D109290



More information about the llvm-commits mailing list