This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Diagnose invalid combination with Altivec, VSX and soft-float
Needs ReviewPublic

Authored by nemanjai on May 24 2022, 7:24 AM.

Details

Reviewers
ltertan
Group Reviewers
Restricted Project
Summary

The current behaviour with these three options is quite undesirable:
-mno-altivec -mvsx allows VSX to override no Altivec, thereby turning on both
-msoft-float -maltivec causes a crash if an actual Altivec instruction is required because soft float turns of Altivec
-msoft-float -mvsx is also accepted with both Altivec and VSX turned off (potentially causing crashes as above)

This patch diagnoses these impossible combinations in the driver so the user does not end up with surprises in terms of their options being ignored or silently overridden.

Inspired by https://github.com/llvm/llvm-project/issues/55556

Diff Detail

Event Timeline

nemanjai created this revision.May 24 2022, 7:24 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 24 2022, 7:24 AM
nemanjai requested review of this revision.May 24 2022, 7:24 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 24 2022, 7:24 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

Hi Nemanja,

I just realized I only had a personal account on llvm.org. Would you be
able to remove me from that review and add laurentiu.tertan@windriver.com
instead?

Thanks,
Laurentiu

nemanjai edited reviewers, added: ltertan; removed: Laurentiu.May 24 2022, 4:39 PM
ltertan added inline comments.May 24 2022, 5:19 PM
clang/lib/Basic/Targets/PPC.cpp
455

Do we also need to return from here?

461

Do we also need to return from here?

qiucf added a subscriber: qiucf.May 25 2022, 10:42 PM
qiucf added inline comments.
clang/lib/Basic/Targets/PPC.cpp
450

Comments in reverse order?

amyk added a subscriber: amyk.May 26 2022, 6:53 AM
amyk added inline comments.
clang/lib/Basic/Targets/PPC.cpp
452

Do we also need a case to represent -msoft-float and -mvsx?