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 | ||
|---|---|---|
| 7572 | nit: Update to
| |
| clang/lib/Sema/SemaExpr.cpp | ||
| 7715 | Can we add some brief documentation for this function, like what is done for other functions in this file? | |
| 7716 | Can we add a message to this assert()? | |
| 7722 | nit: Can we put braces on the same line? (And same goes for 7727) | |
| 7735 | Can we add some brief documentation for this function, like what is done for other functions in this file? | |
| 7736 | Can we add a message to this assert? | |
| 7762 | Unnecessary change? | |
| clang/lib/Sema/SemaOverload.cpp | ||
| 13026 | Unnecessary change? | |
| clang/lib/Sema/SemaExpr.cpp | ||
|---|---|---|
| 7715 | sure | |
| 7716 | I followed what was done for other similar functions like : areMatrixTypesOfTheSameDimension | |
| 7716 | same as others | |
| 7722 | sure | |
| 7735 | sure | |
| 7736 | I followed what was done for other similar functions like : areMatrixTypesOfTheSameDimension | |
| clang/lib/Sema/SemaOverload.cpp | ||
| 13026 | yes | |
| clang/lib/Sema/SemaExpr.cpp | ||
|---|---|---|
| 7715 | 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 | ||
|---|---|---|
| 7715 | actually ignore that comment. I see why you need this now. | |
| 7723 | do we really need this check since we have an assert above? | |
| 7726 | I don't think the initialization above is needed. Can just inline it here. bool isSrcTyAltivec = (SrcVecKind == VectorType::AltiVecVector); | |
| 7728 | same. | |
| 7731 | same. | |
| clang/lib/Sema/SemaExpr.cpp | ||
|---|---|---|
| 7723 | 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 | ||
|---|---|---|
| 7723 | 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 | ||
|---|---|---|
| 7738 |
actually maybe this: areSameVectorElemTypes() | |
| clang/include/clang/Basic/DiagnosticSemaKinds.td | ||
|---|---|---|
| 7571–7573 | 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 | ||
| 7718 | The message does not need to mention the function name. Something like | |
| 7720 | Nit: naming convention. Here and elsewhere - please review all of your variable names. | |
| 7723–7727 | I think the whole thing can simply be: bool IsSrcTyAltivec = SrcTy->isVectorType() && (SrcTy->castAs<VectorType>()->getVectorKind() == VectorType::AltiVecVector); And similarly for the destination type. | |
| 7740 | Similarly to my comment above regarding the assert message. | |
| 9570 | 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. | |