<span dir="ltr" id=":aa">Hi everyone,<br><br>I have the following code (as part of a larger function):<br><span style="font-family: courier new,monospace;">%0 = icmp eq i16 %a, 0          ; <i1> [#uses=1]</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">br i1 %0, label %bb1, label %bb</span><br><br>I would like to match this with a BRCOND, but all I get is an error message when compiling the above code that say:<br></span><span dir="ltr" id=":a2"><span style="font-family: courier new,monospace;">LLVM ERROR: Cannot yet select: 0x170f200: ch = br_cc 0x170f000, 0x170ed00, 0x170dc60, 0x170ec00, 0x170ef00 [ID=19]</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">  0x170f000: ch = TokenFactor 0x170e560, 0x170e760, 0x170e960 [ID=18]</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    0x170e560: ch = CopyToReg 0x16d5748, 0x170e460, 0x170df60 [ID=15]</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">      0x16d5748: ch = EntryToken [ORD=1] [ID=0]</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">      0x170e460: i16 = Register %reg16384 [ID=5]</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">      0x170df60: i16,ch = CopyFromReg 0x16d5748, 0x170de60 [ID=12]</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">        0x16d5748: ch = EntryToken [ORD=1] [ID=0]</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">        0x170de60: i16 = Register %reg16388 [ID=2]</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    0x170e760: ch = CopyToReg 0x16d5748, 0x170e660, 0x170e160 [ID=16]</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">      0x16d5748: ch = EntryToken [ORD=1] [ID=0]</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">      0x170e660: i16 = Register %reg16385 [ID=6]</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">      0x170e160: i16,ch = CopyFromReg 0x16d5748, 0x170e060 [ID=13]</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">        0x16d5748: ch = EntryToken [ORD=1] [ID=0]</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">        0x170e060: i16 = Register %reg16389 [ID=3]</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    0x170e960: ch = CopyToReg 0x16d5748, 0x170e860, 0x170e360 [ID=17]</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">      0x16d5748: ch = EntryToken [ORD=1] [ID=0]</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">      0x170e860: i16 = Register %reg16386 [ID=7]</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">      0x170e360: i16,ch = CopyFromReg 0x16d5748, 0x170e260 [ID=14]</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">        0x16d5748: ch = EntryToken [ORD=1] [ID=0]</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">        0x170e260: i16 = Register %reg16390 [ID=4]</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  0x170ed00: ch = seteq [ORD=1] [ID=9]</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">  0x170dc60: i16,ch = CopyFromReg 0x16d5748, 0x170db60 [ORD=1] [ID=11]</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    0x16d5748: ch = EntryToken [ORD=1] [ID=0]</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">    0x170db60: i16 = Register %reg16387 [ORD=1] [ID=1]</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  0x170ec00: i16 = Constant<0> [ORD=1] [ID=8]</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">  0x170ef00: ch = BasicBlock<bb1 0x170a5d8> [ID=10]</span><br style="font-family: courier new,monospace;"><br></span><span dir="ltr" id=":aa">In my InstrInfo.td file I'm trying to match BRCOND as follows:<br>

</span><span style="font-family: courier new,monospace;" dir="ltr" id=":a1">let isBranch = 1 in<br>def CondBranch : F3_1<2, 0b000101, <br>            (outs),<br>            (ins IntRegs:$L, i16imm:$R, brtarget:$dst),<br>

            "; TODO: do conditional branching.",<br>            [(brcond (seteq IntRegs:$L, simm8:$R), bb:$dst)]>;</span><br><br>I know CondBranch only handles SETEQ, but it should still match the code above (which does "icmp eq")? Or am I wrong?<br>

<br>Thanks!<br><br>  / Torgny<br>