Skip to content

Commit 6379e0d

Browse files
vmustyapszymich
authored andcommitted
Fix GEP lowering pass in VC
The `ptrtoint` folding function should take care of `<1 x ptr>` bitcast to and from `ptr`. (cherry picked from commit 8f2dbaf)
1 parent f210021 commit 6379e0d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

IGC/VectorCompiler/lib/GenXCodeGen/GenXGEPLowering.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,9 @@ Value *GenXGEPLowering::visitGetElementPtrInst(GetElementPtrInst &GEP) {
194194
}
195195

196196
PointerValue = Builder->CreatePtrToInt(PtrOp, IntPtrTy);
197-
auto *PTI = dyn_cast<PtrToIntInst>(PointerValue);
198-
if (auto *NewPTI = visitPtrToIntInst(*PTI))
199-
PointerValue = NewPTI;
197+
if (auto *PTI = dyn_cast<PtrToIntInst>(PointerValue))
198+
if (auto *NewPTI = visitPtrToIntInst(*PTI))
199+
PointerValue = NewPTI;
200200

201201
unsigned PtrMathSizeInBits =
202202
DL->getPointerSizeInBits(PtrTy->getAddressSpace());

0 commit comments

Comments
 (0)