[PATCH] D90532: [TableGen] [IR] Eliminate unnecessary recursive help class.
Paul C. Anagnostopoulos via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 4 12:03:34 PST 2020
Paul-C-Anagnostopoulos added a comment.
Let's see . . .
First, it's clear that we need a more powerful version of !subst. I'm starting to think about !replace. But that's a separate task. I've also got some ideas for bang operators to manipulate dags.
It looks like there are some !foreach that can be !listsplat:
// Instruction input/output arguments for the fragment.
list<NVPTXRegClass> ptx_regs = !foreach(tmp, regs, regclass);
The code you mentioned above:
dag PFOperands = !if(WithStride, (ops node:$src, node:$ldm), (ops node:$src));
// Build PatFrag that only matches particular address space.
PatFrag IntrFrag = PatFrag<PFOperands,
!foreach(tmp, PFOperands, !subst(ops, Intr, tmp)),
It's more efficient simply to assign the substituted dag first:
dag PFOperandsIntr = !if(WithStride, (Intr node:$src, node:$ldm), (Intr node:$src));
We can also use the new !sub operator to make things clearer.
These NVPTX TableGen files are quite clean already.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D90532/new/
https://reviews.llvm.org/D90532
More information about the llvm-commits
mailing list