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

            Bug ID: 43467
           Summary: handleMoveUp fails to properly update main range when
                    subregister def moved across another subregister def
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Common Code Generator Code
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]

Created attachment 22579
  --> https://bugs.llvm.org/attachment.cgi?id=22579&action=edit
Patch adding failing tests

./unittests/MI/MITests --gtest_filter=LiveIntervalTest.TestMoveSubRegNotCovered
********** INTERVALS **********
%1 [16r,32B:1)[32B,56r:3)[56r,64r:0)[80r,144B:2)  0@56r 1@16r 2@80r 3@32B-phi
L00000001 [16r,32B:1)[32B,64r:2)[80r,144B:0)  0@80r 1@16r 2@32B-phi L00000002
[16r,16d:1)[56r,112r:0)  0@56r 1@16r weight:0.000000e+00
%2 [48r,80r:0)  0@48r weight:0.000000e+00
%3 [64r,64d:0)  0@64r weight:0.000000e+00
RegMasks:
********** MACHINEINSTRS **********
# Machine code for function func: NoPHIs

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

16B       %1:vreg_64 = IMPLICIT_DEF

32B     bb.1:
        ; predecessors: %bb.0, %bb.1
          successors: %bb.1(0x80000000); %bb.1(100.00%)

48B       %2:vgpr_32 = V_MOV_B32_e32 2, implicit $exec
56B       %1.sub1:vreg_64 = COPY %2:vgpr_32
64B       dead %3:vgpr_32 = V_ADD_U32_e32 %2:vgpr_32, %1.sub0:vreg_64, implicit
$exec
80B       %1.sub0:vreg_64 = V_ADD_U32_e32 %2:vgpr_32, %2:vgpr_32, implicit
$exec
112B      S_NOP 0, implicit %1.sub1:vreg_64
128B      S_BRANCH %bb.1

# End machine code for function func.

*** Bad machine code: A Subrange is not covered by the main range ***
- function:    func
- interval:    %1 [16r,32B:1)[32B,56r:3)[56r,64r:0)[80r,144B:2)  0@56r 1@16r
2@80r 3@32B-phi L00000001 [16r,32B:1)[32B,64r:2)[80r,144B:0)  0@80r 1@16r
2@32B-phi L00000002 [16r,16d:1)[56r,112r:0)  0@56r 1@16r weight:0.000000e+00
LLVM ERROR: Found 1 machine code errors.

Attached is a patch adding the original test case, and 2 variants of reduced
unit tests.

This subreg def is moved up across another subregister use and def.
    %1.sub1:vreg_64 = COPY %2


The computed main range is incorrect at [56r,64r:0). This ends an instruction
too early, and should reach 80r since the def in the second add counts as a use

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to