panic when trying to load module with SIMD vector operations into GHCi
Steps to reproduce
Load the following module into GHCi:
{-# LANGUAGE UnboxedTuples, MagicHash #-}
import GHC.Exts
main = print $ case unpackDoubleX2# (broadcastDoubleX2# 4.4##) of
(# a, b #) -> (D# a, D# b)
this results in
panic! (the 'impossible' happened)
GHC version 9.3.20210802:
GHC.StgToByteCode.findPushSeq
The same thing happens when trying to define main
inside of GHCi.
Expected behavior
Ideally, GHCi should be able to load the module without issue (except for, possibly, a warning that it won't be able to run code containing SIMD operations), and only once the user actually attempts to evaluate an expression that relies on SIMD operations should a runtime error occur.
If that's not possible, then, when loading the module, a more helpful error message should appear, somewhat similar to the one that appears when trying to compile the module with ghc:
ghc: sorry! (unimplemented feature or known bug)
GHC version 9.3.20210802:
SIMD vector instructions require the LLVM back-end.
Please use -fllvm.
Environment
- GHC version used:
9.3.20210802
Optional:
- Operating System: Arch Linux
- System Architecture: x86_64