fallback: translate: call llvm.bswap.i32

Run:explore-db12fc36f6-20261127-115111
Kind:fallback
Category:translate: call llvm.bswap.i32 M
Occurrences:4 in 4 configs, 3 test files, 11 more counted only
Snippet from:rv32xtheadbb.3c623ec4b1.ll (mutant of rv32xtheadbb.ll) @bswap_i32 via llvm-extract
Config:-mtriple=riscv32 -verify-machineinstrs -mattr=+xtheadbb,+b,+zdinx -O2
Local check:reproduces at db12fc36f6
Compiler Explorer:not uploaded (over --godbolt-limit or disabled)

Snippet:

; Function Attrs: nounwind
define i32 @bswap_i32(i32 %a) #0 {
  %1 = tail call i32 @llvm.bswap.i32(i32 %a)
  %C = icmp slt i32 %1, %1
  store i1 %C, ptr poison, align 1
  ret i32 %1
}

; 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=riscv32 -verify-machineinstrs -mattr=+xtheadbb,+b,+zdinx -O2 -global-isel -global-isel-abort=2 -pass-remarks-missed=gisel.* snippet.ll -o -
llc -mtriple=riscv32 -verify-machineinstrs -mattr=+xtheadbb,+b,+zdinx -O2 -global-isel=0 snippet.ll -o -

Local llc output:

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

Occurrences (4):

InputFunctionConfig
bswap-shift.13d25c1791.ll (mutant of bswap-shift.ll)test_bswap_shli_8_bswap_i32-mtriple=riscv32 -verify-machineinstrs -mattr=+zbkb,+zvbb,+zdinx -O0
bswap-shift.d9676d859f.ll (mutant of bswap-shift.ll)test_bswap_shli_8_bswap_i32-mtriple=riscv64 -verify-machineinstrs -mattr=+zbb,+zhinx -O2
rv32xtheadbb.3c623ec4b1.ll (mutant of rv32xtheadbb.ll)bswap_i32-mtriple=riscv32 -verify-machineinstrs -mattr=+xtheadbb,+b,+zdinx -O2
rv64xtheadbb.6eef497924.ll (mutant of rv64xtheadbb.ll)bswap_i32-mtriple=riscv64 -verify-machineinstrs -mattr=+zdinx,+zbb -O3

Generated 2026-11-29 14:49 UTC.