[RFC] Request for upstream Tensilica Xtensa (ESP32) backend

Dear LLVM community,

We would like to request for including Xtensa backend to LLVM upstream. The first batch of patches is about to be accepted.

This thread is a continuation of the discussion [RFC] Tensilica Xtensa (ESP32) backend . According to @clattner recommendation we open separate topic for discussion about inclusion our work into the project.

Since last update we continued to work on the project and update patches in Phabricator. Currently Xtensa backend is ported on LLVM release 15.0.0.

The process of reviewing patches in Phabricator also significantly accelerated. An additional five patches have been approved, for a total of 8 out of 10 patches now approved. We are updating the last two patches according to the comments and will publish them soon. Many thanks to @Sterling-Augustine and all participants!

Since almost all patches have been approved, can we initiate the commit process for first patches? For example:
https://reviews.llvm.org/D64826
https://reviews.llvm.org/D64827
https://reviews.llvm.org/D64829
https://reviews.llvm.org/D64830

@clattner, @Sterling-Augustine, @tstellar may I ask your opinion about this?

Thanks to all!
Best regards,
Andrei Safronov

6 Likes

This has been discussed a number of times, and I believe all previous discussions were generally positive towards inclusion of this target into LLVM. The linked thread already discussed how the target meets the policy to accept a new experimental target, and that all seems fine.

So, I think at this point, you only need to wait for the entire 10-patch series to be approved. After the last 2 patches have been reviewed and approved, I think you should be good to go!

2 Likes

We’d be interested in building the Linux kernel port for Xtensa with clang!

1 Like

Thank you for your answer! We will focuse on last 2 patches.

1 Like

Dear LLVM community,

I would like to share new information, that is important for the review process of the Xtensa backend patches in Phabricator. There is now a publicly available summary of Xtensa ISA by Cadence: https://www.cadence.com/content/dam/cadence-www/global/en_US/documents/tools/ip/tensilica-ip/isa-summary.pdf . I hope this documentation makes the review process easier, and perhaps more members of the LLVM community can help with the review of patches.

Thanks to all!
Best regards,
Andrei Safronov

2 Likes

Nice! That’s great to hear, and I’m sure it’ll be helpful for quite a few people to have this full ISA document publicly available. (Also, the name of the document makes me laugh – “Instruction Set Architecture Summary” – at 700 pages, that’s the longest summary I’ve ever seen!)

3 Likes

Hi all,

We are about to commit the first 6 patches for Xtensa support. But after that we are blocked because there are still [Xtensa 7/10] Add Xtensa instruction printer and [Xtensa 9/10] Add basic support of Xtensa disassembler not approved.
Could you kindly take a look at them? We updated them according to the comments and waiting for either feedback on updates from @MaskRay and @Sterling-Augustine or patches approval.

The process seems to get stuck again. So this message is intended kick it off and claim that we are alive and continue Xtensa support in LLVM, but some thing are beyond our capabilities :slight_smile:

done

1 Like

Thanks, @Sterling-Augustine !

I wonder what is the status of the Xtensa backend in regard to completeness? As we work on capstone-autosync project, allowing generating the Capstone disassembly code from the TableGen files, would that cover all supported instructions (including optional extensions)?

20 patches pending moving things in the right direction, but things have seemingly stalled.

https://reviews.llvm.org/search/query/sZ1FWyMnpMKI/#R

1 Like

Currently we preparing update of these 20 patches according to reviewers comments, soon we will upload new versions to Phabricator.

4 Likes

When? It has been 6 months.

@BradSmith, thanks for the question. We plan to publish a patch update within a week.

Great! I only ask out of concern with long periods of no visible activity.