[polly] b82a95f - [SVE] Eliminate calls to default-false VectorType::get() from polly

Christopher Tetreault via llvm-commits llvm-commits at lists.llvm.org
Fri May 29 10:04:22 PDT 2020


Author: Christopher Tetreault
Date: 2020-05-29T10:04:06-07:00
New Revision: b82a95f8bc91976a9ba663f8fa2edf15708b5c0f

URL: https://github.com/llvm/llvm-project/commit/b82a95f8bc91976a9ba663f8fa2edf15708b5c0f
DIFF: https://github.com/llvm/llvm-project/commit/b82a95f8bc91976a9ba663f8fa2edf15708b5c0f.diff

LOG: [SVE] Eliminate calls to default-false VectorType::get() from polly

Reviewers: bollu, efriedma, david-arm, fpetrogalli, gchatelet

Reviewed By: fpetrogalli

Subscribers: tschuett, rkruppe, psnobl, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D80341

Added: 
    

Modified: 
    polly/lib/CodeGen/BlockGenerators.cpp

Removed: 
    


################################################################################
diff  --git a/polly/lib/CodeGen/BlockGenerators.cpp b/polly/lib/CodeGen/BlockGenerators.cpp
index 5a64cc86ea1d..bf6c96b8091d 100644
--- a/polly/lib/CodeGen/BlockGenerators.cpp
+++ b/polly/lib/CodeGen/BlockGenerators.cpp
@@ -1025,7 +1025,7 @@ Value *VectorBlockGenerator::getVectorValue(ScopStmt &Stmt, Value *Old,
 
   int Width = getVectorWidth();
 
-  Value *Vector = UndefValue::get(VectorType::get(Old->getType(), Width));
+  Value *Vector = UndefValue::get(FixedVectorType::get(Old->getType(), Width));
 
   for (int Lane = 0; Lane < Width; Lane++)
     Vector = Builder.CreateInsertElement(
@@ -1042,9 +1042,9 @@ Type *VectorBlockGenerator::getVectorPtrTy(const Value *Val, int Width) {
   assert(PointerTy && "PointerType expected");
 
   Type *ScalarType = PointerTy->getElementType();
-  VectorType *VectorType = VectorType::get(ScalarType, Width);
+  auto *FVTy = FixedVectorType::get(ScalarType, Width);
 
-  return PointerType::getUnqual(VectorType);
+  return PointerType::getUnqual(FVTy);
 }
 
 Value *VectorBlockGenerator::generateStrideOneLoad(
@@ -1093,7 +1093,7 @@ Value *VectorBlockGenerator::generateStrideZeroLoad(
     ScalarLoad->setAlignment(Align(8));
 
   Constant *SplatVector = Constant::getNullValue(
-      VectorType::get(Builder.getInt32Ty(), getVectorWidth()));
+      FixedVectorType::get(Builder.getInt32Ty(), getVectorWidth()));
 
   Value *VectorLoad = Builder.CreateShuffleVector(
       ScalarLoad, ScalarLoad, SplatVector, Load->getName() + "_p_splat");
@@ -1105,10 +1105,10 @@ Value *VectorBlockGenerator::generateUnknownStrideLoad(
     __isl_keep isl_id_to_ast_expr *NewAccesses) {
   int VectorWidth = getVectorWidth();
   auto *Pointer = Load->getPointerOperand();
-  VectorType *VectorType = VectorType::get(
+  auto *FVTy = FixedVectorType::get(
       dyn_cast<PointerType>(Pointer->getType())->getElementType(), VectorWidth);
 
-  Value *Vector = UndefValue::get(VectorType);
+  Value *Vector = UndefValue::get(FVTy);
 
   for (int i = 0; i < VectorWidth; i++) {
     Value *NewPointer = generateLocationAccessed(Stmt, Load, ScalarMaps[i],
@@ -1167,7 +1167,7 @@ void VectorBlockGenerator::copyUnaryInst(ScopStmt &Stmt, UnaryInstruction *Inst,
   assert(isa<CastInst>(Inst) && "Can not generate vector code for instruction");
 
   const CastInst *Cast = dyn_cast<CastInst>(Inst);
-  VectorType *DestType = VectorType::get(Inst->getType(), VectorWidth);
+  auto *DestType = FixedVectorType::get(Inst->getType(), VectorWidth);
   VectorMap[Inst] = Builder.CreateCast(Cast->getOpcode(), NewOperand, DestType);
 }
 
@@ -1277,8 +1277,8 @@ void VectorBlockGenerator::copyInstScalarized(
     return;
 
   // Make the result available as vector value.
-  VectorType *VectorType = VectorType::get(Inst->getType(), VectorWidth);
-  Value *Vector = UndefValue::get(VectorType);
+  auto *FVTy = FixedVectorType::get(Inst->getType(), VectorWidth);
+  Value *Vector = UndefValue::get(FVTy);
 
   for (int i = 0; i < VectorWidth; i++)
     Vector = Builder.CreateInsertElement(Vector, ScalarMaps[i][Inst],
@@ -1344,7 +1344,7 @@ void VectorBlockGenerator::generateScalarVectorLoads(
                                              Address->getName() + "_p_vec_p");
     auto *Val = Builder.CreateLoad(VectorPtr, Address->getName() + ".reload");
     Constant *SplatVector = Constant::getNullValue(
-        VectorType::get(Builder.getInt32Ty(), getVectorWidth()));
+        FixedVectorType::get(Builder.getInt32Ty(), getVectorWidth()));
 
     Value *VectorVal = Builder.CreateShuffleVector(
         Val, Val, SplatVector, Address->getName() + "_p_splat");


        


More information about the llvm-commits mailing list