Removing Intrinsic Functions

There are a few instrinsic functions I would like to remove, is this possible? For example, the llvm.lifetime and llvm.dbg instrinsics?

You can’t simply iterate over the funciton and remove the call instructions, this causes issues. Is there a known structured way of doing this?

You could compare against the name of the intrinsic before you delete it and isa<DbgInfoIntrinsic>.

-eric