Skip to content

Commit 3bc6fb7

Browse files
vsemenov368igcbot
authored andcommitted
Fix LSC typed 2D legalization in VC
Memory simd width was not properly calculated for load/store tgm 2d intrinsics. The calculation was based on predicate operand that is not present for such intrinsics.
1 parent 2e7077d commit 3bc6fb7

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

IGC/VectorCompiler/lib/InternalIntrinsics/InternalIntrinsics.cpp

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -857,22 +857,29 @@ InternalIntrinsic::getMemoryVectorSizePerLane(const llvm::Instruction *I) {
857857
IGC_ASSERT(Size > 0 && Size <= 4);
858858
return Size;
859859
}
860-
861860
}
862861

863862
return 1;
864863
}
865864

866865
unsigned InternalIntrinsic::getMemorySimdWidth(const Instruction *I) {
867866
IGC_ASSERT_EXIT(isInternalMemoryIntrinsic(I));
867+
auto IID = getInternalIntrinsicID(I);
868868

869-
auto *Pred = I->getOperand(0);
870-
auto *PredTy = Pred->getType();
869+
switch (IID) {
870+
case InternalIntrinsic::lsc_load_2d_tgm_bti:
871+
case InternalIntrinsic::lsc_store_2d_tgm_bti:
872+
return 1;
873+
default: {
874+
auto *Pred = I->getOperand(0);
875+
auto *PredTy = Pred->getType();
871876

872-
if (auto *PredVTy = dyn_cast<IGCLLVM::FixedVectorType>(PredTy))
873-
return PredVTy->getNumElements();
877+
if (auto *PredVTy = dyn_cast<IGCLLVM::FixedVectorType>(PredTy))
878+
return PredVTy->getNumElements();
874879

875-
return 1;
880+
return 1;
881+
}
882+
}
876883
}
877884

878885
unsigned

0 commit comments

Comments
 (0)