[llvm-dev] [RFC] Compiled regression tests.

David Greene via llvm-dev llvm-dev at lists.llvm.org
Wed Jul 1 11:38:16 PDT 2020


Michael Kruse via llvm-dev <llvm-dev at lists.llvm.org> writes:

> The reason is that MDNodes are emitted in topological order of a
> depth-first search. The patch changed the order of ACCESS_GROUP_INNER and
> ACCESS_GROUP_OUTER in line 41 but because in the mitted IR file, the first
> argument of !3 is emitted before the second argument, ACCESS_GROUP_OUTER is
> on line 42 and ACCESS_GROUP_INNER on line 43 instead.

I have run into this problem as well and my solution was to use
CHECK-DAG.  That might not work in all cases though.

There's another fragility problem with the test.  It assumes that the
!llvm.loop metadata is the only thing printed on the branch
instructions.  That might not be true forever.  The !llvm.access.group
checks work around this with {{.*}} to snarf up other metadata but a
more robust solution is probably CHECK-SAME.  CHECK-SAME is pretty much
required if you want to match more than one kind of metadata node on a
line while being robust in the face of future changes.

These are all issues I ran into when enhancing the update scripts to
handle metadata.

Michael's proposal definitely has merit.  More semantically-precise
tests are more robust.  But there's also a lot of benefit in enhancing
the existing test update scripts.

                 -David


More information about the llvm-dev mailing list