@@ -282,7 +282,7 @@ StatusPrivArr2Reg LowerGEPForPrivMem::CheckIfAllocaPromotable(llvm::AllocaInst *
282
282
283
283
allowedAllocaSizeInBytes = (allowedAllocaSizeInBytes * 8 ) / SIMDSize;
284
284
}
285
- SOALayoutChecker checker (*pAlloca, m_ctx->type == ShaderType::OPENCL_SHADER, true );
285
+ SOALayoutChecker checker (*pAlloca, m_ctx->type == ShaderType::OPENCL_SHADER);
286
286
SOALayoutInfo SOAInfo = checker.getOrGatherInfo ();
287
287
if (!SOAInfo.canUseSOALayout ) {
288
288
return StatusPrivArr2Reg::CannotUseSOALayout;
@@ -357,7 +357,7 @@ StatusPrivArr2Reg LowerGEPForPrivMem::CheckIfAllocaPromotable(llvm::AllocaInst *
357
357
return StatusPrivArr2Reg::OK;
358
358
}
359
359
360
- SOALayoutChecker::SOALayoutChecker (AllocaInst &allocaToCheck, bool isOCL, bool mismatchedWidthsSupport ) : allocaRef(allocaToCheck), mismatchedWidthsSupport(mismatchedWidthsSupport ) {
360
+ SOALayoutChecker::SOALayoutChecker (AllocaInst &allocaToCheck, bool isOCL) : allocaRef(allocaToCheck) {
361
361
auto F = allocaToCheck.getParent ()->getParent ();
362
362
pDL = &F->getParent ()->getDataLayout ();
363
363
newAlgoControl = IGC_GET_FLAG_VALUE (EnablePrivMemNewSOATranspose);
@@ -571,12 +571,9 @@ bool IGC::SOALayoutChecker::MismatchDetected(Instruction &I) {
571
571
return false ;
572
572
573
573
Type *allocaTy = allocaRef.getAllocatedType ();
574
- bool allocaIsVecOrArrOrStruct = allocaTy->isVectorTy () || allocaTy->isArrayTy () || allocaTy-> isStructTy ();
574
+ bool allocaIsVecOrArr = allocaTy->isVectorTy () || allocaTy->isArrayTy ();
575
575
576
- if (!allocaIsVecOrArrOrStruct)
577
- return false ;
578
-
579
- if (mismatchedWidthsSupport)
576
+ if (!allocaIsVecOrArr)
580
577
return false ;
581
578
582
579
auto DL = I.getParent ()->getParent ()->getParent ()->getDataLayout ();
@@ -593,26 +590,15 @@ bool IGC::SOALayoutChecker::MismatchDetected(Instruction &I) {
593
590
allocaTy = arrTy->getElementType ();
594
591
} else if (auto *vec = dyn_cast<IGCLLVM::FixedVectorType>(allocaTy)) {
595
592
allocaTy = vec->getElementType ();
596
- } else if (auto *strct = dyn_cast<StructType>(allocaTy)){
597
- if (auto *arrTy = dyn_cast<ArrayType>(strct->getStructElementType (0 ))) {
598
- allocaTy = arrTy->getElementType ();
599
- } else if (auto *vec = dyn_cast<IGCLLVM::FixedVectorType>(strct->getStructElementType (0 ))){
600
- allocaTy = vec->getElementType ();
601
- }
602
593
}
603
594
604
595
if (auto *arrTy = dyn_cast<ArrayType>(pUserTy)) {
605
596
pUserTy = arrTy->getElementType ();
606
597
} else if (auto *vec = dyn_cast<IGCLLVM::FixedVectorType>(pUserTy)) {
607
598
pUserTy = vec->getElementType ();
608
- } else if (auto *strct = dyn_cast<StructType>(pUserTy)){
609
- if (auto *arrTy = dyn_cast<ArrayType>(strct->getStructElementType (0 ))) {
610
- pUserTy = arrTy->getElementType ();
611
- } else if (auto *vec = dyn_cast<IGCLLVM::FixedVectorType>(strct->getStructElementType (0 ))){
612
- pUserTy = vec->getElementType ();
613
- }
614
599
}
615
600
}
601
+
616
602
auto allocaSize = DL.getTypeAllocSize (allocaTy);
617
603
auto vecTySize = DL.getTypeAllocSize (pUserTy);
618
604
0 commit comments