@@ -1876,43 +1876,19 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
18761876 case OpLifetimeStart: {
18771877 SPIRVLifetimeStart *LTStart = static_cast <SPIRVLifetimeStart *>(BV);
18781878 IRBuilder<> Builder (BB);
1879- SPIRVWord Size = LTStart->getSize ();
1880- ConstantInt *S = nullptr ;
18811879 auto *Var = transValue (LTStart->getObject (), F, BB);
1882- Var = Var->stripPointerCasts ();
1883- if (Size)
1884- S = Builder.getInt64 (Size);
1885- if (Size == 0 ) {
1886- auto *Alloca = cast<AllocaInst>(Var);
1887- if (Alloca->getAllocatedType ()->isSized ())
1888- Size = M->getDataLayout ().getTypeAllocSize (Alloca->getAllocatedType ());
1889- else
1890- Size = static_cast <SPIRVWord>(-1 );
1891- }
1892- CallInst *Start = Builder.CreateLifetimeStart (Var, S);
1880+ CallInst *Start = Builder.CreateLifetimeStart (Var);
18931881 return mapValue (BV, Start);
18941882 }
18951883
18961884 case OpLifetimeStop: {
18971885 SPIRVLifetimeStop *LTStop = static_cast <SPIRVLifetimeStop *>(BV);
18981886 IRBuilder<> Builder (BB);
1899- SPIRVWord Size = LTStop->getSize ();
1900- ConstantInt *S = nullptr ;
19011887 auto *Var = transValue (LTStop->getObject (), F, BB);
1902- Var = Var->stripPointerCasts ();
1903- if (Size)
1904- S = Builder.getInt64 (Size);
1905- if (Size == 0 ) {
1906- auto *Alloca = cast<AllocaInst>(Var);
1907- if (Alloca->getAllocatedType ()->isSized ())
1908- Size = M->getDataLayout ().getTypeAllocSize (Alloca->getAllocatedType ());
1909- else
1910- Size = static_cast <SPIRVWord>(-1 );
1911- }
19121888 for (const auto &I : Var->users ())
19131889 if (auto *II = getLifetimeStartIntrinsic (dyn_cast<Instruction>(I)))
1914- return mapValue (BV, Builder.CreateLifetimeEnd (II->getOperand (1 ), S ));
1915- return mapValue (BV, Builder.CreateLifetimeEnd (Var, S ));
1890+ return mapValue (BV, Builder.CreateLifetimeEnd (II->getOperand (1 )));
1891+ return mapValue (BV, Builder.CreateLifetimeEnd (Var));
19161892 }
19171893
19181894 case OpStore: {
0 commit comments