diff options
| author | Philip Reames <listmail@philipreames.com> | 2017-06-02 17:02:33 +0000 |
|---|---|---|
| committer | Philip Reames <listmail@philipreames.com> | 2017-06-02 17:02:33 +0000 |
| commit | 0f02bbc6f4f24c71120147a11fc2edd27acc5b6d (patch) | |
| tree | 0e65712c26e17c10e13656fac9ce42db7099c4a4 /llvm/lib/CodeGen/MachineVerifier.cpp | |
| parent | 94cc4a29edb19f000d4020f5a504fd06f9377194 (diff) | |
| download | bcm5719-llvm-0f02bbc6f4f24c71120147a11fc2edd27acc5b6d.tar.gz bcm5719-llvm-0f02bbc6f4f24c71120147a11fc2edd27acc5b6d.zip | |
Verify a couple more fields in STATEPOINT instructions
While doing so, clarify the comments and update them to reflect current reality.
Note: I'm going to let this sit for a week or so before adding further verification. I want to give this time to cycle through bots and merge it into our downstream tree before pushing this further.
llvm-svn: 304565
Diffstat (limited to 'llvm/lib/CodeGen/MachineVerifier.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/MachineVerifier.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineVerifier.cpp b/llvm/lib/CodeGen/MachineVerifier.cpp index d40694ce91e..f6dbf667cf0 100644 --- a/llvm/lib/CodeGen/MachineVerifier.cpp +++ b/llvm/lib/CodeGen/MachineVerifier.cpp @@ -932,6 +932,20 @@ void MachineVerifier::visitMachineInstrBefore(const MachineInstr *MI) { !MI->getOperand(StatepointOpers::NCallArgsPos).isImm()) report("meta operands to STATEPOINT not constant!", MI); break; + + auto VerifyStackMapConstant = [&](unsigned Offset) { + if (!MI->getOperand(Offset).isImm() || + MI->getOperand(Offset).getImm() != StackMaps::ConstantOp || + !MI->getOperand(Offset + 1).isImm()) + report("stack map constant to STATEPOINT not well formed!", MI); + }; + const unsigned VarStart = StatepointOpers(MI).getVarIdx(); + VerifyStackMapConstant(VarStart + StatepointOpers::CCOffset); + VerifyStackMapConstant(VarStart + StatepointOpers::FlagsOffset); + VerifyStackMapConstant(VarStart + StatepointOpers::NumDeoptOperandsOffset); + + // TODO: verify we have properly encoded deopt arguments + }; } |

