fallback: translate: call llvm.vector.reduce.add.nxv2i32

Run:explore-bc8218b282-20261015-075519
Kind:fallback
Category:translate: call llvm.vector.reduce.add.nxv2i32
Occurrences:6 in 1 configs, 1 test files
Snippet from:machinelicm-constant-phys-reg.ll @test via llvm-extract
Config:-O3 -mtriple=riscv64 -mattr=+v
Local check:reproduces at bc8218b282
Compiler Explorer:not uploaded (over --godbolt-limit or disabled)

Snippet:

define i32 @test(ptr %a, i64 %n) {
entry:
  br label %loop

loop:                                             ; preds = %loop, %entry
  %indvar = phi i64 [ 0, %entry ], [ %indvar.inc, %loop ]
  %sum = phi i32 [ 0, %entry ], [ %sum.inc, %loop ]
  %idx = getelementptr inbounds ptr, ptr %a, i64 %indvar
  %data = load <vscale x 2 x i32>, ptr %idx, align 8
  %reduce = tail call i32 @llvm.vector.reduce.add.nxv2i32(<vscale x 2 x i32> %data)
  %sum.inc = add i32 %reduce, %reduce
  %indvar.inc = add i64 %indvar, 1
  %cmp = icmp eq i64 %indvar.inc, %n
  br i1 %cmp, label %exit, label %loop

exit:                                             ; preds = %loop
  ret i32 %sum
}

; Function Attrs: nocallback nocreateundeforpoison nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.nxv2i32(<vscale x 2 x i32>) #0

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

Reproduce:

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

Local llc output:

remark: <unknown>:0:0: unable to translate instruction: call llvm.vector.reduce.add.nxv2i32: '  %reduce = tail call i32 @llvm.vector.reduce.add.nxv2i32(<vscale x 2 x i32> %data)' (in function: test)
warning: Instruction selection used fallback path for test

Occurrences (6):

InputFunctionConfig
machinelicm-constant-phys-reg.lltest-O3 -mtriple=riscv64 -mattr=+v
machinelicm-constant-phys-reg.3b2764c4ed.ll (mutant of machinelicm-constant-phys-reg.ll)test-O3 -mtriple=riscv64 -mattr=+v
machinelicm-constant-phys-reg.4f933e6fd3.ll (mutant of machinelicm-constant-phys-reg.ll)test-O3 -mtriple=riscv64 -mattr=+v
machinelicm-constant-phys-reg.c2a6647055.ll (mutant of machinelicm-constant-phys-reg.ll)test-O3 -mtriple=riscv64 -mattr=+v
machinelicm-constant-phys-reg.d5a331f6b3.ll (mutant of machinelicm-constant-phys-reg.ll)test-O3 -mtriple=riscv64 -mattr=+v
machinelicm-constant-phys-reg.df0316144a.ll (mutant of machinelicm-constant-phys-reg.ll)test-O3 -mtriple=riscv64 -mattr=+v

Generated 2026-10-15 08:05 UTC.