I’m looking for a way to distinguish “this” from other pointers and wonder how to tell the difference in LLVM. Any pointer is appreciated.
What are you trying to do? There are no “this” pointers in IR. There are just regular pointers, so there is no difference. If you compile from C++, it’s usually passed as an implicit first argument (that’s also noundef, nonnull and dereferenceable), but there is nothing special about it in IR. You can try compiling a few simple C++ snippets to IR to get a better understanding: Compiler Explorer (you can notice that there is virtually no difference between
If its type matches, any pointer can be
this I think - would there be a specific optimization for