This is the first patch to incrementally add an MC layer for LoongArch to LLVM.
This patch also adds unit testcases for these new triples.
RFC for adding this new backend:
https://lists.llvm.org/pipermail/llvm-dev/2021-December/154371.html
Paths
| Differential D115857
[LoongArch 1/6] Add triples loongarch{32,64} for the upcoming LoongArch target ClosedPublic Authored by SixWeining on Dec 16 2021, 12:41 AM.
Details Summary This is the first patch to incrementally add an MC layer for LoongArch to LLVM. RFC for adding this new backend:
Diff Detail
Event TimelineSixWeining retitled this revision from [LoongArch 1/n] Add triples loongarch{32,64} for the upcoming LoongArch target to [LoongArch 1/5] Add triples loongarch{32,64} for the upcoming LoongArch target.Dec 17 2021, 7:55 PM Comment Actions Other than the formatting hints, this looks ok to me. I'd prefer to add the CODE_OWNERS and CompilerWriterInfo parts (from 3/5) here, otherwise "loongarch" will make no sense if people try to search for it during a bisect.
Comment Actions Address rengolin's comments.
Comment Actions Address comments from @rengolin that add the CODE_OWNERS and CompilerWriterInfo parts (from 3/5) here. SixWeining retitled this revision from [LoongArch 1/5] Add triples loongarch{32,64} for the upcoming LoongArch target to [LoongArch 1/6] Add triples loongarch{32,64} for the upcoming LoongArch target.Dec 22 2021, 5:03 PM Comment Actions
OK, I will name them all. Comment Actions As previously discussed, we might want to wait until the gcc port is merged, to avoid code churn regarding triple names here. Comment Actions
Those triples used in this patch are only for triple-parsing test and I think it doesn't affect triple definitions by gcc. We can even add some dummy triple test like this, right? T = Triple("loongarch64-unknown-darwin"); EXPECT_EQ(Triple::loongarch64, T.getArch()); EXPECT_EQ(Triple::UnknownVendor, T.getVendor()); EXPECT_EQ(Triple::Darwin, T.getOS()); EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment()); Comment Actions
Agreed. target.unknown.unknown should always work, regardless of what GCC does. Those tests only check if the target is valid, completely ignoring the rest, which given what this patch introduces (just the target), it's a fair test. Once GCC agrees on a set of triples, we can add them here again with a new patch. Comment Actions A gentle ping. Are there any futher comments? If no, could you accept the revision so that we can move on? Comment Actions Sorry, this fell out of my radar. Looks good to me, thanks for the hard work! I'll review the rest of the patches and will ping specific people if there's any unresolved issues. This revision is now accepted and ready to land.Feb 8 2022, 3:22 AM This revision was landed with ongoing or failed builds.Feb 10 2022, 2:23 AM Closed by commit rG42fd2bfc9065: [LoongArch 1/6] Add triples loongarch{32,64} for the upcoming LoongArch target (authored by SixWeining, committed by rengolin). · Explain Why This revision was automatically updated to reflect the committed changes. Comment Actions Than you @SixWeining, the 6 patches have been merged now. Be on the lookout for buildbot breakages (you'll get emails), but on a clean build on x86_64 + check-all I have seen no breakages. Also thanks to @xen0n @myhsu for the reviews. From now on, patches can come at any time, just make sure to announce the dependencies on each review, if they have one. Feel free to continue to copy the people that helped you in the initial submission, and see if you can help other new and experimental targets as well (ARC, CSKY, M68k, MSP430, SPIR-V), with your gained experience in this process. The more you review other people's patches, the more likely they'll review yours. Finally, welcome to the LLVM family! Comment Actions
@rengolin @xen0n @myhsu Thanks for your help to make it happen. We will try our best to review other people's patches. We believe that goodwill is our currency.
Revision Contents
Diff 407433 llvm/CODE_OWNERS.TXT
llvm/docs/CompilerWriterInfo.rst
llvm/include/llvm/ADT/Triple.h
llvm/lib/Support/Triple.cpp
llvm/unittests/ADT/TripleTest.cpp
|
clang-format is probably complaining here because it makes it clearer that the return is for the two cases above when you break into a new line. This is a reasonable change.