[all-commits] [llvm/llvm-project] 71d545: [ARM, MVE] Use the new Tablegen `defvar` and `if` s...

Simon Tatham via All-commits all-commits at lists.llvm.org
Tue Jan 14 04:08:23 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 71d5454b377239213874a0d762860e6a3e60bf54
      https://github.com/llvm/llvm-project/commit/71d5454b377239213874a0d762860e6a3e60bf54
  Author: Simon Tatham <simon.tatham at arm.com>
  Date:   2020-01-14 (Tue, 14 Jan 2020)

  Changed paths:
    M clang/include/clang/Basic/arm_mve.td
    M llvm/lib/Target/ARM/ARMInstrMVE.td

  Log Message:
  -----------
  [ARM,MVE] Use the new Tablegen `defvar` and `if` statements.

Summary:
This cleans up a lot of ugly `foreach` bodges that I've been using to
work around the lack of those two language features. Now they both
exist, I can make then all into something more legible!

In particular, in the common pattern in `ARMInstrMVE.td` where a
multiclass defines an `Instruction` instance plus one or more `Pat` that
select it, I've used a `defvar` to wrap `!cast<Instruction>(NAME)` so
that the patterns themselves become a little more legible.

Replacing a `foreach` with a `defvar` removes a level of block
structure, so several pieces of code have their indentation changed by
this patch. Best viewed with whitespace ignored.

NFC: the output of `llvm-tblgen -print-records` on the two affected
Tablegen sources is exactly identical before and after this change, so
there should be no effect at all on any of the other generated files.

Reviewers: MarkMurrayARM, miyuki

Reviewed By: MarkMurrayARM

Subscribers: kristof.beyls, hiraditya, dmgreen, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D72690




More information about the All-commits mailing list