Previously, we counted TotalMemInst by reading certain instruction counters before and after calling visit and then finding the difference. But that wouldn't be thread safe if this same pass was being ran on multiple threads.
This list of "memory instructions" doesn't make sense to me as it includes call/invoke and is missing atomics.
This patch removes the counter all together.
This seems... a little crazy.
First off, we don't need to increment TotalInsts here. You can just override visitInstruction and teach this to delegate to the base class after incrementing the opcode specific counter. But maybe that doesn't really matter...
But the whole point of InstVisitor is to avoid these long || chains. =[
And what even is a "memory instruction"? Why is a call a memory instruction even if it is calling an LLVM intrinsic? I know you didn't add any of this, but it seems somewhat crazy to bend over backwards to keep it.
How about just deleting the TotalMemInst statistic entirely until someone comes back with a specific use case?