This is an archive of the discontinued LLVM Phabricator instance.

[Xtensa 3/10] Add initial version of the Xtensa backend.
ClosedPublic

Authored by andreisfr on Jul 16 2019, 3:19 PM.

Details

Summary

Add Xtensa MCTargetDesc stub. Add XtensaTargetMachine and XtensaTargetInfo.
Modify llib/Target/LLVMBuild.txt. Now Xtensa target could be builded as EXPERIMENTAL.

Diff Detail

Event Timeline

andreisfr created this revision.Jul 16 2019, 3:19 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 16 2019, 3:19 PM
appcs added a reviewer: appcs.Jul 16 2019, 4:00 PM
appcs accepted this revision.Jul 16 2019, 4:02 PM
This revision is now accepted and ready to land.Jul 16 2019, 4:02 PM
aykevl added a subscriber: aykevl.Aug 17 2019, 5:25 PM

Quickly scanning this patch shows that it still uses the previous license. I think these need to be updated to the new Apache 2.0 license, see any file for the up-to-date file header.

andreisfr updated this revision to Diff 242203.Feb 3 2020, 3:03 PM

Patch is updated according to latest upstream version. Updated licenses.

andreisfr updated this revision to Diff 328694.Mar 5 2021, 4:43 PM

Patch is updated according to latest upstream version.

andreisfr updated this revision to Diff 329498.Mar 9 2021, 4:50 PM

Patch is updated according to LLVM upstream version and latest Xtensa backend version.

Patch is updated according to LLVM upstream version.

saugustine accepted this revision.Aug 19 2022, 1:27 PM
saugustine added a subscriber: saugustine.

This patch is straightforward and correct.

Herald added a project: Restricted Project. · View Herald TranscriptAug 19 2022, 1:27 PM
andreisfr updated this revision to Diff 455440.Aug 24 2022, 5:53 PM

Minor changes: corrected comment

phosek added a subscriber: phosek.Sep 1 2022, 11:43 AM

Hi everyone. Since this has been accepted for some time now, we're planning to commit this on Monday (December 16th). Please let us know if there is anything else we should address.

andreisfr updated this revision to Diff 484118.Dec 19 2022, 3:39 PM

Updated according to latest changes in upstream source code

MaskRay accepted this revision.Dec 19 2022, 4:11 PM
MaskRay added a subscriber: MaskRay.
MaskRay added inline comments.
llvm/lib/Target/Xtensa/XtensaTargetMachine.cpp
37

delete blank line. Just return the string.

llvm/lib/Target/Xtensa/XtensaTargetMachine.h
26

Other targets use a static local variable in llvm::get*Target but this seems fine.

29

include llvm/Target/TargetLoweringObjectFile.h for this

44

delete the comment. override self explains.

52

I think all patches use /* footer for header guards, which should all be fixed.

barannikov88 added inline comments.
llvm/lib/Target/Xtensa/MCTargetDesc/XtensaMCTargetDesc.cpp
14

Global initialization function should use LLVM_EXTERNAL_VISIBILITY.

llvm/lib/Target/Xtensa/TargetInfo/CMakeLists.txt
2

This shouldn't be necessary, these directory are already available for include directives.

llvm/lib/Target/Xtensa/TargetInfo/XtensaTargetInfo.cpp
18

LLVM_EXTERNAL_VISIBILITY

llvm/lib/Target/Xtensa/XtensaTargetMachine.cpp
28

LLVM_EXTERNAL_VISIBILITY

llvm/lib/Target/Xtensa/XtensaTargetMachine.h
24

Appears unused.

26

(Optional) This is gonna be used in multiple files, it might worth moving it ino a header file.

29

This should not be necessary as long as the destructor of XtensaTargetMachine is in *.cpp file. Forward declaration should be enough (and it is already forward declared in TargetMachine.h).

andreisfr updated this revision to Diff 485248.Dec 25 2022, 4:23 PM

Added fixes according to comments

andreisfr added inline comments.Dec 25 2022, 4:28 PM
llvm/lib/Target/Xtensa/MCTargetDesc/XtensaMCTargetDesc.cpp
14

fixed

llvm/lib/Target/Xtensa/TargetInfo/CMakeLists.txt
2

fixed

llvm/lib/Target/Xtensa/TargetInfo/XtensaTargetInfo.cpp
18

fixed

llvm/lib/Target/Xtensa/XtensaTargetMachine.cpp
28

fixed

37

fixed

llvm/lib/Target/Xtensa/XtensaTargetMachine.h
24

fixed

26

I added "llvm/lib/Target/Xtensa/TargetInfo/XtensaTargetInfo.h" file with "&getTheXtensaTarget();" function, this approach is similar to other backends.

44

fixed

52

fixed

barannikov88 accepted this revision.Dec 25 2022, 5:26 PM
This revision was landed with ongoing or failed builds.Dec 26 2022, 4:39 AM
This revision was automatically updated to reflect the committed changes.