This is an archive of the discontinued LLVM Phabricator instance.

[Clang] Add support for armv6k subtarget
ClosedPublic

Authored by tinti on Mar 6 2015, 2:31 PM.

Details

Summary

Add support for ARMV6K subtarget variant which is another layer between ARMV6
and ARMV6T2.

Diff Detail

Event Timeline

tinti updated this revision to Diff 21399.Mar 6 2015, 2:31 PM
tinti retitled this revision from to Add support for armv6k subtarget.
tinti updated this object.
tinti edited the test plan for this revision. (Show Details)
tinti added reviewers: rengolin, t.p.northover, compnerd.
tinti added subscribers: behanw, mcharleb, Unknown Object (MLST) and 2 others.
rengolin removed subscribers: Unknown Object (MLST), Unknown Object (MLST).Mar 7 2015, 5:45 AM
rengolin edited edge metadata.Mar 7 2015, 5:49 AM

You don't seem to be dealing with v6Z or v6KZ at all, but LLVM does and your tests do, too. Shouldn't you make sure the arch/cpu relationships maintained in LLVM to be the same here?

lib/Driver/ToolChains.cpp
113 ↗(On Diff #21399)

Isn't there a default to keep the same name?

tinti added a comment.Mar 7 2015, 7:57 PM

You don't seem to be dealing with v6Z or v6KZ at all, but LLVM does and your tests do, too. Shouldn't you make sure the arch/cpu relationships maintained in LLVM to be the same here?

I am not dealing with v6Z and v6KZ indeed. But there are several tests that are marked with FIXME instead of RUN.

Before this patches the backend was only dealing with v6, v6m and v6t2. There was references for v6Z and v6KZ but I don't think they were being used.
Now it deals with v6k plus all the previous it was dealing before.

That is why I am caring more about v6k.

Besides I took care to keep the same processor subtarget mapping on LLVM and Clang as we can check in LLVM:lib/Support/Triple.cpp and CLANG:lib/Basic/Targets.cpp and CLANG:lib/Driver/ToolChains.cpp

The only thing I did not like was the netbsd triple changing from armv6 to armv6k but this is expected since arm1176jzf-s moved from v6 to v6k and is the default netbsd subtarget for EABIHF as Renato and I discussed.

lib/Driver/ToolChains.cpp
113 ↗(On Diff #21399)

I will test.

But since there was an armv6m -> armv6m right below I believed it was needed.

rengolin added inline comments.Mar 8 2015, 10:44 AM
lib/Basic/Targets.cpp
4181

The problem about ARMv6KZ is here. Was this ever used? I think not. Can we get rid of it for a more correct option, I think so. Anyone disagree?

tinti added inline comments.Mar 14 2015, 1:14 PM
lib/Basic/Targets.cpp
4181

I would vote to keep and only map it for ARMv6K unless one can guarantee that this is absolutely internal and do not go to external tools or libraries.

lib/Driver/ToolChains.cpp
113 ↗(On Diff #21399)

As Tim said. In fact this is Mach specific we do not need to change none of the lines in lib/Driver/ToolChains.cpp. This file is weird.

tinti updated this revision to Diff 21993.Mar 14 2015, 3:29 PM
tinti edited edge metadata.

Remove Mach related changes. With this it is needed to modify some triples for Darwin.

rengolin accepted this revision.Mar 15 2015, 2:26 PM
rengolin edited edge metadata.

LGTM, Tim?

This revision is now accepted and ready to land.Mar 15 2015, 2:26 PM
tinti retitled this revision from Add support for armv6k subtarget to [Clang] Add support for armv6k subtarget.Mar 15 2015, 2:49 PM
tinti edited edge metadata.
tinti added a comment.Mar 15 2015, 2:56 PM

Hi,

Could you check Clang patch also?

http://reviews.llvm.org/D8126 <- LLVM patch [OK]
http://reviews.llvm.org/D8127 <- Clang patch [NEEDS REVIEW]

I chose terrible naming options for this patch set.
Since they are the same I believe I am getting people confuse.

Regards,
Tinti

t.p.northover accepted this revision.Mar 16 2015, 7:55 AM
t.p.northover edited edge metadata.

I think these changes are OK.

Tim.

compnerd accepted this revision.Mar 16 2015, 7:31 PM
compnerd edited edge metadata.
rengolin closed this revision.Mar 17 2015, 4:58 AM

Thanks Vinicius, r232469.