fallback: legalize: G_INTRINSIC_W_SIDE_EFFECTS <4 x s8>,p0,<4 x s1>,s64,s8

Run:main-04ca53e65f-20261014-113325
Kind:fallback
Category:legalize: G_INTRINSIC_W_SIDE_EFFECTS <4 x s8>,p0,<4 x s1>,s64,s8 NEW
Occurrences:1 in 1 configs, 1 test files
Snippet from:stack-protector-vector-clobber.985d61703e.ll (mutant of stack-protector-vector-clobber.ll) @test_stack_protector_with_vector_clobber via llvm-extract
Config:-mtriple=riscv64 -mattr=+v
Local check:reproduces at 04ca53e65f
Compiler Explorer:not uploaded (over --godbolt-limit or disabled)

Snippet:

@G = external global i32
@G.1 = external global ptr
@G.2 = external global <8 x i8>
@G.3 = external global i128

; Function Attrs: noinline nounwind
define range(i64 0, -9223372036854775808) i64 @test_stack_protector_with_vector_clobber(ptr nofree noundef %0) #0 {
  %2 = load i64, ptr %0, align 8
  %3 = tail call i64 asm sideeffect "", "={x7},{x7}"(i64 %2)
  %4 = icmp slt i64 %3, 2
  br i1 %4, label %7, label %5

5:                                                ; preds = %1
  %LGV3 = load i128, ptr @G.3, align 4
  %LGV2 = load <8 x i8>, ptr @G.2, align 8
  %S = shufflevector <8 x i8> splat (i8 127), <8 x i8> %LGV2, <8 x i32> poison
  %6 = tail call <vscale x 8 x i64> @llvm.riscv.vle.nxv8i64.p0.i64(<vscale x 8 x i64> poison, ptr nonnull %0, i64 8)
  tail call void asm sideeffect "", "~{v0},~{v1},~{v2},~{v3},~{v4},~{v5},~{v6},~{v7},~{v8},~{v9},~{v10},~{v11},~{v12},~{v13},~{v14},~{v15},~{v16},~{v17},~{v18},~{v19},~{v20},~{v21},~{v22},~{v23},~{v24},~{v25},~{v26},~{v27},~{v28},~{v29},~{v30},~{v31},~{memory}"()
  %C = icmp ult i128 18446744073709551616, %LGV3
  tail call void @llvm.riscv.vse.nxv8i64.p0.i64(<vscale x 8 x i64> %6, ptr nonnull %0, i64 8)
  store <8 x i8> %S, ptr poison, align 8
  store i1 %C, ptr poison, align 1
  br label %7

7:                                                ; preds = %5, %1
  %8 = phi i64 [ %3, %5 ], [ 0, %1 ]
  %LGV = load i32, ptr @G, align 4
  %G = getelementptr <2 x i64>, ptr %0, i32 %LGV
  store ptr %G, ptr @G.1, align 8
  ret i64 %8
}

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: read)
declare <vscale x 8 x i64> @llvm.riscv.vle.nxv8i64.p0.i64(<vscale x 8 x i64>, ptr captures(none), i64) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: write)
declare void @llvm.riscv.vse.nxv8i64.p0.i64(<vscale x 8 x i64>, ptr captures(none), i64) #2

attributes #0 = { noinline nounwind "probe-stack"="inline-asm" "stack-protector-buffer-size"="8" "target-cpu"="generic-rv64" "target-features"="+v" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: read) }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: write) }

Reproduce:

llc -mtriple=riscv64 -mattr=+v -global-isel -global-isel-abort=2 -pass-remarks-missed=gisel.* snippet.ll -o -
llc -mtriple=riscv64 -mattr=+v -global-isel=0 snippet.ll -o -

Local llc output:

remark: <unknown>:0:0: unable to legalize instruction: G_INTRINSIC_W_SIDE_EFFECTS intrinsic(@llvm.riscv.seg2.store.mask), %14:_(<4 x s8>), %17:_(<4 x s8>), %18:_(p0), %19:_(<4 x s1>), %21:_(s64) :: (store (s8) into `ptr poison`) (in function: test_stack_protector_with_vector_clobber)
warning: Instruction selection used fallback path for test_stack_protector_with_vector_clobber

Occurrences (1):

InputFunctionConfig
stack-protector-vector-clobber.985d61703e.ll (mutant of stack-protector-vector-clobber.ll)test_stack_protector_with_vector_clobber-mtriple=riscv64 -mattr=+v

Generated 2026-10-15 08:05 UTC.