@@ -526,7 +526,6 @@ class TransposeHelperPromote : public TransposeHelper
526526 StoreInst* pStore,
527527 Value* pScalarizedIdx);
528528 AllocaInst* pVecAlloca;
529- std::set<BasicBlock*> StoreBBs; // location of all stores
530529 TransposeHelperPromote (AllocaInst* pAI) : TransposeHelper(false ) { pVecAlloca = pAI; }
531530};
532531
@@ -552,16 +551,7 @@ void LowerGEPForPrivMem::handleAllocaInst(llvm::AllocaInst* pAlloca)
552551 // to keep the promoted vector as uniform in the next round of WIAnalysis
553552 bool isUniformAlloca = pAlloca->getMetadata (" uniform" ) != nullptr ;
554553 if (isUniformAlloca && pAlloca->getAllocatedType ()->isArrayTy ()) {
555- BasicBlock* CommonDomBB = nullptr ;
556- for (auto * SB : helper.StoreBBs )
557- {
558- if (!CommonDomBB)
559- CommonDomBB = SB;
560- else
561- CommonDomBB = m_DT->findNearestCommonDominator (CommonDomBB, SB);
562- }
563- assert (CommonDomBB);
564- IRBuilder<> IRB1 (CommonDomBB->getFirstNonPHI ());
554+ IRBuilder<> IRB1 (pAlloca);
565555 auto pVecF = GenISAIntrinsic::getDeclaration (m_pFunc->getParent (),
566556 GenISAIntrinsic::GenISA_vectorUniform, pVecAlloca->getAllocatedType ());
567557 auto pVecInit = IRB1.CreateCall (pVecF);
@@ -720,11 +710,10 @@ void TransposeHelperPromote::handleStoreInst(
720710 llvm::StoreInst* pStore,
721711 llvm::Value* pScalarizedIdx)
722712{
713+ // Add Store instruction to remove list
723714 IGC_ASSERT (nullptr != pStore);
724715 IGC_ASSERT (pStore->isSimple ());
725- // remember the location of the stores in order to
726- // compute the nearest dominator
727- StoreBBs.insert (pStore->getParent ());
716+
728717 IRBuilder<> IRB (pStore);
729718 llvm::Value* pStoreVal = pStore->getValueOperand ();
730719 llvm::Value* pLoadVecAlloca = IRB.CreateLoad (pVecAlloca);
0 commit comments