Skip to content

Commit f070d5e

Browse files
committed
llvm-spirv: fix merge to sync with KhronosGroup
1 parent a2e9eb6 commit f070d5e

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

llvm-spirv/lib/SPIRV/SPIRVReader.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1877,15 +1877,14 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
18771877
SPIRVLifetimeStart *LTStart = static_cast<SPIRVLifetimeStart *>(BV);
18781878
IRBuilder<> Builder(BB);
18791879
auto *Var = transValue(LTStart->getObject(), F, BB);
1880-
Var = Var->stripPointerCasts();
18811880
CallInst *Start = Builder.CreateLifetimeStart(Var);
18821881
return mapValue(BV, Start);
18831882
}
1883+
18841884
case OpLifetimeStop: {
18851885
SPIRVLifetimeStop *LTStop = static_cast<SPIRVLifetimeStop *>(BV);
18861886
IRBuilder<> Builder(BB);
18871887
auto *Var = transValue(LTStop->getObject(), F, BB);
1888-
Var = Var->stripPointerCasts();
18891888
for (const auto &I : Var->users())
18901889
if (auto *II = getLifetimeStartIntrinsic(dyn_cast<Instruction>(I)))
18911890
return mapValue(BV, Builder.CreateLifetimeEnd(II->getOperand(0)));

llvm-spirv/lib/SPIRV/SPIRVWriter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4873,7 +4873,7 @@ SPIRVValue *LLVMToSPIRVBase::transIntrinsicInst(IntrinsicInst *II,
48734873
unsigned PtrAS = cast<PointerType>(LLVMPtrOp->getType())->getAddressSpace();
48744874
auto *PtrOp = transValue(LLVMPtrOp, BB);
48754875
if (PtrAS == SPIRAS_Private)
4876-
return BM->addLifetimeInst(OC, PtrOp, 0, BB);
4876+
return BM->addLifetimeInst(OC, PtrOp, Size, BB);
48774877
// If pointer address space is Generic - use original allocation.
48784878
BM->getErrorLog().checkError(
48794879
PtrAS == SPIRAS_Generic, SPIRVEC_InvalidInstruction, II,
@@ -4882,7 +4882,7 @@ SPIRVValue *LLVMToSPIRVBase::transIntrinsicInst(IntrinsicInst *II,
48824882
auto *UI = static_cast<SPIRVUnary *>(PtrOp);
48834883
PtrOp = UI->getOperand(0);
48844884
}
4885-
return BM->addLifetimeInst(OC, PtrOp, 0, BB);
4885+
return BM->addLifetimeInst(OC, PtrOp, Size, BB);
48864886
}
48874887
// We don't want to mix translation of regular code and debug info, because
48884888
// it creates a mess, therefore translation of debug intrinsics is

0 commit comments

Comments
 (0)