LLVM Pass for Instructions in Function (error

Oh sorry that was a typo. it’s just getOperand (0). This is in order to get the first operand of getelementptr, which is the base address pointer (%A in your listing). Now as I can see that you want to store ptrA in some data structure; you can just store the Inst instead as the virtual register ptrA itself represent the instruction.