LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 52350 - Failure to select SIMD instructions for wasm64-unknown-unknown
Summary: Failure to select SIMD instructions for wasm64-unknown-unknown
Status: NEW
Alias: None
Product: libraries
Classification: Unclassified
Component: Backend: WebAssembly (show other bugs)
Version: trunk
Hardware: PC All
: P enhancement
Assignee: Unassigned LLVM Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-29 08:18 PDT by Alex Crichton
Modified: 2021-11-03 15:37 PDT (History)
3 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Crichton 2021-10-29 08:18:53 PDT
I was curious to poke around at wasm64-unknown-unknown support for Rust recently and I ran into a crash with SIMD test cases which I was able to reduce to:



target triple = "wasm64-unknown-unknown"

define void @foo(<4 x i32> * %a, i32* %b) #0 {
  store <4 x i32> zeroinitializer, <4 x i32>* %a, align 16
  %1 = load <4 x i32>, <4 x i32>* %a, align 16
  %2 = extractelement <4 x i32> %1, i32 0
  store i32 %2, i32* %b, align 4
  ret void
}

attributes #0 = { "target-features"="+simd128" }




which crashes with:

$ llc -filetype=obj -O2 -o foo.o ./bugpoint-reduced-simplified.ll
LLVM ERROR: Cannot select: t11: i32 = extract_vector_elt t6, Constant:i64<0>
  t6: v4i32 = BUILD_VECTOR Constant:i32<0>, Constant:i32<0>, Constant:i32<0>, Constant:i32<0>
    t5: i32 = Constant<0>
    t5: i32 = Constant<0>
    t5: i32 = Constant<0>
    t5: i32 = Constant<0>
  t7: i64 = Constant<0>
In function: foo
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.
Stack dump:
0.      Program arguments: ../rust/build/aarch64-unknown-linux-gnu/llvm/bin/llc -filetype=obj -O2 -o foo.o ./bugpoint-reduced-simplified.ll
1.      Running pass 'Function Pass Manager' on module './bugpoint-reduced-simplified.ll'.
2.      Running pass 'WebAssembly Instruction Selection' on function '@foo'
Comment 1 Thomas Lively 2021-11-03 15:37:47 PDT
Thanks for the report! Adding this to my backlog, although it may be a while before I get to it.