[PATCH] D81821: [AMDGPU] Make overlaps with ScratchRSrcReg fatal errors
Carl Ritson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 15 06:28:58 PDT 2020
critson updated this revision to Diff 270735.
critson added a comment.
Remove LiveIn parts.
I have concluded that they are wrong, or at least too complicated for a simple test.
In small functions parts of the ScratchRSrcReg may be formed from registers that
are live-ins, and these will work fine.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D81821/new/
https://reviews.llvm.org/D81821
Files:
llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp
Index: llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp
===================================================================
--- llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp
+++ llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp
@@ -336,20 +336,23 @@
MCRegister StackPtrReg = MFI->getStackPtrOffsetReg();
if (StackPtrReg) {
+ if (isSubRegister(ScratchRSrcReg, StackPtrReg))
+ report_fatal_error("scratch resource registers overlap stack pointer");
reserveRegisterTuples(Reserved, StackPtrReg);
- assert(!isSubRegister(ScratchRSrcReg, StackPtrReg));
}
MCRegister FrameReg = MFI->getFrameOffsetReg();
if (FrameReg) {
+ if (isSubRegister(ScratchRSrcReg, FrameReg))
+ report_fatal_error("scratch resource registers overlap frame offset");
reserveRegisterTuples(Reserved, FrameReg);
- assert(!isSubRegister(ScratchRSrcReg, FrameReg));
}
if (hasBasePointer(MF)) {
MCRegister BasePtrReg = getBaseRegister();
+ if (isSubRegister(ScratchRSrcReg, BasePtrReg))
+ report_fatal_error("scratch resource registers overlap base pointer");
reserveRegisterTuples(Reserved, BasePtrReg);
- assert(!isSubRegister(ScratchRSrcReg, BasePtrReg));
}
for (MCRegister Reg : MFI->WWMReservedRegs) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D81821.270735.patch
Type: text/x-patch
Size: 1238 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200615/9f5be39a/attachment.bin>
More information about the llvm-commits
mailing list