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

            Bug ID: 23772
           Summary: [AArch64] r226200 can emit illegal thumb2 instruction:
                    "sub sp, r12, #80"
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected]
    Classification: Unclassified

r226200 allows coalescing into SP but missed a corner case:

  %vreg907<def> = COPY %SP; GPRnopc:%vreg907
  %vreg908<def> = t2SUBri %vreg907, 80, pred:14, pred:%noreg, opt:%noreg;
GPRnopc:%vreg908,%vreg907
  %SP<def> = COPY %vreg908; GPRnopc:%vreg908

When %vreg908 is coalesced into SP but %vreg907 is not, it's likely to emit an
illegal instruction:

        sub sp, r12, #80

In Thumb2, we can only use SP as Rd if and only if Rn is also SP. This patch,
when trying remove "%SP<def> = COPY %vreg908", checks if %vreg907 is SP
already. If not, be conservative and do not coalesce %vreg908 into SP.

http://reviews.llvm.org/D10287

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to