This is an archive of the discontinued LLVM Phabricator instance.

[mlir][llvm] Delete LLVMIntrinsicGen.cpp.
AbandonedPublic

Authored by gysit on Mar 1 2023, 12:09 AM.

Details

Summary

LLVMIntrinsicGen.cpp translates the LLVM intrinsic definitions to MLIR
intrinsic definitions. This automatic translations does not seem to
be in use anymore. Instead, intrinsics are defined manually in
LLVMIntrinsicOps.td.

This revision deletes LLVMIntrinsicGen.cpp and the associated test.

Depends on D144965

Diff Detail

Event Timeline

gysit created this revision.Mar 1 2023, 12:09 AM
Herald added a project: Restricted Project. · View Herald Transcript
gysit requested review of this revision.Mar 1 2023, 12:09 AM

Let me know if this is still used somewhere? The upstream intrinsic definitions have quite a bit of additional structuring (e.g. base classes) by now and I do not think they can be generated from LLVM directly anymore.

Is this compatible with dowstream targets defining their own intrinsics outside of Intrinics.td (in LLVM)?

gysit added a comment.Mar 1 2023, 10:27 AM

Is this compatible with dowstream targets defining their own intrinsics outside of Intrinics.td (in LLVM)?

@hgreving Downstream projects can copy the script and continue using it? Admittedly, I do not have full context but I am happy to hear why copying is not possible?

At the moment, the script is unused upstream and detached from everything else. In particular, the script is not used to generate any intrinsics and therefore the intrinsics cannot be compiled and tested (export, import, roundtrip). One way forward may be to add a use case for the script, e.g. for one of the upstream targets (ArmNEON, ArmSVE, AMX, etc), and then implement the aforementioned tests. Otherwise, I favor moving the script to the downstream project where it can be properly maintained and tested.

Let me know if you have a good upstream use case or plan to work on one!

ftynse requested changes to this revision.Mar 1 2023, 11:36 AM

I don't see why this needs to be deleted. It was used to generate the initial ODS for some intrinsics and is still useful for adding new target-specific ones. It is not used in the build process because the complexity of adding a stage to the build process does not justify it.

This revision now requires changes to proceed.Mar 1 2023, 11:36 AM

Note that many other tools are not directly "used" upstream, mlir-reduce, mlir-parser-fuzzer, etc. They are nevertheless useless.

gysit abandoned this revision.Mar 1 2023, 12:39 PM

Ok, I did not think of the additional stage needed to test this. It would have been great to have such a test since the tool needs to be adapted if the intrinsic base class changes.

We can have test for this, but we probably don't want this to be on the _main_ build path.

gysit added a comment.Mar 1 2023, 12:45 PM

I think something that can be called manually would also be great. E.g. to somehow test if the changes I did in the base revision really work. That only helps if one is aware of the tool though.

OpDSL has such an additional build step (the yaml is translated to tablegen during the normal build if I remember correctly). It is very complex though and very much overkill for this I guess.

mlir/test/mlir-tblgen/llvm-intrinsics.td