This is a barebones patch that enables the invoking of llvm.experimental.patchpoint intrinsics; it's missing some things (tests, should refactor the existing code instead of duplicating more of it), but I wanted to send out the current version for early feedback.
I tried to just take the invoke-handling sections from the normal Invoke path and add them to patchpoints, and it seems to work (LLVM and Pyston tests pass), but it's hard for me to verify that I'm doing this correctly and that it's not missing anything.
There might also need to be some discussion about whether it makes sense to invoke patchpoints in the first place -- I think it definitely makes sense to attach stackmap information to an invoke, but patching and statically emitting EH information might not be coherent concepts, though on my system it ends up working out fine.
Extremely minor, but a code pattern of:
if ( is intrinsic)
Would be more idiomatic and easier to extend.