[PATCH] D27057: AMDGPU: Fix adding extra implicit def of register
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 23 09:34:02 PST 2016
arsenm updated this revision to Diff 79110.
arsenm added a comment.
Also do for scalar store path
https://reviews.llvm.org/D27057
Files:
lib/Target/AMDGPU/SIRegisterInfo.cpp
Index: lib/Target/AMDGPU/SIRegisterInfo.cpp
===================================================================
--- lib/Target/AMDGPU/SIRegisterInfo.cpp
+++ lib/Target/AMDGPU/SIRegisterInfo.cpp
@@ -476,16 +476,18 @@
= MF->getMachineMemOperand(PInfo, MMO->getFlags(),
EltSize, MinAlign(Align, EltSize * i));
- BuildMI(*MBB, MI, DL, Desc)
+ auto MIB = BuildMI(*MBB, MI, DL, Desc)
.addReg(SubReg, getDefRegState(!IsStore))
.addReg(ScratchRsrcReg)
.addReg(SOffset, SOffsetRegState)
.addImm(Offset)
.addImm(0) // glc
.addImm(0) // slc
.addImm(0) // tfe
- .addMemOperand(NewMMO)
- .addReg(ValueReg, RegState::Implicit | SrcDstRegState);
+ .addMemOperand(NewMMO);
+
+ if (NumSubRegs > 1)
+ MIB.addReg(ValueReg, RegState::Implicit | SrcDstRegState);
}
if (RanOutOfSGPRs) {
@@ -660,12 +662,15 @@
.addReg(MFI->getScratchWaveOffsetReg());
}
- BuildMI(*MBB, MI, DL, TII->get(AMDGPU::S_BUFFER_LOAD_DWORD_SGPR), SubReg)
+ auto MIB =
+ BuildMI(*MBB, MI, DL, TII->get(AMDGPU::S_BUFFER_LOAD_DWORD_SGPR), SubReg)
.addReg(MFI->getScratchRSrcReg()) // sbase
.addReg(OffsetReg) // soff
.addImm(0) // glc
- .addMemOperand(MMO)
- .addReg(MI->getOperand(0).getReg(), RegState::ImplicitDefine);
+ .addMemOperand(MMO);
+
+ if (NumSubRegs > 1)
+ MIB.addReg(MI->getOperand(0).getReg(), RegState::ImplicitDefine);
continue;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27057.79110.patch
Type: text/x-patch
Size: 1575 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161123/ab6a88ee/attachment.bin>
More information about the llvm-commits
mailing list