|
1 | 1 | /*========================== begin_copyright_notice ============================
|
2 | 2 |
|
3 |
| -Copyright (C) 2019-2023 Intel Corporation |
| 3 | +Copyright (C) 2019-2024 Intel Corporation |
4 | 4 |
|
5 | 5 | SPDX-License-Identifier: MIT
|
6 | 6 |
|
@@ -159,18 +159,15 @@ static void setMemorySliceWithVecStore(SliceInfo Slice, Value &SetVal,
|
159 | 159 | "wrong argument: insertion point must be a valid instruction");
|
160 | 160 | IGC_ASSERT_MESSAGE(Slice.Offset >= 0 && isPowerOf2_32(Slice.Width),
|
161 | 161 | "illegal slice is provided");
|
162 |
| - IGC_ASSERT_MESSAGE(SetVal.getType() == |
163 |
| - IGCLLVM::getNonOpaquePtrEltTy(BaseAddr.getType()), |
164 |
| - "value and pointer types must correspond"); |
165 | 162 |
|
166 | 163 | auto *VecTy = IGCLLVM::FixedVectorType::get(SetVal.getType(), Slice.Width);
|
167 | 164 | IRBuilder<> IRB(InsertionPt);
|
168 | 165 | Value *WriteOut = IRB.CreateVectorSplat(Slice.Width, &SetVal);
|
169 | 166 | auto *DstAddr = &BaseAddr;
|
170 | 167 | if (Slice.Offset != 0)
|
171 |
| - DstAddr = IRB.CreateGEP(IGCLLVM::getNonOpaquePtrEltTy(BaseAddr.getType()), |
172 |
| - &BaseAddr, IRB.getInt32(Slice.Offset), |
173 |
| - BaseAddr.getName() + ".addr.offset"); |
| 168 | + DstAddr = |
| 169 | + IRB.CreateGEP(SetVal.getType(), &BaseAddr, IRB.getInt32(Slice.Offset), |
| 170 | + BaseAddr.getName() + ".addr.offset"); |
174 | 171 | auto DstAS = cast<PointerType>(DstAddr->getType())->getAddressSpace();
|
175 | 172 | auto *StoreVecPtr = IRB.CreateBitCast(DstAddr, VecTy->getPointerTo(DstAS));
|
176 | 173 | auto *Store = IRB.CreateStore(WriteOut, StoreVecPtr);
|
@@ -251,17 +248,14 @@ void GenXLowerAggrCopies::expandMemMov2VecLoadStore(T *MemCall) {
|
251 | 248 |
|
252 | 249 | auto *DstAddr = MemCall->getRawDest();
|
253 | 250 |
|
254 |
| - auto *I8Ty = IGCLLVM::getNonOpaquePtrEltTy(DstAddr->getType()); |
255 |
| - IGC_ASSERT(I8Ty->isIntegerTy(8)); |
256 |
| - auto *VecTy = IGCLLVM::FixedVectorType::get(I8Ty, Len); |
| 251 | + auto *VecTy = IGCLLVM::FixedVectorType::get(IRB.getInt8Ty(), Len); |
257 | 252 |
|
258 | 253 | auto *SrcAddr = MemCall->getRawSource();
|
259 | 254 | unsigned SrcAddrSpace =
|
260 | 255 | cast<PointerType>(SrcAddr->getType())->getAddressSpace();
|
261 | 256 |
|
262 | 257 | auto *LoadPtrV = IRB.CreateBitCast(SrcAddr, VecTy->getPointerTo(SrcAddrSpace));
|
263 |
| - Type *Ty = IGCLLVM::getNonOpaquePtrEltTy(LoadPtrV->getType()); |
264 |
| - auto *Load = IRB.CreateLoad(Ty, LoadPtrV); |
| 258 | + auto *Load = IRB.CreateLoad(VecTy, LoadPtrV); |
265 | 259 | Load->setAlignment(IGCLLVM::getSourceAlign(*MemCall));
|
266 | 260 |
|
267 | 261 | unsigned DstAddrSpace = cast<PointerType>(DstAddr->getType())->getAddressSpace();
|
|
0 commit comments