This revision was automatically updated to reflect the committed changes. Closed by commit rG155abd0678ab: [PowerPC] Emit warn_deprecated_lax_vec_conv_all warning only for PPC (authored by maryammo).
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D145506/new/ https://reviews.llvm.org/D145506 Files: clang/lib/Sema/SemaExpr.cpp clang/lib/Sema/SemaOverload.cpp clang/test/CodeGen/SystemZ/zvector.c clang/test/CodeGen/SystemZ/zvector2.c Index: clang/test/CodeGen/SystemZ/zvector2.c =================================================================== --- clang/test/CodeGen/SystemZ/zvector2.c +++ clang/test/CodeGen/SystemZ/zvector2.c @@ -1,5 +1,5 @@ // RUN: %clang_cc1 -triple s390x-linux-gnu -target-cpu z14 -fzvector \ -// RUN: -O -emit-llvm -o - -W -Wall -Werror -Wno-error=deprecate-lax-vec-conv-all %s | FileCheck %s +// RUN: -O -emit-llvm -o - -W -Wall -Werror %s | FileCheck %s volatile vector float ff, ff2; volatile vector bool int bi; Index: clang/test/CodeGen/SystemZ/zvector.c =================================================================== --- clang/test/CodeGen/SystemZ/zvector.c +++ clang/test/CodeGen/SystemZ/zvector.c @@ -1,5 +1,5 @@ // RUN: %clang_cc1 -triple s390x-linux-gnu -target-cpu z13 -fzvector \ -// RUN: -emit-llvm -o - -W -Wall -Werror -Wno-error=deprecate-lax-vec-conv-all \ +// RUN: -emit-llvm -o - -W -Wall -Werror \ // RUN: %s | opt -S -passes=mem2reg | FileCheck %s volatile vector signed char sc, sc2; Index: clang/lib/Sema/SemaOverload.cpp =================================================================== --- clang/lib/Sema/SemaOverload.cpp +++ clang/lib/Sema/SemaOverload.cpp @@ -1775,7 +1775,8 @@ if (S.Context.areCompatibleVectorTypes(FromType, ToType) || (S.isLaxVectorConversion(FromType, ToType) && !ToType->hasAttr(attr::ArmMveStrictPolymorphism))) { - if (S.isLaxVectorConversion(FromType, ToType) && + if (S.getASTContext().getTargetInfo().getTriple().isPPC() && + S.isLaxVectorConversion(FromType, ToType) && S.anyAltivecTypes(FromType, ToType) && !S.Context.areCompatibleVectorTypes(FromType, ToType) && !InOverloadResolution && !CStyle) { Index: clang/lib/Sema/SemaExpr.cpp =================================================================== --- clang/lib/Sema/SemaExpr.cpp +++ clang/lib/Sema/SemaExpr.cpp @@ -9856,7 +9856,8 @@ // 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. - if (anyAltivecTypes(RHSType, LHSType) && + if (Context.getTargetInfo().getTriple().isPPC() && + anyAltivecTypes(RHSType, LHSType) && !Context.areCompatibleVectorTypes(RHSType, LHSType)) Diag(RHS.get()->getExprLoc(), diag::warn_deprecated_lax_vec_conv_all) << RHSType << LHSType; @@ -9873,9 +9874,10 @@ const VectorType *VecType = RHSType->getAs<VectorType>(); if (VecType && VecType->getNumElements() == 1 && isLaxVectorConversion(RHSType, LHSType)) { - if (VecType->getVectorKind() == VectorType::AltiVecVector || - VecType->getVectorKind() == VectorType::AltiVecBool || - VecType->getVectorKind() == VectorType::AltiVecPixel) + if (Context.getTargetInfo().getTriple().isPPC() && + (VecType->getVectorKind() == VectorType::AltiVecVector || + VecType->getVectorKind() == VectorType::AltiVecBool || + VecType->getVectorKind() == VectorType::AltiVecPixel)) Diag(RHS.get()->getExprLoc(), diag::warn_deprecated_lax_vec_conv_all) << RHSType << LHSType; ExprResult *VecExpr = &RHS; @@ -10836,7 +10838,8 @@ QualType OtherType = LHSVecType ? RHSType : LHSType; ExprResult *OtherExpr = LHSVecType ? &RHS : &LHS; if (isLaxVectorConversion(OtherType, VecType)) { - if (anyAltivecTypes(RHSType, LHSType) && + if (Context.getTargetInfo().getTriple().isPPC() && + anyAltivecTypes(RHSType, LHSType) && !Context.areCompatibleVectorTypes(RHSType, LHSType)) Diag(Loc, diag::warn_deprecated_lax_vec_conv_all) << RHSType << LHSType; // If we're allowing lax vector conversions, only the total (data) size
Index: clang/test/CodeGen/SystemZ/zvector2.c =================================================================== --- clang/test/CodeGen/SystemZ/zvector2.c +++ clang/test/CodeGen/SystemZ/zvector2.c @@ -1,5 +1,5 @@ // RUN: %clang_cc1 -triple s390x-linux-gnu -target-cpu z14 -fzvector \ -// RUN: -O -emit-llvm -o - -W -Wall -Werror -Wno-error=deprecate-lax-vec-conv-all %s | FileCheck %s +// RUN: -O -emit-llvm -o - -W -Wall -Werror %s | FileCheck %s volatile vector float ff, ff2; volatile vector bool int bi; Index: clang/test/CodeGen/SystemZ/zvector.c =================================================================== --- clang/test/CodeGen/SystemZ/zvector.c +++ clang/test/CodeGen/SystemZ/zvector.c @@ -1,5 +1,5 @@ // RUN: %clang_cc1 -triple s390x-linux-gnu -target-cpu z13 -fzvector \ -// RUN: -emit-llvm -o - -W -Wall -Werror -Wno-error=deprecate-lax-vec-conv-all \ +// RUN: -emit-llvm -o - -W -Wall -Werror \ // RUN: %s | opt -S -passes=mem2reg | FileCheck %s volatile vector signed char sc, sc2; Index: clang/lib/Sema/SemaOverload.cpp =================================================================== --- clang/lib/Sema/SemaOverload.cpp +++ clang/lib/Sema/SemaOverload.cpp @@ -1775,7 +1775,8 @@ if (S.Context.areCompatibleVectorTypes(FromType, ToType) || (S.isLaxVectorConversion(FromType, ToType) && !ToType->hasAttr(attr::ArmMveStrictPolymorphism))) { - if (S.isLaxVectorConversion(FromType, ToType) && + if (S.getASTContext().getTargetInfo().getTriple().isPPC() && + S.isLaxVectorConversion(FromType, ToType) && S.anyAltivecTypes(FromType, ToType) && !S.Context.areCompatibleVectorTypes(FromType, ToType) && !InOverloadResolution && !CStyle) { Index: clang/lib/Sema/SemaExpr.cpp =================================================================== --- clang/lib/Sema/SemaExpr.cpp +++ clang/lib/Sema/SemaExpr.cpp @@ -9856,7 +9856,8 @@ // 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. - if (anyAltivecTypes(RHSType, LHSType) && + if (Context.getTargetInfo().getTriple().isPPC() && + anyAltivecTypes(RHSType, LHSType) && !Context.areCompatibleVectorTypes(RHSType, LHSType)) Diag(RHS.get()->getExprLoc(), diag::warn_deprecated_lax_vec_conv_all) << RHSType << LHSType; @@ -9873,9 +9874,10 @@ const VectorType *VecType = RHSType->getAs<VectorType>(); if (VecType && VecType->getNumElements() == 1 && isLaxVectorConversion(RHSType, LHSType)) { - if (VecType->getVectorKind() == VectorType::AltiVecVector || - VecType->getVectorKind() == VectorType::AltiVecBool || - VecType->getVectorKind() == VectorType::AltiVecPixel) + if (Context.getTargetInfo().getTriple().isPPC() && + (VecType->getVectorKind() == VectorType::AltiVecVector || + VecType->getVectorKind() == VectorType::AltiVecBool || + VecType->getVectorKind() == VectorType::AltiVecPixel)) Diag(RHS.get()->getExprLoc(), diag::warn_deprecated_lax_vec_conv_all) << RHSType << LHSType; ExprResult *VecExpr = &RHS; @@ -10836,7 +10838,8 @@ QualType OtherType = LHSVecType ? RHSType : LHSType; ExprResult *OtherExpr = LHSVecType ? &RHS : &LHS; if (isLaxVectorConversion(OtherType, VecType)) { - if (anyAltivecTypes(RHSType, LHSType) && + if (Context.getTargetInfo().getTriple().isPPC() && + anyAltivecTypes(RHSType, LHSType) && !Context.areCompatibleVectorTypes(RHSType, LHSType)) Diag(Loc, diag::warn_deprecated_lax_vec_conv_all) << RHSType << LHSType; // If we're allowing lax vector conversions, only the total (data) size
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits