@@ -668,19 +668,16 @@ Value *AMDGPUSwLowerLDS::getTranslatedGlobalMemoryPtrOfLDS(Value *LoadMallocPtr,
668668 Value *LDSPtr) {
669669 assert (LDSPtr && " Invalid LDS pointer operand" );
670670 Type *LDSPtrType = LDSPtr->getType ();
671- auto &Ctx = M.getContext ();
672- const auto &DL = M.getDataLayout ();
673- auto *IntPtrTy = DL.getIntPtrType (Ctx, AMDGPUAS::LOCAL_ADDRESS);
671+ LLVMContext &Ctx = M.getContext ();
672+ const DataLayout &DL = M.getDataLayout ();
673+ Type *IntTy = DL.getIntPtrType (Ctx, AMDGPUAS::LOCAL_ADDRESS);
674674 if (auto *VecPtrTy = dyn_cast<VectorType>(LDSPtrType)) {
675675 // Handle vector of pointers
676676 ElementCount NumElements = VecPtrTy->getElementCount ();
677- Type *IntVecTy = VectorType::get (IntPtrTy, NumElements);
678- Value *PtrToInt = IRB.CreatePtrToInt (LDSPtr, IntVecTy);
679- // Create vector of pointers to global address space
680- return IRB.CreateInBoundsGEP (IRB.getInt8Ty (), LoadMallocPtr, PtrToInt);
677+ IntTy = VectorType::get (IntTy, NumElements);
681678 }
682- Value *PtrToInt = IRB.CreatePtrToInt (LDSPtr, IntPtrTy );
683- return IRB.CreateInBoundsGEP (IRB.getInt8Ty (), LoadMallocPtr, {PtrToInt });
679+ Value *GepIndex = IRB.CreatePtrToInt (LDSPtr, IntTy );
680+ return IRB.CreateInBoundsGEP (IRB.getInt8Ty (), LoadMallocPtr, {GepIndex });
684681}
685682
686683void AMDGPUSwLowerLDS::translateLDSMemoryOperationsToGlobalMemory (
0 commit comments