Page MenuHomePhabricator

[PowerPC] Disable vector types when not supported by subtarget features
ClosedPublic

Authored by lei on Sep 2 2021, 11:42 AM.

Details

Summary

Update clang to treat vector unsigned long long and friends as invalid
for AltiVec without VSX.

Reported in: https://bugs.llvm.org/show_bug.cgi?id=47782

Diff Detail

Event Timeline

lei created this revision.Sep 2 2021, 11:42 AM
lei requested review of this revision.Sep 2 2021, 11:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 2 2021, 11:42 AM
lei updated this revision to Diff 370349.Sep 2 2021, 11:55 AM

fix spelling in commit message.

lei edited the summary of this revision. (Show Details)Sep 2 2021, 11:56 AM
NeHuang added a subscriber: NeHuang.Sep 3 2021, 7:28 AM
NeHuang added inline comments.
clang/test/CodeGen/builtins-ppc-int128.c
5

nit: indentation

clang/test/Parser/altivec.c
104

Will this patch also impact vector double? If not, can we move #ifndef __VSX__ down below vector double v_d2;?

clang/test/Parser/cxx-altivec.cpp
104–105

same as above.

lei added inline comments.Sep 7 2021, 6:42 AM
clang/test/CodeGen/builtins-ppc-int128.c
5

thx. Will fix before comit.

clang/test/Parser/altivec.c
104

This patch doesn't, but this is needed here since I added RUN line to test behavior for when VSX is enabled. Note the test lines was not changed for vector double.

clang/test/Parser/cxx-altivec.cpp
104–105

needed due to new RUN line added.

It is not clear what this patch will do with vector [[un]signed] long. This is currently deprecated but still works - and we don't want it to work with no VSX.

clang/lib/Headers/altivec.h
8891

This file is huge and there is a lot of conditional compilation within it. Can you please add comments to terminating endif as to what it is terminating. Presumably this one here terminates __VSX__.

lei updated this revision to Diff 375360.Mon, Sep 27, 12:19 PM

Address review comments and add handling for vector long types without vsx.

nemanjai accepted this revision.Tue, Sep 28, 6:23 PM

LGTM.

This revision is now accepted and ready to land.Tue, Sep 28, 6:23 PM
amyk accepted this revision.Thu, Sep 30, 6:31 AM
amyk added a subscriber: amyk.

Overall LGTM.

clang/test/CodeGen/builtins-ppc-int128.c
8

nit: RUN line slightly too long.

lei updated this revision to Diff 376969.Mon, Oct 4, 11:49 AM

address line comment and update tc to reflect new behaviour.

This revision was landed with ongoing or failed builds.Mon, Oct 4, 12:16 PM
This revision was automatically updated to reflect the committed changes.