This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Fix powerpcspe subtarget enablement in llvm backend
ClosedPublic

Authored by jhibbits on Jan 13 2020, 6:09 PM.

Details

Summary

As currently written, -target powerpcspe will enable SPE regardless of
disabling the feature later on in the command line. Instead, change
this to just set a default CPU to 'e500' instead of a generic CPU.

Diff Detail

Event Timeline

jhibbits created this revision.Jan 13 2020, 6:09 PM
MaskRay added inline comments.Jan 13 2020, 9:00 PM
llvm/lib/Target/PowerPC/PPCSubtarget.cpp
129–132

Why is this change needed?

jhibbits marked an inline comment as done.Jan 14 2020, 7:41 AM
jhibbits added inline comments.
llvm/lib/Target/PowerPC/PPCSubtarget.cpp
129–132

It sets the default CPU to e500, which allows doing 'llc -mtarget=powerpcspe foo.ll' instead of needing to specify -mattr=+spe as well, or -mcpu=e500, in order to get the SPE. It's the only way I found to default enable it on the subarch basis. If it's better to just make the SubArch a hint to clang, and remove this, that's fine as well, it just looks a little silly to see 'llc -mtarget=powerpcspe -mattr=+spe ...'.

MaskRay accepted this revision.Jan 14 2020, 10:54 AM

Clang 10.0.0 branch date is approaching. I cannot think of a better solution right now. Let's do this.

This revision is now accepted and ready to land.Jan 14 2020, 10:54 AM
This revision was automatically updated to reflect the committed changes.