Skip to content

Commit

Permalink
[AIE2P] Fix Accumulator RegBank assignment for G_STORE
Browse files Browse the repository at this point in the history
  • Loading branch information
khallouh committed Jan 15, 2025
1 parent 685e83f commit 6191609
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions llvm/lib/Target/AIE/aie2p/AIE2PRegisterBankInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -764,13 +764,12 @@ AIE2PRegisterBankInfo::getInstrMapping(const MachineInstr &MI) const {
Register VReg = MI.getOperand(0).getReg();
if (!VReg)
break;
MachineInstr *DefMI = MRI.getVRegDef(VReg);
LLT Type = MRI.getType(VReg);
auto *RB = getRegBank(DefMI->getOperand(0).getReg(), MRI, TRI);
auto DefRegBank = getRegBank(VReg, MRI, TRI);
// Add an additional typesize check to avoid matching the following case.
// %3:_(<16 x s64>), %4:_(s32) = llvm.aie2p.scd.expand.ACC1024.incr),
// %1(s32) G_STORE %4(s32), %2(p0) :: (store (s32))
if (RB == &AIE2P::AccRegBank && Type.getSizeInBits() > 256) {
if (DefRegBank == &AIE2P::AccRegBank && Type.getSizeInBits() > 256) {
OpRegBankIdx[0] = getAccPartialMappingIdx(MRI.getType(VReg));
OpRegBankIdx[1] = PMI_PTR;
return AIEBaseRegisterBankInfo::getInstrMappingFinal(MI, Cost, OpSize,
Expand Down

0 comments on commit 6191609

Please sign in to comment.