This is an archive of the discontinued LLVM Phabricator instance.

[DragonEgg] Initial migration to GCC v8.x and LLVM v6.x
AbandonedPublic

Authored by xiangzhai on Jul 20 2017, 2:33 AM.

Details

Summary

Dear LLVM developers,

I am migrating DragonEgg to GCC v8.x and LLVM v6.x just for fun and learn.

GCC API had been changed a lot, for example no PLUGIN_REGISTER_GGC_CACHES any more so I need to be familiar with GCC v4.x (because DragonEgg works better with GCC v4.6), v5.x and v6.x for learning how to migrate from GCC v4.x to GCC v6.x and even v8.x git master.

LLVM changed a lot too, for example: no getGlobalContext any more after rL266379 and I can git log to compare with release_33 branch.

Here is the migration's issues I hope fix all of them :) please review my patch, and give me some hints about migration or something else, thanks a lot!

Regards,
Leslie Zhai

Diff Detail

Repository
rL LLVM

Event Timeline

xiangzhai created this revision.Jul 20 2017, 2:33 AM
xiangzhai updated this revision to Diff 107645.Jul 21 2017, 2:26 AM

[Migrate config/i386/i386.c to ABIHack](https://github.com/xiangzhai/dragonegg/issues/15) for GCC v6.3 X86 Target.

xiangzhai updated this revision to Diff 107866.Jul 24 2017, 2:05 AM

Migrated more to fix issues .

xiangzhai updated this revision to Diff 108015.Jul 25 2017, 1:14 AM

Migrate struct gcc_target md_asm_clobbers to md_asm_adjust.

xiangzhai updated this revision to Diff 110125.Aug 7 2017, 7:22 PM
xiangzhai retitled this revision from [DragonEgg] Initial migration to GCC v6.3 and LLVM v3.9 to [DragonEgg] Initial migration to GCC v8.x and LLVM v6.x.
xiangzhai edited the summary of this revision. (Show Details)

Migrate to GCC v8.x and LLVM v6.x

What's your particular need for this project? If just for fan, this might not be worth to maintain.

What's your particular need for this project? If just for fan, this might not be worth to maintain.

There is ongoing effort to upstream Fortran support to LLVM. If I'm not wrong only Ada is still missing.
It might be better to get native Ada frontend and DragonEgg can be abandoned.

What's your particular need for this project? If just for fan, this might not be worth to maintain.

There is ongoing effort to upstream Fortran support to LLVM.

For reference: https://github.com/flang-compiler/flang

What's your particular need for this project? If just for fan, this might not be worth to maintain.

There is ongoing effort to upstream Fortran support to LLVM.

For reference: https://github.com/flang-compiler/flang

Hi Leslie,
If you focused your efforts on trying to get flang integrated with top of trunk LLVM this would be incredibly helpful to the community. :D

Hi Kamil,

What's your particular need for this project? If just for fan, this might not be worth to maintain.

but also for learning and I am stuck at GCC rtl_opt_pass migration.

It might be better to get native Ada frontend.

I will try.

Hi Chad,

Thanks for your kind response!

If you focused your efforts on trying to get flang integrated with top of trunk LLVM this would be incredibly helpful to the community.

I will study about flang, then try to contribute.

Regards,
Leslie Zhai

wmi added a subscriber: wmi.Aug 9 2017, 5:13 PM

Hi Chad,

Hi Leslie,
If you focused your efforts on trying to get flang integrated with top of trunk LLVM this would be incredibly helpful to the community. :D

Please review my patch https://github.com/flang-compiler/clang/pull/28 and give me some suggestion, I will update the patch, thanks a lot!

Regards,
Leslie Zhai

What's your particular need for this project? If just for fan, this might not be worth to maintain.

There is ongoing effort to upstream Fortran support to LLVM.

For reference: https://github.com/flang-compiler/flang

Hi Leslie,
If you focused your efforts on trying to get flang integrated with top of trunk LLVM this would be incredibly helpful to the community. :D

Using DragonEgg was the lesser evil in the past and it almost stopped serving a useful purpose.

Hi Kamil,

What's your particular need for this project? If just for fan, this might not be worth to maintain.

but also for learning and I am stuck at GCC rtl_opt_pass migration.

It might be better to get native Ada frontend.

I will try.

Hi Chad,

Thanks for your kind response!

If you focused your efforts on trying to get flang integrated with top of trunk LLVM this would be incredibly helpful to the community.

I will study about flang, then try to contribute.

Regards,
Leslie Zhai

Hello,

Your contribution is welcome.. but my feeling is that DragonEgg was just an intermediate solution in the past for shortage of LLVM frontends in the past.
Lately it served little purpose and it was effectively obsoleted.

Hi Chad,

Hi Leslie,
If you focused your efforts on trying to get flang integrated with top of trunk LLVM this would be incredibly helpful to the community. :D

Please review my patch https://github.com/flang-compiler/clang/pull/28 and give me some suggestion, I will update the patch, thanks a lot!

Regards,
Leslie Zhai

Great work! I'm looking forward to get it reviewed and merged.

Hi Kamil,

Great work! I'm looking forward to get it reviewed and merged.

Thanks! please review it, I will update the patch as your suggestion.

Regards,
Leslie Zhai

xiangzhai updated this revision to Diff 111923.Aug 20 2017, 8:13 PM

Migrated to GCC v8.x (git-20170818) and LLVM v6.x (svn-r311142)

xiangzhai abandoned this revision.Oct 9 2017, 7:18 PM

What's your particular need for this project? If just for fan, this might not be worth to maintain.

Independent of Xiang Leslie ZHAI's interest in learning & fun, the Ada community actually does have a “particular need for this project”, because GCC has been discontinued by Apple as a valid toolchain for developing iOS apps (or more specifically, on-iDevice debugging, not on the simulator), there is currently no hope of utilizing Ada in iOS development without DragonEgg.

There is ongoing effort to upstream Fortran support to LLVM. If I'm not wrong only Ada is still missing.
It might be better to get native Ada frontend and DragonEgg can be abandoned.

Does anyone in this community know of an extant (or even in-formation/forthcoming/potential) effort to “get native Ada frontend” with an LLVM backend (other than DragonEgg)?

Hi Dan'l,

Thanks for your mention!

What's your particular need for this project? If just for fan, this might not be worth to maintain.

Independent of Xiang Leslie ZHAI's interest in learning & fun, the Ada community actually does have a “particular need for this project”, because GCC has been discontinued by Apple as a valid toolchain for developing iOS apps (or more specifically, on-iDevice debugging, not on the simulator), there is currently no hope of utilizing Ada in iOS development without DragonEgg.

DragonEgg is my academy research project, it is full of funny and learning, and it is just able to work: GCC FrontEnd -> GIMPLE -> LLVM IR, but LLVM IR -> MC failed to work https://github.com/xiangzhai/dragonegg/issues/31 Unfortunately DragonEgg has been deprecated by upstream, there is no introduction any more in the index page of LLVM's website, so it is better to find the alternative solution as plan B https://github.com/epiqc/ScaffCC it is also able to launch ada-llvm project from FrontEnd to BackEnd :)

There is ongoing effort to upstream Fortran support to LLVM. If I'm not wrong only Ada is still missing.
It might be better to get native Ada frontend and DragonEgg can be abandoned.

Does anyone in this community know of an extant (or even in-formation/forthcoming/potential) effort to “get native Ada frontend” with an LLVM backend (other than DragonEgg)?

Just like quantum computing based on LLVM

src/mips/Target.cpp