David Greene via llvm-dev
2020-Jul-07 20:05 UTC
[llvm-dev] [RFC] Compiled regression tests.
"Robinson, Paul via llvm-dev" <llvm-dev at lists.llvm.org> writes:> CHECK-SAME starts where the previous match ended. It is not implicitly > a DAG on the same line. Documentation patches welcome.It's unfortunate we don't have a version of CHECK-SAME that restarts the match from the beginning. Maybe I should add one. CHECK-SAME seems like a misnomer. Perhaps CHECK-CONTINUE would have been more clear. -David
Robinson, Paul via llvm-dev
2020-Jul-07 20:38 UTC
[llvm-dev] [RFC] Compiled regression tests.
> -----Original Message----- > From: David Greene <david.greene at hpe.com> > Sent: Tuesday, July 7, 2020 4:06 PM > To: Robinson, Paul <paul.robinson at sony.com>; Michael Kruse > <llvmdev at meinersbur.de>; 'llvm-dev at lists.llvm.org' <llvm- > dev at lists.llvm.org> > Subject: Re: [llvm-dev] [RFC] Compiled regression tests. > > "Robinson, Paul via llvm-dev" <llvm-dev at lists.llvm.org> writes: > > > CHECK-SAME starts where the previous match ended. It is not implicitly > > a DAG on the same line. Documentation patches welcome. > > It's unfortunate we don't have a version of CHECK-SAME that restarts the > match from the beginning. Maybe I should add one. > > CHECK-SAME seems like a misnomer. Perhaps CHECK-CONTINUE would have > been more clear. > > -DavidSAME was picked to contrast with NEXT. They behave identically, except that SAME wants zero newlines between its match and the previous match, and NEXT wants one newline in that interval. I believe you can get the effect you want with a pair of DAG directives followed by `CHECK: {{$}}`. The latter will constrain the DAG search to be between the previous match point and the next EOL. --paulr
David Greene via llvm-dev
2020-Jul-07 21:10 UTC
[llvm-dev] [RFC] Compiled regression tests.
"Robinson, Paul via llvm-dev" <llvm-dev at lists.llvm.org> writes:> I believe you can get the effect you want with a pair of DAG directives > followed by `CHECK: {{$}}`. The latter will constrain the DAG search > to be between the previous match point and the next EOL.I'm sorry, I don't quite understand what you mean. Can you give an example? My use-case is for metadata, where I wanted to do this: CHECK: %r1 = add %r2, %r3 CHECK-SAME: !some-metadata CHECK-SAME: !some-other-metadata where some-metadata and some-other-metadata might be reordered within the line (because some unrelated metadata got added to the instruction). In other words, all of these should match: %r1 = add %r2, %r3, !some-metadata !1, !some-other-metadata !2 %r1 = add %r2, %r3, !some-other-metadata !1, !some-metadata !2 %r1 = add %r2, %r3, !some-other-metadata !1, !some-unrelated-metadata !3, !some-metadata !2 -David