First you access an operand you are interested in with instruction->getOperand(i) and then call ->getType() on it. The llvm::Type class has a lot of helper classes and ->isPointerTy() is what you are probably interested in.
c++ - I am getting a pointer type error on llvm - Stack Overflow
Typed pointers support will be dropped in LLVM 17
function - LLVM IR instumentation. how to get the element value the pointer arg is pointing to? - Stack Overflow
Get pointee type from an opaque pointer type in function argument - Loop Optimizations - LLVM Discussion Forums
You want to
get the element/variable that pointer is pointing to
This is also called "dereferencing a pointer". This is not something you can do at compile time, but what you can do is insert an instruction which does the dereferencing - in other words, a load instruction.
You can use load function from IRBuilder package. Here is reference from official llvmlite documentation:
• IRBuilder.load(ptr, name='', align=None) Load value from pointer ptr. If align is passed, it should be a Python integer specifying the guaranteed pointer alignment.