This is an archive of the discontinued LLVM Phabricator instance.

[RFC][Flang][driver] Try to support `flang -cc1as`
Needs ReviewPublic

Authored by sunshaoce on Feb 8 2023, 4:57 AM.

Details

Summary

Try to implment using flang -cc1as compile assembly files. Related patch (fc1as): https://reviews.llvm.org/D143478

Diff Detail

Event Timeline

sunshaoce created this revision.Feb 8 2023, 4:57 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptFeb 8 2023, 4:57 AM
sunshaoce requested review of this revision.Feb 8 2023, 4:57 AM
flang/tools/flang-driver/CMakeLists.txt
37–41

In general we are trying to limit or reduce the dependency on Clang. This will further increase the dependency. Can we share more code by moving the common portion to llvm/lib/Frontend?

clementval added inline comments.Feb 8 2023, 5:02 AM
flang/tools/flang-driver/CMakeLists.txt
37–41

+1

If this is all that's needed to have an integrated assembly in LLVM Flang, then this is good news and https://reviews.llvm.org/D143478 should be abandoned in favor of this approach. However, we need to find alternatives to increasing dependency on Clang.

flang/tools/flang-driver/CMakeLists.txt
37–41

+1

sunshaoce updated this revision to Diff 495831.Feb 8 2023, 6:45 AM

Simplified code

flang/tools/flang-driver/CMakeLists.txt
37–41

I think this may need to deal with the TextDiagnosticPrinter part. But I don't have a good way to handle it yet.

@sunshaoce, @awarzynski are there remaining issues with this patch? We currently needs this for our testing.

@sunshaoce, @awarzynski are there remaining issues with this patch?

"However, we need to find alternatives to increasing dependency on Clang." ;-)

We should avoid code duplication, so making sure that flang-new -fc1as == clang -cc1as is a good thing. But the extra dependency on clangFrontend would be a step away from making Flang independent of Clang.

We currently needs this for our testing.

Presumably, this is only needed for compiling assembly files? Why not use clang --cc1as instead? At least as an interim solution.

kiranchandramohan added inline comments.
flang/tools/flang-driver/CMakeLists.txt
37–41

@DavidTruby Can you have a quick look whether we can refactor the case for TextDiagnosticPrinter?

clementval resigned from this revision.Jul 13 2023, 1:46 PM
skatrak added a subscriber: skatrak.Thu, Dec 7, 6:04 AM

Are there any updates on this patch? We're wondering if an approach has been agreed upon, and whether this is still being worked on or if maybe we can help move this along. Thanks!