As the mem2reg pass doesn’t convert LLVM-IR to complete SSA. Different basic blocks may have same variable name on assignment. How can we access the SSA chains in LLV??
If you mean value names, then they are meaningless. Each value represents its definition, some values have operands. For operands, the pointer immediately gives you the definition, for definitions there is use_iterator that will traverse all of its uses.
Also, mem2reg doesn't "convert to SSA". LLVM IR is always in SSA.