@@ -8513,9 +8513,9 @@ getMsgBlockSizes(unsigned sizeInBits, unsigned alignInBits) {
8513
8513
return std::make_pair(~0U, ~0U);
8514
8514
}
8515
8515
8516
- void EmitPass::emitLoad(LoadInst* inst)
8516
+ void EmitPass::emitLoad(LoadInst* inst, Value* offset, ConstantInt* immOffset )
8517
8517
{
8518
- emitVectorLoad(inst, inst->getPointerOperand() );
8518
+ emitVectorLoad(inst, offset, immOffset );
8519
8519
}
8520
8520
8521
8521
void EmitPass::EmitNoModifier(llvm::Instruction* inst)
@@ -8558,10 +8558,10 @@ void EmitPass::EmitNoModifier(llvm::Instruction* inst)
8558
8558
}
8559
8559
break;
8560
8560
case Instruction::Store:
8561
- emitStore(cast<StoreInst>(inst));
8561
+ emitStore(cast<StoreInst>(inst), nullptr, nullptr );
8562
8562
break;
8563
8563
case Instruction::Load:
8564
- emitLoad(cast<LoadInst>(inst));
8564
+ emitLoad(cast<LoadInst>(inst), nullptr, nullptr );
8565
8565
break;
8566
8566
case Instruction::GetElementPtr:
8567
8567
emitGEP(cast<GetElementPtrInst>(inst));
@@ -9632,9 +9632,9 @@ void EmitPass::emitStore3DInner(Value* pllValToStore, Value* pllDstPtr, Value* p
9632
9632
}
9633
9633
}
9634
9634
9635
- void EmitPass::emitStore(StoreInst* inst)
9635
+ void EmitPass::emitStore(StoreInst* inst, Value* offset, ConstantInt* immOffset )
9636
9636
{
9637
- emitVectorStore(inst);
9637
+ emitVectorStore(inst, offset, immOffset );
9638
9638
}
9639
9639
9640
9640
CVariable* EmitPass::GetSymbol(llvm::Value* v)
@@ -13360,15 +13360,20 @@ unsigned int EmitPass::GetScalarTypeSizeInRegister(Type* Ty) const
13360
13360
}
13361
13361
13362
13362
13363
- void EmitPass::emitVectorLoad(LoadInst* inst, Value* offset)
13363
+ void EmitPass::emitVectorLoad(LoadInst* inst, Value* offset, ConstantInt* immOffset )
13364
13364
{
13365
+ int immOffsetInt = 0;
13366
+ if (immOffset)
13367
+ immOffsetInt = static_cast<int>(immOffset->getSExtValue());
13368
+
13365
13369
Value* Ptr = inst->getPointerOperand();
13366
13370
PointerType* ptrType = cast<PointerType>(Ptr->getType());
13367
13371
bool useA32 = !IGC::isA64Ptr(ptrType, m_currShader->GetContext());
13368
13372
13369
13373
ResourceDescriptor resource = GetResourceVariable(Ptr);
13370
13374
// eOffset is in bytes as 2/19/14
13371
- CVariable* eOffset = GetSymbol(offset);
13375
+ // offset corresponds to Int2Ptr operand obtained during pattern matching
13376
+ CVariable* eOffset = GetSymbol(immOffset ? offset : Ptr);
13372
13377
if (useA32)
13373
13378
{
13374
13379
eOffset = TruncatePointer(eOffset);
@@ -13786,8 +13791,12 @@ void EmitPass::emitVectorLoad(LoadInst* inst, Value* offset)
13786
13791
}
13787
13792
}
13788
13793
13789
- void EmitPass::emitVectorStore(StoreInst* inst)
13794
+ void EmitPass::emitVectorStore(StoreInst* inst, Value* offset, ConstantInt* immOffset )
13790
13795
{
13796
+ int immOffsetInt = 0;
13797
+ if (immOffset)
13798
+ immOffsetInt = static_cast<int>(immOffset->getSExtValue());
13799
+
13791
13800
Value* Ptr = inst->getPointerOperand();
13792
13801
PointerType* ptrType = cast<PointerType>(Ptr->getType());
13793
13802
@@ -13797,7 +13806,8 @@ void EmitPass::emitVectorStore(StoreInst* inst)
13797
13806
ForceDMask(false);
13798
13807
}
13799
13808
// As 2/19/14, eOffset is in bytes !
13800
- CVariable* eOffset = GetSymbol(Ptr);
13809
+ // offset corresponds to Int2Ptr operand obtained during pattern matching
13810
+ CVariable* eOffset = GetSymbol(immOffset ? offset : Ptr);
13801
13811
bool useA32 = !isA64Ptr(ptrType, m_currShader->GetContext());
13802
13812
if (useA32)
13803
13813
{
0 commit comments