[PATCH] D117117: [FileCheck] Allow literal '['s before "[[var...]]"

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 12 07:22:10 PST 2022


foad created this revision.
Herald added subscribers: thopre, atanasyan, jrtc27, hiraditya, tpr, sdardis.
foad requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Change FileCheck to accept patterns like "[[[var...]]" and treat the
excess open brackets at the start as literals.

This makes the patterns for matching assembler output with literal
brackets much cleaner. For example an AMDGPU pattern that used to be
written like:

  buffer_store_dwordx2 v{{\[}}[[LO]]:[[HI]]{{\]}}

can now be:

  buffer_store_dwordx2 v[[[LO]]:[[HI]]]

(Even before this patch the final close bracket did not need to be
wrapped in {{}}, but people tended to do it anyway for symmetry.)

This does not introduce any ambiguity since "[[" was always followed by
an identifier or '@' or '#', so "[[[" was always an error.

I've included a few test updates in this patch just for illustration and
testing. There are a couple of hundred tests that could be updated as a
follow up, mostly in test/CodeGen/.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D117117

Files:
  llvm/lib/FileCheck/FileCheck.cpp
  llvm/test/CodeGen/Mips/msa/3r-s.ll
  llvm/test/CodeGen/Mips/msa/basic_operations_float.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117117.399325.patch
Type: text/x-patch
Size: 4693 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220112/38d1c44a/attachment.bin>


More information about the llvm-commits mailing list