fallback: translate: call llvm.vector.reduce.add.nxv2i32
| Run: | main-04ca53e65f-20261014-113325 |
| 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 04ca53e65f |
| 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):
Generated 2026-10-15 08:05 UTC.