[llvm-bugs] [Bug 33037] New: [MachineCopyPropagagation] Incorrect dead flag survives

via llvm-bugs llvm-bugs at lists.llvm.org
Mon May 15 02:06:08 PDT 2017


            Bug ID: 33037
           Summary: [MachineCopyPropagagation]  Incorrect dead flag
           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: paulsson at linux.vnet.ibm.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 18438
  --> https://bugs.llvm.org/attachment.cgi?id=18438&action=edit
reduced testcase

In this MBB:

BB#0: derived from LLVM BB %BB
        %V0<def> = VGBM 0
        %V1<def,dead> = COPY %V0
        %V1<def> = COPY %V0
        %V1<def,tied1> = VLEIH %V1<kill,tied0>, 0, 1
        %V0<def> = VCEQH %V1<kill>, %V0<kill>
        %R1D<def> = LARL <cp#0>
        %V1<def> = VL %R1D<kill>, 0, %noreg; mem:LD16[ConstantPool](align=8)
        %V0<def,dead> = VPERM %V0<kill>, %V0<undef>, %V1<kill>

, the first COPY of %V0 to %V1 has a dead flag, while the second one doesn't.

The optimization seems to think the second COPY is redundant, and calls
eraseIfRedundant(). Afterwards, this results in:

        %V1<def,dead> = COPY %V0
        %V1<def,tied1> = VLEIH %V1<kill,tied0>, 0, 1

*** Bad machine code: Using an undefined physical register ***
- function:    autogen_SD11756
- basic block: BB#0 BB (0x3c90be8)
- instruction: %V1<def,tied1> = VLEIH
- operand 1:   %V1<kill,tied0>

Somehow, the dead flag should have been removed.

Run line: llc -O3 -mtriple=s390x-linux-gnu -mcpu=z13 -verify-machineinstrs
-disable-cgp -pre-RA-sched=source -disable-machine-dce
-join-liveintervals=false  -o /dev/null ./tc_mcp_undefphysreg.ll

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/20170515/e0e08209/attachment.html>

More information about the llvm-bugs mailing list