[llvm-bugs] [Bug 27346] New: 64/32 register mismatch compiling with LLC

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Apr 13 17:24:16 PDT 2016


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

            Bug ID: 27346
           Summary: 64/32 register mismatch compiling with LLC
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: WebAssembly
          Assignee: unassignedbugs at nondot.org
          Reporter: gareth_morgan77 at hotmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

The attached LL file Ashara.opt.ll will generate incorrect .S code for the
function StraightenBlobExterior.

Specifically this code on line 73:

  %0 = load i32, i32* %m_Count.i.i, align 4
  %1 = tail call { i32, i1 } @llvm.umul.with.overflow.i32(i32 %0, i32 12)
  %2 = extractvalue { i32, i1 } %1, 1
  %3 = extractvalue { i32, i1 } %1, 0
  %4 = select i1 %2, i32 -1, i32 %3

Will generate this .s (line 19):
    i64.extend_u/i32    $push2=, $38
    i64.const    $push3=, 12
    i64.mul     $36=, $pop2, $pop3
    i64.const    $18=, 32
    i32.const    $19=, -1
    block
    i64.shr_u    $push5=, $36, $18
    i32.wrap/i64    $push6=, $pop5
    i32.wrap/i64    $push4=, $36
    i32.select    $push7=, $pop6, $19, $pop4

But as register 36 is listed as type i32 in the .locals line for that function
this causes an assert in s2wasm as i64.shr_u expects i64 arguments.

Source code with makefile attached.

-- 
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/20160414/48297068/attachment.html>


More information about the llvm-bugs mailing list