This changes implements invoke statepoint verification. It depends on the change in Statepoint.h (http://reviews.llvm.org/D7364) as it uses some of the helper functions form there.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comments inline.
lib/IR/Verifier.cpp | ||
---|---|---|
1862 ↗ | (On Diff #19202) | Add a TODO here. We'd really should be using visitIntrinsicFunctionCall here. So should patchpoint. It just happens that's phrased in CallInst and not worth updating. |
2366 ↗ | (On Diff #19202) | Given the structure of this clause, I'd prefer to see this as a test against the intrinsic id directly. |
2767 ↗ | (On Diff #19202) | IsLandingpad doesn't actually check this is a landing pad? Possibly IsTiedToInvoke? (better: see comment below about organization) Meta comments:
// structural checks only... // call statepoint case } else if (isa<ExtractElementInst>()) { // invoke } else { report error }
|
2798 ↗ | (On Diff #19202) | Please don't use statepoint here. |
test/Verifier/statepoint.ll | ||
55 ↗ | (On Diff #19202) | add: gc "statepoint-example" |
69 ↗ | (On Diff #19202) | Does this extra branch add anything to this test? |
lib/IR/Verifier.cpp | ||
---|---|---|
2772 ↗ | (On Diff #19372) | I'd suggest using dyn_cast here. It will simplify several parts of the following code. |
2787 ↗ | (On Diff #19372) | I think this is checked elsewhere. |
2798 ↗ | (On Diff #19372) | The cast needs to be check in a way you don't crash here. :) auto Op0 = ... |
2806 ↗ | (On Diff #19372) | This can be more cleanly written as: |
Yes, please. Please note that this patch depends on http://reviews.llvm.org/D7364
lib/IR/Verifier.cpp | ||
---|---|---|
2787 ↗ | (On Diff #19372) | It is checked at the visitBasicBlock, but I didn't want to rely on the basic block visiting order. |
2798 ↗ | (On Diff #19202) | In this case it's fine to use ops.statepoint because we already verified that gc relocate is correctly tied to the statepoint. I made this more clear in the updated change. |