[llvm-bugs] [Bug 39827] New: [x86, GlobalIsel] crash with undef operand

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Nov 28 09:21:38 PST 2018


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

            Bug ID: 39827
           Summary: [x86, GlobalIsel] crash with undef operand
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: spatel+llvm at rotateright.com
                CC: craig.topper at gmail.com, llvm-bugs at lists.llvm.org,
                    llvm-dev at redking.me.uk, spatel+llvm at rotateright.com

define i16 @add_undef(i16 %a) {
  %r = add i16 %a, undef
  ret i16 %r
}

$ llc -o - -global-isel undef.ll 
        .section        __TEXT,__text,regular,pure_instructions
        .macosx_version_min 10, 14

# Machine code for function test2: NoPHIs, TracksLiveness, Legalized,
RegBankSelected, Selected

bb.0 (%ir-block.0):
  liveins: $edi
  %1:gr32 = COPY killed $edi
  %0:gr16 = COPY %1.sub_16bit:gr32
  %5:gr64_nosp = IMPLICIT_DEF
  %5.sub_16bit:gr64_nosp = COPY %0:gr16
  %6:gr64_nosp = IMPLICIT_DEF
  %6.sub_16bit:gr64_nosp = COPY %2:gr16
  %4:gr32 = LEA64_32r killed %5:gr64_nosp, 1, killed %6:gr64_nosp, 0, $noreg
  %3:gr16 = COPY killed %4.sub_16bit:gr32
  $ax = COPY killed %3:gr16
  RET 0, implicit killed $ax

# End machine code for function test2.

*** Bad machine code: Reading virtual register without a def ***
- function:    test2
- basic block: %bb.0  (0x7fc56988bb40)
- instruction: %6.sub_16bit:gr64_nosp = COPY %2:gr16
- operand 1:   %2:gr16
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/20181128/0aa140ea/attachment.html>


More information about the llvm-bugs mailing list