[LLVMdev] Splice and undefined physical reg

Johnny Bory johnny.bory.12 at gmail.com
Tue Jul 28 01:52:29 PDT 2015


i have got some troubles while writing an X86 machine pass to instrumentate
indirect calls .
Basically, every time i run into a CALL64r i would like to have this
                | .... |
                | CMP  |
                | JE   |
                  |  |
                ---  -----
                |        |
                ----    ----
               |EXIT|  |CALL|
                ----   |....|
So i do a splice, fix up successors and predecessors, but since the call
implicitly uses some register the compilation fails with a lot of this:

  *** Bad machine code: Using an undefined physical register ***
- function:    foo
- basic block: BB#126 (null) (0x6127658)
- instruction: CALL64r %vreg41, <regmask>, %RSP<imp-use>, %EDI<imp-use>,
%RSI<imp-use>, %RDX<imp-use>, %RCX<imp-use>, %R8<imp-use>, %R9D<imp-use>,
%AL<imp-use>, %RSP<imp-def>, %EAX<imp-def>; GR64:%vreg41

How can i get rid of this errors?

Thank you very much,

-- Jon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150728/d1c6993d/attachment.html>

More information about the llvm-dev mailing list