This revision was automatically updated to reflect the committed changes. Closed by commit rGef3678cfeea6: [SVE] Update EmitSVEPredicateCast to take a ScalableVectorType (authored by ctetreau).
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78958/new/ https://reviews.llvm.org/D78958 Files: clang/lib/CodeGen/CGBuiltin.cpp clang/lib/CodeGen/CodeGenFunction.h Index: clang/lib/CodeGen/CodeGenFunction.h =================================================================== --- clang/lib/CodeGen/CodeGenFunction.h +++ clang/lib/CodeGen/CodeGenFunction.h @@ -3919,7 +3919,8 @@ llvm::ScalableVectorType *getSVEType(const SVETypeFlags &TypeFlags); llvm::ScalableVectorType *getSVEPredType(SVETypeFlags TypeFlags); llvm::Value *EmitSVEDupX(llvm::Value *Scalar); - llvm::Value *EmitSVEPredicateCast(llvm::Value *Pred, llvm::VectorType *VTy); + llvm::Value *EmitSVEPredicateCast(llvm::Value *Pred, + llvm::ScalableVectorType *VTy); llvm::Value *EmitSVEGatherLoad(SVETypeFlags TypeFlags, llvm::SmallVectorImpl<llvm::Value *> &Ops, unsigned IntID); Index: clang/lib/CodeGen/CGBuiltin.cpp =================================================================== --- clang/lib/CodeGen/CGBuiltin.cpp +++ clang/lib/CodeGen/CGBuiltin.cpp @@ -7609,15 +7609,14 @@ // Reinterpret the input predicate so that it can be used to correctly isolate // the elements of the specified datatype. Value *CodeGenFunction::EmitSVEPredicateCast(Value *Pred, - llvm::VectorType *VTy) { - llvm::VectorType *RTy = llvm::VectorType::get( - IntegerType::get(getLLVMContext(), 1), VTy->getElementCount()); + llvm::ScalableVectorType *VTy) { + auto *RTy = llvm::VectorType::get(IntegerType::get(getLLVMContext(), 1), VTy); if (Pred->getType() == RTy) return Pred; unsigned IntID; llvm::Type *IntrinsicTy; - switch (VTy->getNumElements()) { + switch (VTy->getMinNumElements()) { default: llvm_unreachable("unsupported element count!"); case 2: @@ -7948,7 +7947,7 @@ // Predicate results must be converted to svbool_t. if (auto PredTy = dyn_cast<llvm::VectorType>(Call->getType())) if (PredTy->getScalarType()->isIntegerTy(1)) - Call = EmitSVEPredicateCast(Call, cast<llvm::VectorType>(Ty)); + Call = EmitSVEPredicateCast(Call, cast<llvm::ScalableVectorType>(Ty)); return Call; }
Index: clang/lib/CodeGen/CodeGenFunction.h =================================================================== --- clang/lib/CodeGen/CodeGenFunction.h +++ clang/lib/CodeGen/CodeGenFunction.h @@ -3919,7 +3919,8 @@ llvm::ScalableVectorType *getSVEType(const SVETypeFlags &TypeFlags); llvm::ScalableVectorType *getSVEPredType(SVETypeFlags TypeFlags); llvm::Value *EmitSVEDupX(llvm::Value *Scalar); - llvm::Value *EmitSVEPredicateCast(llvm::Value *Pred, llvm::VectorType *VTy); + llvm::Value *EmitSVEPredicateCast(llvm::Value *Pred, + llvm::ScalableVectorType *VTy); llvm::Value *EmitSVEGatherLoad(SVETypeFlags TypeFlags, llvm::SmallVectorImpl<llvm::Value *> &Ops, unsigned IntID); Index: clang/lib/CodeGen/CGBuiltin.cpp =================================================================== --- clang/lib/CodeGen/CGBuiltin.cpp +++ clang/lib/CodeGen/CGBuiltin.cpp @@ -7609,15 +7609,14 @@ // Reinterpret the input predicate so that it can be used to correctly isolate // the elements of the specified datatype. Value *CodeGenFunction::EmitSVEPredicateCast(Value *Pred, - llvm::VectorType *VTy) { - llvm::VectorType *RTy = llvm::VectorType::get( - IntegerType::get(getLLVMContext(), 1), VTy->getElementCount()); + llvm::ScalableVectorType *VTy) { + auto *RTy = llvm::VectorType::get(IntegerType::get(getLLVMContext(), 1), VTy); if (Pred->getType() == RTy) return Pred; unsigned IntID; llvm::Type *IntrinsicTy; - switch (VTy->getNumElements()) { + switch (VTy->getMinNumElements()) { default: llvm_unreachable("unsupported element count!"); case 2: @@ -7948,7 +7947,7 @@ // Predicate results must be converted to svbool_t. if (auto PredTy = dyn_cast<llvm::VectorType>(Call->getType())) if (PredTy->getScalarType()->isIntegerTy(1)) - Call = EmitSVEPredicateCast(Call, cast<llvm::VectorType>(Ty)); + Call = EmitSVEPredicateCast(Call, cast<llvm::ScalableVectorType>(Ty)); return Call; }
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits