@@ -1037,10 +1037,9 @@ Value *VectorBlockGenerator::getVectorValue(ScopStmt &Stmt, Value *Old,
1037
1037
return Vector;
1038
1038
}
1039
1039
1040
- Type *VectorBlockGenerator::getVectorPtrTy (const Value *Val, int Width,
1041
- unsigned AddrSpace) {
1042
- PointerType *PointerTy = dyn_cast<PointerType>(Val->getType ());
1043
- assert (PointerTy && " PointerType expected" );
1040
+ Type *VectorBlockGenerator::getVectorPtrTy (const Value *Val, int Width) {
1041
+ auto *PointerTy = cast<PointerType>(Val->getType ());
1042
+ unsigned AddrSpace = PointerTy->getAddressSpace ();
1044
1043
1045
1044
Type *ScalarType = PointerTy->getElementType ();
1046
1045
auto *FVTy = FixedVectorType::get (ScalarType, Width);
@@ -1053,8 +1052,7 @@ Value *VectorBlockGenerator::generateStrideOneLoad(
1053
1052
__isl_keep isl_id_to_ast_expr *NewAccesses, bool NegativeStride = false ) {
1054
1053
unsigned VectorWidth = getVectorWidth ();
1055
1054
auto *Pointer = Load->getPointerOperand ();
1056
- auto AS = Pointer->getType ()->getPointerAddressSpace ();
1057
- Type *VectorPtrType = getVectorPtrTy (Pointer, VectorWidth, AS);
1055
+ Type *VectorPtrType = getVectorPtrTy (Pointer, VectorWidth);
1058
1056
unsigned Offset = NegativeStride ? VectorWidth - 1 : 0 ;
1059
1057
1060
1058
Value *NewPointer = generateLocationAccessed (Stmt, Load, ScalarMaps[Offset],
@@ -1083,8 +1081,7 @@ Value *VectorBlockGenerator::generateStrideZeroLoad(
1083
1081
ScopStmt &Stmt, LoadInst *Load, ValueMapT &BBMap,
1084
1082
__isl_keep isl_id_to_ast_expr *NewAccesses) {
1085
1083
auto *Pointer = Load->getPointerOperand ();
1086
- auto AS = Pointer->getType ()->getPointerAddressSpace ();
1087
- Type *VectorPtrType = getVectorPtrTy (Pointer, 1 , AS);
1084
+ Type *VectorPtrType = getVectorPtrTy (Pointer, 1 );
1088
1085
Value *NewPointer =
1089
1086
generateLocationAccessed (Stmt, Load, BBMap, VLTS[0 ], NewAccesses);
1090
1087
Value *VectorPtr = Builder.CreateBitCast (NewPointer, VectorPtrType,
@@ -1204,8 +1201,7 @@ void VectorBlockGenerator::copyStore(
1204
1201
extractScalarValues (Store, VectorMap, ScalarMaps);
1205
1202
1206
1203
if (Access.isStrideOne (isl::manage_copy (Schedule))) {
1207
- auto AS = Pointer->getType ()->getPointerAddressSpace ();
1208
- Type *VectorPtrType = getVectorPtrTy (Pointer, getVectorWidth (), AS);
1204
+ Type *VectorPtrType = getVectorPtrTy (Pointer, getVectorWidth ());
1209
1205
Value *NewPointer = generateLocationAccessed (Stmt, Store, ScalarMaps[0 ],
1210
1206
VLTS[0 ], NewAccesses);
1211
1207
@@ -1343,8 +1339,7 @@ void VectorBlockGenerator::generateScalarVectorLoads(
1343
1339
continue ;
1344
1340
1345
1341
auto *Address = getOrCreateAlloca (*MA);
1346
- auto AS = Address->getType ()->getPointerAddressSpace ();
1347
- Type *VectorPtrType = getVectorPtrTy (Address, 1 , AS);
1342
+ Type *VectorPtrType = getVectorPtrTy (Address, 1 );
1348
1343
Value *VectorPtr = Builder.CreateBitCast (Address, VectorPtrType,
1349
1344
Address->getName () + " _p_vec_p" );
1350
1345
auto *Val = Builder.CreateLoad (VectorPtr, Address->getName () + " .reload" );
0 commit comments