Ramakota Reddy via llvm-dev
2019-Apr-08 12:42 UTC
[llvm-dev] How can I get which are the instructions are using this register(%4:gpr32)
Hi All, I have instruction like below %4:gpr32 = MOVi32imm 6553600 Here MI->getOperand(0).isOnRegUseList() API is returning true. But I want to know that which are the instructions are using this register(%4:gpr32) in current BB and Dominator Tree Basic Blocks. How can I get which are the instructions are using this register(%4:gpr32)? Could any one please give your suggestions. Thanks & Regards, Ramakota. IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190408/24670cad/attachment.html>
Tim Northover via llvm-dev
2019-Apr-08 12:48 UTC
[llvm-dev] How can I get which are the instructions are using this register(%4:gpr32)
Hi Ramakota, On Mon, 8 Apr 2019 at 14:42, Ramakota Reddy via llvm-dev <llvm-dev at lists.llvm.org> wrote:> But I want to know that which are the instructions are using this register(%4:gpr32) in current BB and Dominator Tree Basic Blocks. > > How can I get which are the instructions are using this register(%4:gpr32)?MachineRegisterInfo::use_begin and related functions (especially use_instructions) let you iterate through the uses of a virtual register. Physical registers are a lot harder though, so I hope you don't need that. Cheers. Tim.