[LLVMbugs] [Bug 21266] New: Stackmaps liveness analysis can determine RIP is live

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Oct 13 15:48:01 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=21266

            Bug ID: 21266
           Summary: Stackmaps liveness analysis can determine RIP is live
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Common Code Generator Code
          Assignee: unassignedbugs at nondot.org
          Reporter: kmod at dropbox.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 13199
  --> http://llvm.org/bugs/attachment.cgi?id=13199&action=edit
Test case -- reproduce with "llc rip.ll"

Here's a snippet of the machine ir before stackmaps liveness analysis:

BB#1: derived from LLVM BB %1, Align 4 (16 bytes)
    Live Ins: %RBP
    Predecessors according to CFG: BB#1 BB#0
        PATCHPOINT 30697712, 13, 8441600, 0, 0, <regmask>, %RSP<imp-def>,
%RAX<imp-def,dead>, ...
        %RAX<def> = MOV64rm %RIP, 1, %noreg, <ga:@edgecount>, %noreg;
mem:LD8[@edgecount]
        %RAX<def,tied1> = INC64r %RAX<kill,tied0>, %EFLAGS<imp-def,dead>
        CMP64ri32 %RAX<kill>, 10001, %EFLAGS<imp-def>
        JL_4 <BB#1>, %EFLAGS<imp-use,kill>
    Successors according to CFG: BB#2(4) BB#1(124)

And here's what happens in stackmap liveness:

********** COMPUTING STACKMAP LIVENESS: f_e1_1 **********
[snip]
****** BB  ******
   Live Registers: %RBP %EBP %BP %BPL
   JL_4 <BB#1>, %EFLAGS<imp-use,kill>
   Live Registers: %RBP %EBP %BP %BPL %EFLAGS
   CMP64ri32 %RAX<kill>, 10001, %EFLAGS<imp-def>
   Live Registers: %RBP %EBP %BP %BPL %RAX %EAX %AX %AL %AH
   %RAX<def,tied1> = INC64r %RAX<kill,tied0>, %EFLAGS<imp-def,dead>
   Live Registers: %RBP %EBP %BP %BPL %RAX %EAX %AX %AL %AH
   %RAX<def> = MOV64rm %RIP, 1, %noreg, <ga:@edgecount>, %noreg;
mem:LD8[@edgecount]
   Live Registers: %RBP %EBP %BP %BPL %RIP %EIP %IP
   PATCHPOINT 30697712, 13, 8441600, 0, 0, <regmask>, <regliveout>,
%RSP<imp-def>, %RAX<imp-def,dead>, ...
[snip]
llc:
/opt/kmod_unenc/pyston_deps/llvm-test/lib/CodeGen/TargetRegisterInfo.cpp:124:
const llvm::TargetRegisterClass*
llvm::TargetRegisterInfo::getMinimalPhysRegClass(unsigned int, llvm::EVT)
const: Assertion `BestRC && "Couldn't find the register class"' failed.

It looks like the stackmaps liveness analysis is seeing the RIP-relative load
as a usage of %RIP that establishes its liveness, which causes the stackmap
emission to fail.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20141013/541bed7e/attachment.html>


More information about the llvm-bugs mailing list