<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - arm64 global isel: LLVM ERROR: unable to legalize instruction: %2:_(s16), %3:_(s1) = G_UADDO %1:_, %4:_ (in function: slice)"
   href="https://bugs.llvm.org/show_bug.cgi?id=43981">43981</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>arm64 global isel: LLVM ERROR: unable to legalize instruction: %2:_(s16), %3:_(s1) = G_UADDO %1:_, %4:_ (in function: slice)
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>regehr@cs.utah.edu
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org, nunoplopes@sapo.pt
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I'm seeing some crashes when trying to compile small functions to arm64 using
global isel. This is on Ubuntu 18.04 and the LLVM is from Nov 11. 

If these bugs aren't interesting please let me know.



$ cat w16r1_1376-stripped.ll 
; ModuleID = '<stdin>'
source_filename = "w16r1_1376.ll"

define i64 @slice(i64) {
  %2 = trunc i64 %0 to i16
  %3 = add nsw i16 %2, 2
  %4 = icmp ult i16 %3, %2
  %5 = zext i1 %4 to i64
  ret i64 %5
}

$ llc -march=arm64 -global-isel w16r1_1376-stripped.ll 
LLVM ERROR: unable to legalize instruction: %2:_(s16), %3:_(s1) = G_UADDO %1:_,
%4:_ (in function: slice)

$ llc --version
LLVM (<a href="http://llvm.org/">http://llvm.org/</a>):
  LLVM version 10.0.0git
  Optimized build.
  Default target: x86_64-unknown-linux-gnu
  Host CPU: broadwell

  Registered Targets:
    aarch64    - AArch64 (little endian)
    aarch64_32 - AArch64 (little endian ILP32)
    aarch64_be - AArch64 (big endian)
    amdgcn     - AMD GCN GPUs
    arm        - ARM
    arm64      - ARM64 (little endian)
    arm64_32   - ARM64 (little endian ILP32)
    armeb      - ARM (big endian)
    bpf        - BPF (host endian)
    bpfeb      - BPF (big endian)
    bpfel      - BPF (little endian)
    hexagon    - Hexagon
    lanai      - Lanai
    mips       - MIPS (32-bit big endian)
    mips64     - MIPS (64-bit big endian)
    mips64el   - MIPS (64-bit little endian)
    mipsel     - MIPS (32-bit little endian)
    msp430     - MSP430 [experimental]
    nvptx      - NVIDIA PTX 32-bit
    nvptx64    - NVIDIA PTX 64-bit
    ppc32      - PowerPC 32
    ppc64      - PowerPC 64
    ppc64le    - PowerPC 64 LE
    r600       - AMD GPUs HD2XXX-HD6XXX
    riscv32    - 32-bit RISC-V
    riscv64    - 64-bit RISC-V
    sparc      - Sparc
    sparcel    - Sparc LE
    sparcv9    - Sparc V9
    systemz    - SystemZ
    thumb      - Thumb
    thumbeb    - Thumb (big endian)
    wasm32     - WebAssembly 32-bit
    wasm64     - WebAssembly 64-bit
    x86        - 32-bit X86: Pentium-Pro and above
    x86-64     - 64-bit X86: EM64T and AMD64
    xcore      - XCore
$</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>