[LLVMdev] Inspecting target-specific opcodes in machine function pass

Peter Edelstein peter.c.edelstein at gmail.com
Sat Mar 7 19:54:18 PST 2015


Hi,

I have a basic machine function pass in this fashion:

bool Foo::runOnMachineFunction(MachineFunction &Fn) {
  for (auto &BB : Fn) {
    for (MachineBasicBlock::iterator I = BB.begin(), E = BB.end(); I != E;
++I) {
      if (I->isPseudo())
        continue;
      // inspect opcode of I here
      }
    }
  }
  return true;
}

As the comment suggests I want to inspect the target-specific opcode of
each instruction. By opcode I mean the actual machine code (=encoding of
that in struction as an array of bytes), not the integer descriptor
returned by I->getOpcode().

I don't see how this can be done. Maybe anybody can help.

Cheers,
Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150308/5c39f28f/attachment.html>


More information about the llvm-dev mailing list