[PATCH] D110534: [llvm-reduce] Reduce metadata references.

Michael Kruse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 27 10:44:00 PDT 2021


Meinersbur added inline comments.


================
Comment at: llvm/test/tools/llvm-reduce/remove-metadata-args.ll:11
+
+; Boring stuff's metadata must have been removed.
+; REDUCED-NOT: Boring {{.*}} !md !0
----------------
aeubanks wrote:
> should add a couple things to check for just to make sure we didn't accidentally reduce everything
The RUN at line 2 tests this by checking the existence of all the "EXCITING" lines. I started using `--check-prefixes=EXCITING,REDUCED` but then I would add NOT lines between all the INTERESTING lines. Would something like `REDUCED-DAG-NOT` or `REDUCED-NOT-DAG` work?


================
Comment at: llvm/test/tools/llvm-reduce/remove-metadata-args.ll:13
+; REDUCED-NOT: Boring {{.*}} !md !0
+; REDUCED-NOT: !md !0 {{.*}} Boring
+
----------------
aeubanks wrote:
> jeroen.dobbelaere wrote:
> > Just wondering: given the spaces around the matcher, will this have the wanted effect ? Aka, if you give the checker the original input, will it fail ?
> llvm-reduce should automatically check that the input is interesting and fail out if it isn't, so I don't think we need the extra RUN lines. We just need to check if the output is correct.
The NOT expressions would match the NOT lines themselves. To appropriately test the test itself, I ran it through `opt` (see lines 4 and 5) to remove comments.

Turns out you were right with your suspicion. `Boring {{.*}}` requires a space after `Boring`, which e.g. is not the case for `@BoringGlobal`. I had the concern with spaces as well, but only considered the `!md !0` which indeed is always followed/proceeded with a space.

I left line 4 and 5 in the patch for illustration. I could remove them again before committing.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110534



More information about the llvm-commits mailing list