Unknown Target Node


I’m having an error I’ve never seen before

LLVM ERROR: Cannot select: t20: ch,glue = <<Unknown Target Node #284>> t11, TargetGlobalAddress:i32<i32 (i32, i32)* @add2> 0, Register:i32 $r4, Register:i32 $r5, RegisterMask:Untyped, t18:1

The IR is

define i32 @add2(i32 %a, i32 %b) {


%tmp1 = icmp eq i32 %a, 0

br i1 %tmp1, label %done, label %recurse


%tmp2 = sub i32 %a, 1

%tmp3 = add i32 %b, 1

%tmp4 = call i32 @add2(i32 %tmp2, i32 %tmp3)

ret i32 %tmp4


ret i32 %b


I don’t know what the error means but it goes away if I remove the line “%tmp4 = call i32 @add2(i32 %tmp2, i32 %tmp3)”

Any help would be appreciated.

Craig was correct. The problem was that one of my target specific ISD opcodes wasn’t handledin my *TargetLowering::getTargetNodeName method.