This patch is the last prerequisite to switch the default behaviour to -fno-lax-vector-conversions in the future.
The first path ;D124093; fixed the altivec implicit castings.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Tune the logic to emit warning when at least one of the vectors is altivec one and overloading resolution is done
Some additional minor comments.
clang/include/clang/Basic/DiagnosticSemaKinds.td | ||
---|---|---|
7594 | nit: Update to
| |
clang/lib/Sema/SemaExpr.cpp | ||
7736 | Can we add some brief documentation for this function, like what is done for other functions in this file? | |
7737 | Can we add a message to this assert()? | |
7743 | nit: Can we put braces on the same line? (And same goes for 7727) | |
7756 | Can we add some brief documentation for this function, like what is done for other functions in this file? | |
7757 | Can we add a message to this assert? | |
7783 | Unnecessary change? | |
clang/lib/Sema/SemaOverload.cpp | ||
13052 | Unnecessary change? |
clang/lib/Sema/SemaExpr.cpp | ||
---|---|---|
7736 | sure | |
7737 | I followed what was done for other similar functions like : areMatrixTypesOfTheSameDimension | |
7737 | same as others | |
7743 | sure | |
7756 | sure | |
7757 | I followed what was done for other similar functions like : areMatrixTypesOfTheSameDimension | |
clang/lib/Sema/SemaOverload.cpp | ||
13052 | yes |
clang/lib/Sema/SemaExpr.cpp | ||
---|---|---|
7736 | I am not sure what you mean, can you please elaborate on that? |
LGTM, just a few nit that can be addressed on commit.
clang/lib/Sema/SemaExpr.cpp | ||
---|---|---|
7736 | actually ignore that comment. I see why you need this now. | |
7744 | do we really need this check since we have an assert above? | |
7747 | I don't think the initialization above is needed. Can just inline it here. bool isSrcTyAltivec = (SrcVecKind == VectorType::AltiVecVector); | |
7749 | same. | |
7752 | same. |
clang/lib/Sema/SemaExpr.cpp | ||
---|---|---|
7744 | Yes, without this check there is gonna be a compile time failure for cases where SrcTy is not vector but we wanna cast it to vector 'SrcTy->castAs<VectorType>()' |
clang/lib/Sema/SemaExpr.cpp | ||
---|---|---|
7744 | the assert checks of either of them is a vector but then we wanna check if at least one of them is altivec. |
clang/lib/Sema/SemaExpr.cpp | ||
---|---|---|
7759 |
actually maybe this: areSameVectorElemTypes() |
clang/include/clang/Basic/DiagnosticSemaKinds.td | ||
---|---|---|
7593–7595 | We should not mention the word bitcast in the message as it doesn't really mean anything to C/C++ developers not used to LLVM IR. Implicit conversion between vector types ('%0' and '%1') is deprecated. In the future, the behavior implied by '-fno-lax-vector-conversions' will be the default. | |
clang/lib/Sema/SemaExpr.cpp | ||
7739 | The message does not need to mention the function name. Something like | |
7741 | Nit: naming convention. Here and elsewhere - please review all of your variable names. | |
7744–7748 | I think the whole thing can simply be: bool IsSrcTyAltivec = SrcTy->isVectorType() && (SrcTy->castAs<VectorType>()->getVectorKind() == VectorType::AltiVecVector); And similarly for the destination type. | |
7761 | Similarly to my comment above regarding the assert message. | |
9585 | Please add a comment: // The default for lax vector conversions with Altivec vectors will // change, so if we are converting between vector types where // at least one is an Altivec vector, emit a warning. |