For now, I have introduced `llvm::tmp::getValueType(Rec)` as a copy from
`CodeGenTarget.cpp`. This will be removed in the near future, when
IntrinsicEmitter will not depend on MVT.
Differential Revision: https://reviews.llvm.org/D143844
Use the predicate condition instead of checkFeatures in *GenDAGISel.inc.
This makes the code similar to isel pattern predicates.
checkFeatures is still used by code created by SubtargetEmitter so
we can't remove the string. Backends need to be careful to keep
the string and predicates in sync, but I don't think that's a big issue.
I haven't measured it, but this should be a compile time improvement
for isel since we don't have to do any of the string processing that's
inside checkFeatures.
Reviewed By: kparzysz
Differential Revision: https://reviews.llvm.org/D146012
Replace references to `enumerate` results with either const lvalue
rerences or structured bindings. I did not use structured bindings
everywhere as it wasn't clear to me it would improve readability.
This is in preparation to the switch to `zip` semantics which won't
support non-const lvalue reference to elements:
https://reviews.llvm.org/D144503.
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D145987
After the work in a538d1f13a13 5351878ba196 372240dfe3d5, and
subsequently cleanup of all the in-tree targets, we can now delete the
support for positional operand matching!
This removes three options which could previously be set in a
Target's "InstrInfo" tablegen definition:
- useDeprecatedPositionallyEncodedOperands
- decodePositionallyEncodedOperands
- noNamedPositionallyEncodedOperands
(Also announced at https://discourse.llvm.org/t/tablegen-deleting-deprecated-positional-instruction-operand-matching-support/68524)
Differential Revision: https://reviews.llvm.org/D144210
This patch adds AArch64 CodeGen support such that the type can be passed
and returned to/from functions, and also adds support to use this type in
load/store operations and PHI nodes.
Reviewed By: paulwalker-arm
Differential Revision: https://reviews.llvm.org/D136862
Previously this message was only shown on the command line,
which is not much help if you can't see that.
(you've full screened the browser or you aren't running Jupyter
on the same machine)
Instead return the error as stderr which will get printed in
the notebook just like stderr from llvm-tblgen would.
I've refactored the message sending along the way. Note that
even when we do not send a stream, we still need to send the
status reply. The send_... methods will do that for you.
Reviewed By: jpienaar
Differential Revision: https://reviews.llvm.org/D142531
RFC to add a way to ignore COPY instructions when pattern-matching MIR in GISel.
- Add a new "GISelFlags" class to TableGen. Both `Pattern` and `PatFrags` defs can use it to alter matching behaviour.
- Flags start at zero and are scoped: the setter returns a `SaveAndRestore` object so that when the current scope ends, the flags are restored to their previous values. This allows child patterns to modify the flags without affecting the parent pattern.
- Child patterns always reuse the parent's pattern, but they can override its values. For more examples, see `GlobalISelEmitterFlags.td` tests.
- [AMDGPU] Use the IgnoreCopies flag in BFI patterns, which are known to be bothered by cross-regbank copies.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D136234
This tutorial uses the dump json option to write a backend for
SQL queries.
It is based on the work of Min-Yih Hsu:
* https://github.com/mshockwave/SQLGen
* https://www.youtube.com/watch?v=UP-LBRbvI_U
I hope that having the same concepts in 3 forms will allow people
to choose the style that fits them.
The main drawback here being that it's in Python. C++ can be used
in a notebook (https://github.com/jupyter-xeus/xeus-cling) but I
decided against it for a few reasons:
* Python is the default for Jupyter, no extra installs needed.
* Having the code in a second language may help people who
know one or the other.
* There is no upstream example of a JSON powered backend.
(and although we would be unlikely to accept one upstream,
I think it's a great option for quick development before
translating into C++)
Reviewed By: myhsu
Differential Revision: https://reviews.llvm.org/D142364
Just like the encoder directive for variable-length instructions, this
patch adds a new decoder directive to allow custom decoder function on
an operand.
Right now, due to the design of DecoderEmitter each operand can only
have a single custom decoder in a given instruction.
Differential Revision: https://reviews.llvm.org/D142079
This will allow an entry in the table to access data that is stored
immediately after the end of the table, by adding its opcode value
to its address.
Differential Revision: https://reviews.llvm.org/D142217
Combine the implicit uses and defs lists into a single list of uses
followed by defs. Instead of 0-terminating the list, store the number
of uses and defs. This avoids having to scan the whole list to find the
length and removes one pointer from MCInstrDesc (although it does not
get any smaller due to alignment issues).
Remove the old accessor methods getImplicitUses, getNumImplicitUses,
getImplicitDefs and getNumImplicitDefs as all clients are using the new
implicit_uses and implicit_defs.
Differential Revision: https://reviews.llvm.org/D142216
At each call to findFirstSet in this patch, the argument is known to
be nonzero, so we can safely switch to llvm::countr_zero, which will
become std::countr_zero once C++20 is available.
This changes the default mode to cache the code blocks we're
asked to compile until we see the new `%reset` magic to clear that cache.
This means that if you run several cells in sequence, at the end you're
compiling the code from all the cells at once.
This emulates what the ipython kernel does where it uses a persistent
interpreter state by default.
`%reset` will only be acted on when it's in the cell we're asked to run
(the newest code).
`%args` we will use the most recent value we have cached.
The example notebook has been updated to explain that.
Depends on D132378
Reviewed By: jpienaar
Differential Revision: https://reviews.llvm.org/D132646
This is based on the MLIR opt kernel:
https://github.com/llvm/llvm-project/tree/main/mlir/utils/jupyter
The inent of this is to enable experimentation and the creation
of interactive tutorials for the basics of tablegen.
Noteable changes from that:
* Removed the codemirror mode settings since those won't exist
for tablegen.
* Added "%args" "magic" to control arguments sent to llvm-tblgen.
(magics are directives, see
https://ipython.readthedocs.io/en/stable/interactive/magics.html)
For example the following:
```
%args --print-detailed-records
class Stuff {}
def water_bottle : Stuff {}
```
Produces:
```
DETAILED RECORDS for file -
-------------------- Global Variables (0) --------------------
-------------------- Classes (1) --------------------
Stuff |<stdin>:1|
Template args: (none)
Superclasses: (none)
Fields: (none)
-------------------- Records (1) --------------------
water_bottle |<stdin>:3|
Superclasses: Stuff
Fields: (none)
```
Reviewed By: jpienaar, awarzynski
Differential Revision: https://reviews.llvm.org/D132378
Using the correct feature name to detect 64bit this time. Previously,
I mistakenly compared the expected record name against a string inside
the record.
Instead of having separate feature bits, get information from march.
Invalid is now implied by empty march.
64-bit is now implied by march starting with "rv64".
Reviewed By: fpetrogalli
Differential Revision: https://reviews.llvm.org/D142230
So that we won't get redefinition errors if we use compressInst
and uncompressInst in the same file.
Reviewed By: asb
Differential Revision: https://reviews.llvm.org/D141896