[llvm-dev] How can I get which are the instructions are using this register(%4:gpr32)

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Mon Apr 8 05:48:42 PDT 2019


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.


More information about the llvm-dev mailing list