Hi, Could you please explain how you are using this? like commands When I run this IR in opt, it doesn't throw any errors. On 03/03/19 1:30 AM, via llvm-dev wrote:> Hi, > > 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) { > entry: > %tmp1 = icmp eq i32 %a, 0 > br i1 %tmp1, label %done, label %recurse > recurse: > %tmp2 = sub i32 %a, 1 > %tmp3 = add i32 %b, 1 > %tmp4 = call i32 @add2(i32 %tmp2, i32 %tmp3) > ret i32 %tmp4 > done: > 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.-- Have a great day! PreeJackie
On Sat, 2 Mar 2019 at 21:00, preejackie via llvm-dev <llvm-dev at lists.llvm.org> wrote:> Could you please explain how you are using this? like commands > > When I run this IR in opt, it doesn't throw any errors.The error he's reporting is from CodeGen, so opt would never be able to reproduce it (you'd have to use llc). I haven't tried, but the input is so basic I assume it's also from a private backend. Unfortunately I can only speculate about the cause. LLVM doesn't usually even try to select machine nodes, so the best idea I've come up with is that some custom selection code is both modifying the DAG and then reporting failure to select. The key questions Josh needs to look into are: + Is this node there in -view-isel-dags (i.e. before selection)? + If not, what creates it (this'll probably involve looking at build/lib/Target/XYZ/XYZGenInstrInfo.inc to work out what 284 is. Calls are pretty special at the best of times, but I can't think of a way they could cause this. Tim.
I'm still relatively new to llvm, good to know these errors are from CodeGen. On 03/03/19 10:49 AM, Tim Northover wrote:> On Sat, 2 Mar 2019 at 21:00, preejackie via llvm-dev > <llvm-dev at lists.llvm.org> wrote: >> Could you please explain how you are using this? like commands >> >> When I run this IR in opt, it doesn't throw any errors. > The error he's reporting is from CodeGen, so opt would never be able > to reproduce it (you'd have to use llc). I haven't tried, but the > input is so basic I assume it's also from a private backend. > > Unfortunately I can only speculate about the cause. LLVM doesn't > usually even try to select machine nodes, so the best idea I've come > up with is that some custom selection code is both modifying the DAG > and then reporting failure to select. The key questions Josh needs to > look into are: > > + Is this node there in -view-isel-dags (i.e. before selection)? > + If not, what creates it (this'll probably involve looking at > build/lib/Target/XYZ/XYZGenInstrInfo.inc to work out what 284 is. > > Calls are pretty special at the best of times, but I can't think of a > way they could cause this. > > Tim.-- Have a great day! PreeJackie