This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Include vector bool and pixel when emitting lax warning
ClosedPublic

Authored by maryammo on Feb 2 2023, 12:42 PM.

Details

Summary

This patch is to fix some missing lax-vector-conversion warnings including
cases that involve vector bool and vector pixel, also to fix the vector
compatibility check for the warnings.

Diff Detail

Event Timeline

maryammo created this revision.Feb 2 2023, 12:42 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 2 2023, 12:42 PM
maryammo requested review of this revision.Feb 2 2023, 12:42 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 2 2023, 12:42 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
amyk added inline comments.Feb 15 2023, 7:05 AM
clang/lib/Sema/SemaExpr.cpp
9845

Might be a silly question, but what does it mean to be a "compatible" vector type?

clang/test/CodeGen/SystemZ/zvector.c
1–3

Nit: I think this line is still over 80 characters.

amyk retitled this revision from PowerPC] Include vector bool and pixel when emitting lax warning to [PowerPC] Include vector bool and pixel when emitting lax warning.Feb 15 2023, 7:05 AM
kamaub added a reviewer: Restricted Project.Feb 15 2023, 8:21 AM
maryammo added inline comments.Feb 15 2023, 12:27 PM
clang/lib/Sema/SemaExpr.cpp
9845

areCompatibleVectorTypes is defined in lib/AST/ASTContext.cpp, it considers all vectors with the same unqualified types to be compatible, also vectors with the same number of elements where neither of them is vector bool/pixel or some specific SVE types are compatible.

This revision was not accepted when it landed; it landed in state Needs Review.Feb 21 2023, 2:26 PM
This revision was automatically updated to reflect the committed changes.
kamaub added a subscriber: kamaub.Feb 22 2023, 8:50 AM

We may also need an associated test case for the changed behaviour for using areCompatibleVectorTypes() instead of areSameVectorElemTypes().
The test coverage should display when warnings are emitted now that we account for vector bool, vector pixel and type qualifiers.

clang/lib/Sema/SemaExpr.cpp
9861

Is there test coverage for these addition to the if condition?