fallback: legalize: G_LOAD <4 x s8>,p0

Run:explore-bc8218b282-20261015-075519
Kind:fallback
Category:legalize: G_LOAD <4 x s8>,p0 NEW
Occurrences:1 in 1 configs, 1 test files
Snippet from:rvp-simd-32.684bad5acc.ll (mutant of rvp-simd-32.ll) @test_pmerge_mvmn_i8x4 via llvm-extract
Config:-mtriple=riscv32 -mattr=+experimental-p,+m,+zbb -verify-machineinstrs
Local check:reproduces at bc8218b282
Compiler Explorer:not uploaded (over --godbolt-limit or disabled)

Snippet:

@G.1 = external global i1
@G.2 = external global <4 x i8>

define <4 x i8> @test_pmerge_mvmn_i8x4(<4 x i8> %rs2, <4 x i8> %rs1, <4 x i8> %rd) {
  %A7 = alloca i1, align 1
  store i1 true, ptr %A7, align 1
  %A = alloca i16, align 2
  store i16 -1, ptr %A, align 2
  %L = load i16, ptr %A, align 2
  switch i16 %L, label %SW_D [
    i16 -21999, label %SW_C
    i16 19181, label %SW_C1
    i16 -26455, label %SW_C2
    i16 -12249, label %SW_C3
    i16 -12467, label %SW_C4
  ]

BB:                                               ; preds = %SW_C4, %SW_C3, %SW_C, %SW_D
  %res = call <4 x i8> @llvm.riscv.pmerge.v4i8(<4 x i8> %rs1, <4 x i8> %rs2, <4 x i8> %rd)
  ret <4 x i8> %res

SW_D:                                             ; preds = %SW_D, %0
  %LGV = load i1, ptr @G.1, align 1
  br i1 %LGV, label %BB, label %SW_D

SW_C:                                             ; preds = %0
  br label %BB

SW_C1:                                            ; preds = %0
  %LGV5 = load <4 x i8>, ptr @G.2, align 4
  ret <4 x i8> %LGV5

SW_C2:                                            ; preds = %0
  %LGV6 = load <4 x i8>, ptr @G.2, align 4
  ret <4 x i8> zeroinitializer

SW_C3:                                            ; preds = %SW_C3, %0
  %L8 = load i1, ptr %A7, align 1
  br i1 %L8, label %SW_C3, label %BB

SW_C4:                                            ; preds = %0
  br label %BB
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i8> @llvm.riscv.pmerge.v4i8(<4 x i8>, <4 x i8>, <4 x i8>) #0

attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

Reproduce:

llc -mtriple=riscv32 -mattr=+experimental-p,+m,+zbb -verify-machineinstrs -global-isel -global-isel-abort=2 -pass-remarks-missed=gisel.* snippet.ll -o -
llc -mtriple=riscv32 -mattr=+experimental-p,+m,+zbb -verify-machineinstrs -global-isel=0 snippet.ll -o -

Local llc output:

remark: <unknown>:0:0: unable to legalize instruction: %25:_(<4 x s8>) = G_LOAD %22:_(p0) :: (dereferenceable load (<4 x s8>) from @G.2) (in function: test_pmerge_mvmn_i8x4)
warning: Instruction selection used fallback path for test_pmerge_mvmn_i8x4

Occurrences (1):

InputFunctionConfig
rvp-simd-32.684bad5acc.ll (mutant of rvp-simd-32.ll)test_pmerge_mvmn_i8x4-mtriple=riscv32 -mattr=+experimental-p,+m,+zbb -verify-machineinstrs

Generated 2026-10-15 08:05 UTC.