fallback: legalize: G_CTLZ

Run:explore-db12fc36f6-20261127-115111
Kind:fallback
Category:legalize: G_CTLZ M
Occurrences:3 in 3 configs, 3 test files, 70 more counted only
Snippet from:div-by-constant.c2db1b6119.ll (mutant of div-by-constant.ll) @udiv_constant_no_add via llvm-extract
Config:-mtriple=riscv32 -verify-machineinstrs -mattr=+m,+zba,+zbb -O3
Local check:reproduces at db12fc36f6
Compiler Explorer:not uploaded (over --godbolt-limit or disabled)

Snippet:

@G = external global i128

; Function Attrs: nounwind
define i32 @udiv_constant_no_add(i32 %a) #0 {
  %LGV = load i128, ptr @G, align 4
  %B = urem i128 1, %LGV
  %1 = udiv i32 %a, 5
  store i128 %B, ptr @G, align 4
  ret i32 %1
}

attributes #0 = { nounwind }

Reproduce:

llc -mtriple=riscv32 -verify-machineinstrs -mattr=+m,+zba,+zbb -O3 -global-isel -global-isel-abort=2 -pass-remarks-missed=gisel.* snippet.ll -o -
llc -mtriple=riscv32 -verify-machineinstrs -mattr=+m,+zba,+zbb -O3 -global-isel=0 snippet.ll -o -

Local llc output:

remark: <unknown>:0:0: unable to legalize instruction: %1166:_(i32) = G_CTLZ %5:_(i128) (in function: udiv_constant_no_add)
warning: Instruction selection used fallback path for udiv_constant_no_add

Occurrences (3):

InputFunctionConfig
atomic-cmpxchg.6c1e4f82c6.ll (mutant of atomic-cmpxchg.ll)cmpxchg_i16_acq_rel_monotonic-mtriple=riscv32 -verify-machineinstrs -mattr=+a,+ztso,+zbb -O1 -code-model=small
div-by-constant.c2db1b6119.ll (mutant of div-by-constant.ll)udiv_constant_no_add-mtriple=riscv32 -verify-machineinstrs -mattr=+m,+zba,+zbb -O3
orc-b-patterns-rv32.ce8e654fa9.ll (mutant of orc-b-patterns-rv32.ll)byte_bit_7-mtriple=riscv32 -verify-machineinstrs -mattr=+zbb -O2

Generated 2026-11-29 14:49 UTC.