[PATCH] D94483: [Verifier] Add tied-ness verification to statepoint intsruction
Serguei Katkov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 12 03:04:01 PST 2021
skatkov created this revision.
skatkov added reviewers: reames, dantrushin.
Herald added a subscriber: hiraditya.
skatkov requested review of this revision.
Herald added a project: LLVM.
https://reviews.llvm.org/D94483
Files:
llvm/lib/CodeGen/MachineVerifier.cpp
Index: llvm/lib/CodeGen/MachineVerifier.cpp
===================================================================
--- llvm/lib/CodeGen/MachineVerifier.cpp
+++ llvm/lib/CodeGen/MachineVerifier.cpp
@@ -1663,6 +1663,21 @@
VerifyStackMapConstant(SO.getNumAllocaIdx());
VerifyStackMapConstant(SO.getNumGcMapEntriesIdx());
+ // Verify that all explicit statepoint defs are tied to gc operands as
+ // they are expected to be a relocation of gc operands.
+ unsigned FirstGCPtrIdx = SO.getFirstGCPtrIdx();
+ for (unsigned Idx = 0; Idx < MI->getNumDefs(); Idx++) {
+ unsigned UseOpIdx;
+ if (!MI->isRegTiedToUseOperand(Idx, &UseOpIdx)) {
+ report("STATEPOINT defs expected to be tied", MI);
+ break;
+ }
+ if (UseOpIdx < FirstGCPtrIdx) {
+ report("STATEPOINT def tied to non-gc operand", MI);
+ break;
+ }
+ }
+
// TODO: verify we have properly encoded deopt arguments
} break;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D94483.316037.patch
Type: text/x-patch
Size: 960 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210112/7032e4c8/attachment.bin>
More information about the llvm-commits
mailing list