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

            Bug ID: 27327
           Summary: Arguments converted to WASM .S incorrectly by LLC
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: WebAssembly
          Assignee: unassignedb...@nondot.org
          Reporter: gareth_morga...@hotmail.com
                CC: llvm-bugs@lists.llvm.org
    Classification: Unclassified

Created attachment 16207
  --> https://llvm.org/bugs/attachment.cgi?id=16207&action=edit
The input LL and output S

The attached .LL file will be incorrectly converted to .s by WASM back end.

Specifically on line 3566
%call16 = call zeroext i1
@_ZN22MarchingSquaresFunctorI4Vec414MSVec4AccessorE3RunERKiS4_(%class.MarchingSquaresFunctor*
nonnull %f, i32* nonnull dereferenceable(4) %i, i32* nonnull dereferenceable(4)
%j)


This gets converted to this code in the .s. Where the constants 4 and 8 are
passed in as addresses. These should be __stackPointer+4 and __stackPointer+8:
    i32.const    $18=, 4
    i32.add     $18=, $18, $18
    i32.const    $19=, 8
    i32.add     $19=, $18, $19
    i32.call    $discard=,
_ZN22MarchingSquaresFunctorI4Vec414MSVec4AccessorE3RunERKiS4_@FUNCTION, $1,
$18, $19

Compiled with following command line:
LLC Ashara.opt.ll -o Ashara.s -mtriple="wasm32-unknown-unknown"

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to