[llvm-bugs] [Bug 43433] New: "Virtual register defs don't dominate all uses" error from dead-mi-elim

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Sep 24 08:58:31 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=43433

            Bug ID: 43433
           Summary: "Virtual register defs don't dominate all uses" error
                    from dead-mi-elim
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: jesper.antonsson at ericsson.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org

Created attachment 22564
  --> https://bugs.llvm.org/attachment.cgi?id=22564&action=edit
minimized reproducer for ARM

We start off with:

  bb.0:
    $r0 = MOVi32imm 0
    undef %0.gsub_0 = COPY $r0

  bb.1:
  liveins: $r0
    %0.gsub_0 = ADDrr %0.gsub_0, $r0, 14, $noreg, $noreg
    %0.gsub_1 = COPY $r0

Reproduce with:

llc -verify-machineinstrs -mtriple=arm -o - virtreg.mir
-run-pass=dead-mi-elimination

and get:

bb.0:
  successors: %bb.1(0x80000000); %bb.1(100.00%)

  $r0 = MOVi32imm 0

bb.1:
; predecessors: %bb.0
  liveins: $r0
  %0.gsub_1:gprpair = COPY $r0

# End machine code for function f.

*** Bad machine code: Virtual register defs don't dominate all uses. ***
- function:    f
- v. register: %0


So, gsub_0 writes are removed even though that leaves the gsub_1 write hanging
(a subreg write is a read of the rest of the register).

-- 
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/20190924/31763ca4/attachment-0001.html>


More information about the llvm-bugs mailing list