Finding the last producer of a register value

I have a question which might be repetitive to some extent, but I’d be greatful if anyone can give me a clear answer. I have worked with LLVM front-end. There, it is easy to find def-use chain for IR instructions using USER::op_iterator and Value::use_iterator.
Now I want to do some analysis on the machine code in the backend, for which I need to find this def-use chain again. What I need is basically to get a source register of one instruction and identify the last instruction that defines its value.
I read in the forum that MachineRegisterInfo::defusechain_iterators can be used to find all define and use of a register, and yet they might not be in order of the their appearance in the machine function. It’s a bit strange to me, since providing an easy tool for this purpose seems necessary to me for creating multiple code optimizations. Could you please tell me if there is a way (perhaps in the newer versions) to do this analysis with low complexity?

Thank you in advance,