[llvm-bugs] [Bug 49467] New: [FastISel] Incorrect trivial kill for extractvalue

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Mar 7 08:06:23 PST 2021


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

            Bug ID: 49467
           Summary: [FastISel] Incorrect trivial kill for extractvalue
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Common Code Generator Code
          Assignee: unassignedbugs at nondot.org
          Reporter: nikita.ppv at gmail.com
                CC: llvm-bugs at lists.llvm.org

declare { i8*, i64 } @get()

declare void @use(i8*, i64)

define void @test(i64* %p) {
  %struct = call { i8*, i64 } @get()
  %struct.1 = extractvalue { i8*, i64 } %struct, 1
  store i64 %struct.1, i64* %p, align 8
  %struct.2 = extractvalue { i8*, i64 } %struct, 1
  call void @use(i8* undef, i64 %struct.2)
  ret void
}   

llc -O0 -verify-machineinstr

# After Instruction Selection
# Machine code for function test: IsSSA, TracksLiveness
Function Live Ins: $rdi in %0

bb.0 (%ir-block.0):
  liveins: $rdi
  %0:gr64 = COPY $rdi
  %1:gr64 = COPY killed %0:gr64
  ADJCALLSTACKDOWN64 0, 0, 0, implicit-def $rsp, implicit-def $eflags,
implicit-def $ssp, implicit $rsp, implicit $ssp
  CALL64pcrel32 target-flags(x86-plt) @get, <regmask $bh $bl $bp $bph $bpl $bx
$ebp $ebx $hbp $hbx $rbp $rbx $r12 $r13 $r14 $r15 $r12b $r13b $r14b $r15b
$r12bh $r13bh $r14bh $r15bh $r12d $r13d $r14d $r15d $r12w $r13w $r14w $r15w
$r12wh and 3 more...>, implicit $rsp, implicit $ssp, implicit-def $rax,
implicit-def $rdx
  ADJCALLSTACKUP64 0, 0, implicit-def $rsp, implicit-def $eflags, implicit-def
$ssp, implicit $rsp, implicit $ssp
  %7:gr64 = COPY $rax
  %8:gr64 = COPY $rdx
  MOV64mr %1:gr64, 1, $noreg, 0, $noreg, killed %8:gr64 :: (store 8 into %ir.p)
  %2:gr64 = IMPLICIT_DEF
  ADJCALLSTACKDOWN64 0, 0, 0, implicit-def $rsp, implicit-def $eflags,
implicit-def $ssp, implicit $rsp, implicit $ssp
  $rdi = COPY %2:gr64
  $rsi = COPY %8:gr64
  CALL64pcrel32 target-flags(x86-plt) @use, <regmask $bh $bl $bp $bph $bpl $bx
$ebp $ebx $hbp $hbx $rbp $rbx $r12 $r13 $r14 $r15 $r12b $r13b $r14b $r15b
$r12bh $r13bh $r14bh $r15bh $r12d $r13d $r14d $r15d $r12w $r13w $r14w $r15w
$r12wh and 3 more...>, implicit $rsp, implicit $ssp, implicit $rdi, implicit
$rsi
  ADJCALLSTACKUP64 0, 0, implicit-def $rsp, implicit-def $eflags, implicit-def
$ssp, implicit $rsp, implicit $ssp
  RETQ

# End machine code for function test.

*** Bad machine code: Using a killed virtual register ***
- function:    test
- basic block: %bb.0  (0x55d0628ed128)
- instruction: $rsi = COPY %8:gr64
- operand 1:   %8:gr64
LLVM ERROR: Found 1 machine code errors.

-- 
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/20210307/d54923fc/attachment.html>


More information about the llvm-bugs mailing list