fallback: translate: call llvm.read_register.i32

Run:explore-b577f07195-20261129-105236
Kind:fallback
Category:translate: call llvm.read_register.i32 M
Occurrences:3 in 3 configs, 2 test files, 17 more counted only
Snippet from:get-register-noreserve.a96827ea57.ll (mutant of get-register-noreserve.ll) @get_tp_arch_name via llvm-extract
Config:-mtriple=riscv32 -mattr=+a,+zhinx -O0 -verify-machineinstrs
Local check:reproduces at b577f07195
Compiler Explorer:not uploaded (over --godbolt-limit or disabled)

Snippet:

; Function Attrs: nounwind
define i32 @get_tp_arch_name() #0 {
entry:
  %sp = call i32 @llvm.read_register.i32(metadata !0)
  %B = sub i32 %sp, %sp
  ret i32 %B
}

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(read)
declare i32 @llvm.read_register.i32(metadata) #1

attributes #0 = { nounwind }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(read) }

!0 = !{!"x4\00"}

Reproduce:

llc -mtriple=riscv32 -mattr=+a,+zhinx -O0 -verify-machineinstrs -global-isel -global-isel-abort=2 -pass-remarks-missed=gisel.* snippet.ll -o -
llc -mtriple=riscv32 -mattr=+a,+zhinx -O0 -verify-machineinstrs -global-isel=0 snippet.ll -o -

Local llc output:

remark: <unknown>:0:0: unable to translate instruction: call llvm.read_register.i32: '  %sp = call i32 @llvm.read_register.i32(metadata !1)' (in function: get_tp_arch_name)
warning: Instruction selection used fallback path for get_tp_arch_name

Occurrences (3):

InputFunctionConfig
get-register-noreserve.47fc371eb2.ll (mutant of get-register-noreserve.ll)get_stack-mtriple=riscv32 -mattr=+zhinx -O1 -code-model=small -verify-machineinstrs
get-register-noreserve.a96827ea57.ll (mutant of get-register-noreserve.ll)get_tp_arch_name-mtriple=riscv32 -mattr=+a,+zhinx -O0 -verify-machineinstrs
vlenb.dcbc33f78f.ll (mutant of vlenb.ll)sink_to_use_branch-mtriple=riscv32 -mattr=+zfinx -O1 -verify-machineinstrs

Generated 2026-11-29 14:49 UTC.