From 5d9f656bb75ed4d0b9eb628115edd785fc61473b Mon Sep 17 00:00:00 2001 From: Roman Lebedev Date: Wed, 10 Apr 2019 18:26:36 +0000 Subject: [TableGen] Introduce !listsplat 'binary' operator Summary: ``` ``!listsplat(a, size)`` A list value that contains the value ``a`` ``size`` times. Example: ``!listsplat(0, 2)`` results in ``[0, 0]``. ``` I plan to use this in X86ScheduleBdVer2.td for LoadRes handling. This is a little bit controversial because unlike every other binary operator the types aren't identical. Reviewers: stoklund, javed.absar, nhaehnle, craig.topper Reviewed By: javed.absar Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60367 llvm-svn: 358117 --- llvm/docs/TableGen/LangIntro.rst | 4 ++++ llvm/docs/TableGen/LangRef.rst | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'llvm/docs/TableGen') diff --git a/llvm/docs/TableGen/LangIntro.rst b/llvm/docs/TableGen/LangIntro.rst index 1a5f8b9ab30..45104ac78b8 100644 --- a/llvm/docs/TableGen/LangIntro.rst +++ b/llvm/docs/TableGen/LangIntro.rst @@ -189,6 +189,10 @@ supported include: More than two arguments are accepted with the result being the concatenation of all the lists given. +``!listsplat(a, size)`` + A list value that contains the value ``a`` ``size`` times. + Example: ``!listsplat(0, 2)`` results in ``[0, 0]``. + ``!strconcat(a, b, ...)`` A string value that is the result of concatenating the 'a' and 'b' strings. More than two arguments are accepted with the result being the concatenation diff --git a/llvm/docs/TableGen/LangRef.rst b/llvm/docs/TableGen/LangRef.rst index 59be6af3504..195106ac6d1 100644 --- a/llvm/docs/TableGen/LangRef.rst +++ b/llvm/docs/TableGen/LangRef.rst @@ -100,7 +100,7 @@ wide variety of meanings: :!or !empty !subst !foreach !strconcat :!cast !listconcat !size !foldl :!isa !dag !le !lt !ge - :!gt !ne !mul + :!gt !ne !mul !listsplat TableGen also has !cond operator that needs a slightly different syntax compared to other "bang operators": -- cgit v1.2.3