@@ -526,7 +526,6 @@ class TransposeHelperPromote : public TransposeHelper
526
526
StoreInst* pStore,
527
527
Value* pScalarizedIdx);
528
528
AllocaInst* pVecAlloca;
529
- std::set<BasicBlock*> StoreBBs; // location of all stores
530
529
TransposeHelperPromote (AllocaInst* pAI) : TransposeHelper(false ) { pVecAlloca = pAI; }
531
530
};
532
531
@@ -552,16 +551,7 @@ void LowerGEPForPrivMem::handleAllocaInst(llvm::AllocaInst* pAlloca)
552
551
// to keep the promoted vector as uniform in the next round of WIAnalysis
553
552
bool isUniformAlloca = pAlloca->getMetadata (" uniform" ) != nullptr ;
554
553
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);
565
555
auto pVecF = GenISAIntrinsic::getDeclaration (m_pFunc->getParent (),
566
556
GenISAIntrinsic::GenISA_vectorUniform, pVecAlloca->getAllocatedType ());
567
557
auto pVecInit = IRB1.CreateCall (pVecF);
@@ -720,11 +710,10 @@ void TransposeHelperPromote::handleStoreInst(
720
710
llvm::StoreInst* pStore,
721
711
llvm::Value* pScalarizedIdx)
722
712
{
713
+ // Add Store instruction to remove list
723
714
IGC_ASSERT (nullptr != pStore);
724
715
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
+
728
717
IRBuilder<> IRB (pStore);
729
718
llvm::Value* pStoreVal = pStore->getValueOperand ();
730
719
llvm::Value* pLoadVecAlloca = IRB.CreateLoad (pVecAlloca);
0 commit comments