Skip to content

Commit bdea4ea

Browse files
mshelegoigcbot
authored andcommitted
IGCLLVM::getNonOpaquePtrEltTy elimination in GenXLowerAggrCopies
This change is part of the effort to support opaque pointers in newer LLVM versions
1 parent 66b75f2 commit bdea4ea

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

IGC/VectorCompiler/lib/GenXCodeGen/GenXLowerAggrCopies.cpp

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*========================== begin_copyright_notice ============================
22
3-
Copyright (C) 2019-2023 Intel Corporation
3+
Copyright (C) 2019-2024 Intel Corporation
44
55
SPDX-License-Identifier: MIT
66
@@ -159,18 +159,15 @@ static void setMemorySliceWithVecStore(SliceInfo Slice, Value &SetVal,
159159
"wrong argument: insertion point must be a valid instruction");
160160
IGC_ASSERT_MESSAGE(Slice.Offset >= 0 && isPowerOf2_32(Slice.Width),
161161
"illegal slice is provided");
162-
IGC_ASSERT_MESSAGE(SetVal.getType() ==
163-
IGCLLVM::getNonOpaquePtrEltTy(BaseAddr.getType()),
164-
"value and pointer types must correspond");
165162

166163
auto *VecTy = IGCLLVM::FixedVectorType::get(SetVal.getType(), Slice.Width);
167164
IRBuilder<> IRB(InsertionPt);
168165
Value *WriteOut = IRB.CreateVectorSplat(Slice.Width, &SetVal);
169166
auto *DstAddr = &BaseAddr;
170167
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");
174171
auto DstAS = cast<PointerType>(DstAddr->getType())->getAddressSpace();
175172
auto *StoreVecPtr = IRB.CreateBitCast(DstAddr, VecTy->getPointerTo(DstAS));
176173
auto *Store = IRB.CreateStore(WriteOut, StoreVecPtr);
@@ -251,17 +248,14 @@ void GenXLowerAggrCopies::expandMemMov2VecLoadStore(T *MemCall) {
251248

252249
auto *DstAddr = MemCall->getRawDest();
253250

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);
257252

258253
auto *SrcAddr = MemCall->getRawSource();
259254
unsigned SrcAddrSpace =
260255
cast<PointerType>(SrcAddr->getType())->getAddressSpace();
261256

262257
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);
265259
Load->setAlignment(IGCLLVM::getSourceAlign(*MemCall));
266260

267261
unsigned DstAddrSpace = cast<PointerType>(DstAddr->getType())->getAddressSpace();

0 commit comments

Comments
 (0)