Skip to content

[Mips] Cttz table lookup lowering causes "cannot select" error on mips16 #159625

@topperc

Description

@topperc

This test case generates an error with llc -mtriple=mips -mattr=+mips16

define i32 @foo(i32 %x) {
  %a = call i32 @llvm.cttz.i32(i32 %x, i1 true)
  ret i32 %a
}
LLVM ERROR: Cannot select: 0x214bf9c0: i32 = MipsISD::Lo TargetConstantPool:i32<[32 x i8] c"\00\01\1C\02\1D\0E\18\03\1E\16\14\0F\19\11\04\08\1F\1B\0D\17\15\13\10\07\1A\0C\12\06\0B\05\0A\09"> 0 [TF=5]
In function: foo

I think it didn't expect a constant pool to be created for the lookup table.

godbolt: https://godbolt.org/z/hx73s7TGG

Metadata

Metadata

Assignees

No one assigned

    Labels

    backend:MIPScrashPrefer [crash-on-valid] or [crash-on-invalid]

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions