@@ -192,8 +192,7 @@ class AMDGPUSwLowerLDS {
192
192
void getLDSMemoryInstructions (Function *Func,
193
193
SetVector<Instruction *> &LDSInstructions);
194
194
void replaceKernelLDSAccesses (Function *Func);
195
- Value *getTranslatedGlobalMemoryPtrOfLDS (Value *LoadMallocPtr,
196
- Value *LDSPtr);
195
+ Value *getTranslatedGlobalMemoryPtrOfLDS (Value *LoadMallocPtr, Value *LDSPtr);
197
196
void translateLDSMemoryOperationsToGlobalMemory (
198
197
Function *Func, Value *LoadMallocPtr,
199
198
SetVector<Instruction *> &LDSInstructions);
@@ -665,8 +664,7 @@ void AMDGPUSwLowerLDS::getLDSMemoryInstructions(
665
664
}
666
665
}
667
666
668
- Value *
669
- AMDGPUSwLowerLDS::getTranslatedGlobalMemoryPtrOfLDS (Value *LoadMallocPtr,
667
+ Value *AMDGPUSwLowerLDS::getTranslatedGlobalMemoryPtrOfLDS (Value *LoadMallocPtr,
670
668
Value *LDSPtr) {
671
669
assert (LDSPtr && " Invalid LDS pointer operand" );
672
670
Type *LDSPtrType = LDSPtr->getType ();
@@ -677,11 +675,13 @@ AMDGPUSwLowerLDS::getTranslatedGlobalMemoryPtrOfLDS(Value *LoadMallocPtr,
677
675
ElementCount NumElements = VecPtrTy->getElementCount ();
678
676
Type *Int32VecTy = VectorType::get (IRB.getInt32Ty (), NumElements);
679
677
Value *PtrToInt = IRB.CreatePtrToInt (LDSPtr, Int32VecTy);
680
- Type *GlobalPtrVecTy = VectorType::get (IRB.getPtrTy (AMDGPUAS::GLOBAL_ADDRESS), NumElements);
678
+ Type *GlobalPtrVecTy =
679
+ VectorType::get (IRB.getPtrTy (AMDGPUAS::GLOBAL_ADDRESS), NumElements);
681
680
Value *GlobalPtrVec = PoisonValue::get (GlobalPtrVecTy);
682
681
for (uint64_t Index = 0 ; Index < NumElements.getKnownMinValue (); ++Index) {
683
682
Value *ExtElem = IRB.CreateExtractElement (PtrToInt, Index);
684
- Value *Gep = IRB.CreateInBoundsGEP (IRB.getInt8Ty (), LoadMallocPtr, {ExtElem});
683
+ Value *Gep =
684
+ IRB.CreateInBoundsGEP (IRB.getInt8Ty (), LoadMallocPtr, {ExtElem});
685
685
GlobalPtrVec = IRB.CreateInsertElement (GlobalPtrVec, Gep, Index);
686
686
}
687
687
return GlobalPtrVec;
@@ -720,8 +720,8 @@ void AMDGPUSwLowerLDS::translateLDSMemoryOperationsToGlobalMemory(
720
720
} else if (AtomicRMWInst *RMW = dyn_cast<AtomicRMWInst>(Inst)) {
721
721
Value *RMWPtrOperand = RMW->getPointerOperand ();
722
722
Value *RMWValOperand = RMW->getValOperand ();
723
- Value *Replacement = getTranslatedGlobalMemoryPtrOfLDS (
724
- LoadMallocPtr, RMWPtrOperand);
723
+ Value *Replacement =
724
+ getTranslatedGlobalMemoryPtrOfLDS ( LoadMallocPtr, RMWPtrOperand);
725
725
AtomicRMWInst *NewRMW = IRB.CreateAtomicRMW (
726
726
RMW->getOperation (), Replacement, RMWValOperand, RMW->getAlign (),
727
727
RMW->getOrdering (), RMW->getSyncScopeID ());
@@ -731,8 +731,8 @@ void AMDGPUSwLowerLDS::translateLDSMemoryOperationsToGlobalMemory(
731
731
RMW->eraseFromParent ();
732
732
} else if (AtomicCmpXchgInst *XCHG = dyn_cast<AtomicCmpXchgInst>(Inst)) {
733
733
Value *XCHGPtrOperand = XCHG->getPointerOperand ();
734
- Value *Replacement = getTranslatedGlobalMemoryPtrOfLDS (
735
- LoadMallocPtr, XCHGPtrOperand);
734
+ Value *Replacement =
735
+ getTranslatedGlobalMemoryPtrOfLDS ( LoadMallocPtr, XCHGPtrOperand);
736
736
AtomicCmpXchgInst *NewXCHG = IRB.CreateAtomicCmpXchg (
737
737
Replacement, XCHG->getCompareOperand (), XCHG->getNewValOperand (),
738
738
XCHG->getAlign (), XCHG->getSuccessOrdering (),
0 commit comments