Reproduction: https://godbolt.org/z/PqK6Y1oa6 ```ll define <4 x float> @foo(i64 %i0, i64 %i1, ptr %p) { %B4 = urem i64 %i0, %i0 %B5 = udiv i64 %i1, %B4 %I = insertelement <4 x float> <float 0.25, float 0.25, float 0.25, float 0.25>, float 0.5, i64 %B5 ret <4 x float> %I } ``` Cause: In [WebAssemblyISelLowering.cpp:2244](https://github.com/llvm/llvm-project/blob/e2630a5b4cd2dd50eec9478cb7a18395b98df238/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp#L2244-#L2251), the UndefValue is also casted into ConstantSDNode, which causes the crash.