fallback: translate: call llvm.bswap.i32

Run:explore-b577f07195-20261129-105236
Kind:fallback
Category:translate: call llvm.bswap.i32 M
Occurrences:5 in 5 configs, 2 test files, 8 more counted only
Snippet from:bswap-bitreverse.5419cd2d6d.ll (mutant of bswap-bitreverse.ll) @test_bswap_i32 via llvm-extract
Config:-mtriple=riscv64 -verify-machineinstrs -mattr=+zbb,+zcb,+zhinx -O0 -code-model=small
Local check:reproduces at b577f07195
Compiler Explorer:not uploaded (over --godbolt-limit or disabled)

Snippet:

; Function Attrs: nounwind
define i32 @test_bswap_i32(i32 %a) #0 {
  %tmp = call i32 @llvm.bswap.i32(i32 %a)
  %C = icmp eq i1 true, false
  store i1 %C, ptr poison, align 1
  ret i32 %tmp
}

; Function Attrs: nocallback nocreateundeforpoison nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.bswap.i32(i32) #1

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

Reproduce:

llc -mtriple=riscv64 -verify-machineinstrs -mattr=+zbb,+zcb,+zhinx -O0 -code-model=small -global-isel -global-isel-abort=2 -pass-remarks-missed=gisel.* snippet.ll -o -
llc -mtriple=riscv64 -verify-machineinstrs -mattr=+zbb,+zcb,+zhinx -O0 -code-model=small -global-isel=0 snippet.ll -o -

Local llc output:

remark: <unknown>:0:0: unable to translate instruction: call llvm.bswap.i32: '  %tmp = call i32 @llvm.bswap.i32(i32 %a)' (in function: test_bswap_i32)
warning: Instruction selection used fallback path for test_bswap_i32

Occurrences (5):

InputFunctionConfig
bswap-bitreverse.2b7c8a28f4.ll (mutant of bswap-bitreverse.ll)test_bswap_bitreverse_i32-mtriple=riscv32 -verify-machineinstrs -mattr=+zfinx,+zba -O1
bswap-bitreverse.5419cd2d6d.ll (mutant of bswap-bitreverse.ll)test_bswap_i32-mtriple=riscv64 -verify-machineinstrs -mattr=+zbb,+zcb,+zhinx -O0 -code-model=small
bswap-bitreverse.8d3c230c66.ll (mutant of bswap-bitreverse.ll)test_bswap_bitreverse_i32-mtriple=riscv32 -verify-machineinstrs -mattr=+zbb,+experimental-p,+a,+zfinx -O1
bswap-bitreverse.a9af59f790.ll (mutant of bswap-bitreverse.ll)test_bswap_i32-mtriple=riscv32 -verify-machineinstrs -mattr=+zbb,+zhinx -O3
bswap-shift.7fb75fb3a5.ll (mutant of bswap-shift.ll)test_bswap_shli_16_bswap_i32-mtriple=riscv64 -verify-machineinstrs -mattr=+zbkb,+zhinx -O3

Generated 2026-11-29 14:49 UTC.