[llvm-bugs] [Bug 30832] New: Can't fold a reload if spill size doesn't match use size

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Oct 28 12:45:46 PDT 2016


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

            Bug ID: 30832
           Summary: Can't fold a reload if spill size doesn't match use
                    size
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: mkuper at google.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

This is something we currently explicitly don't do because targets aren't
required to support it (InlinerSpiller::foldMemoryOperand()).

So for:

target triple = "x86_64-unknown-linux-gnu"

define i32 @foo(i64 %add, i32 %ret) {
entry:
  tail call void asm sideeffect "",
"~{rax},~{rbx},~{rcx},~{rdx},~{rdi},~{rbp},~{r8},~{r9},~{r10},~{r11},~{r12},~{r13},~{r14},~{r15},~{dirflag},~{fpsr},~{flags}"()
  %conv3 = zext i32 %ret to i64
  %sub = sub i64 %conv3, %add
  %conv1 = trunc i64 %sub to i32
  ret i32 %conv1
}

we generate:

[...]
    movq    %rdi, -8(%rsp)          # 8-byte Spill
    movq    -8(%rsp), %rax          # 8-byte Reload
    subl    %eax, %esi
[...]

The same also happens for vector registers (spill ymm, reload ymm, use xmm).

-- 
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/20161028/fd75b741/attachment.html>


More information about the llvm-bugs mailing list