<html><head></head><body><div style="color:#000; background-color:#fff; font-family:Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px"><div id="yui_3_16_0_ym19_1_1490000649307_7773"><span>Hi,</span></div><div id="yui_3_16_0_ym19_1_1490000649307_7880"><span id="yui_3_16_0_ym19_1_1490000649307_7891">please guide me in solving the next task.</span></div><div id="yui_3_16_0_ym19_1_1490000649307_14451" dir="ltr"><span id="yui_3_16_0_ym19_1_1490000649307_7891">I want to replace sequence of IR instruction to call of my own procedure,</span></div><div id="yui_3_16_0_ym19_1_1490000649307_12757" dir="ltr"><span id="yui_3_16_0_ym19_1_1490000649307_7891">specifically this sequence (it is adding 2 vectors, each consists from 8 elements):</span></div><div id="yui_3_16_0_ym19_1_1490000649307_7889"><br></div><div id="yui_3_16_0_ym19_1_1490000649307_14395" dir="ltr"> %31 = getelementptr inbounds i32, i32* %0, i64 %29<br id="yui_3_16_0_ym19_1_1490000649307_14385"> %32 = bitcast i32* %31 to <8 x i32>*<br id="yui_3_16_0_ym19_1_1490000649307_14386"> %33 = load <8 x i32>, <8 x i32>* %32, align 4, !tbaa !1, !alias.scope !5<br id="yui_3_16_0_ym19_1_1490000649307_14387"> %34 = getelementptr inbounds i32, i32* %1, i64 %29<br id="yui_3_16_0_ym19_1_1490000649307_14388"> %35 = bitcast i32* %34 to <8 x i32>*<br id="yui_3_16_0_ym19_1_1490000649307_14389"> %36 = load <8 x i32>, <8 x i32>* %35, align 4, !tbaa !1, !alias.scope !8<br id="yui_3_16_0_ym19_1_1490000649307_14390"> %37 = add nsw <8 x i32> %36, %33<br id="yui_3_16_0_ym19_1_1490000649307_14391"> %38 = getelementptr inbounds i32, i32* %2, i64 %29<br id="yui_3_16_0_ym19_1_1490000649307_14392"> %39 = bitcast i32* %38 to <8 x i32>*<br id="yui_3_16_0_ym19_1_1490000649307_14393"> store <8 x i32> %37, <8 x i32>* %39, align 4, !tbaa !1, !alias.scope !10, !noalias !12<br id="yui_3_16_0_ym19_1_1490000649307_14394"></div><div id="yui_3_16_0_ym19_1_1490000649307_14404" dir="ltr"><br></div><div id="yui_3_16_0_ym19_1_1490000649307_14461" dir="ltr">to C procdure like</div><div id="yui_3_16_0_ym19_1_1490000649307_14465" dir="ltr">exec_vect8add(add1stPtr, add2ndPtr, resPtr)<br></div><div id="yui_3_16_0_ym19_1_1490000649307_14464"><br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1490000649307_14463">I tried to do this via tablegen (I tried to replace to intrinsic), but cannot compile LLVM.</div><div id="yui_3_16_0_ym19_1_1490000649307_14507" dir="ltr">I added to the instruction definition file Cpu0InstrInfo.td next lines:</div><div id="yui_3_16_0_ym19_1_1490000649307_16225" dir="ltr">def : Pat<(store (v8i32 (add (v8i32 (load addr:$adr1)), (v8i32 (load addr:$adr2))<br id="yui_3_16_0_ym19_1_1490000649307_16248"> )<br id="yui_3_16_0_ym19_1_1490000649307_16249"> ),<br id="yui_3_16_0_ym19_1_1490000649307_16250"> addr:$adrdst<br id="yui_3_16_0_ym19_1_1490000649307_16251"> ),<br id="yui_3_16_0_ym19_1_1490000649307_16252"> (int_cpu0_GEadd addr:$adr1, addr:$adr2, addr:$adrdst)>;<br id="yui_3_16_0_ym19_1_1490000649307_16253"></div><div id="yui_3_16_0_ym19_1_1490000649307_16272" dir="ltr"><br></div><div id="yui_3_16_0_ym19_1_1490000649307_16273" dir="ltr">Error during compilation:</div><div id="yui_3_16_0_ym19_1_1490000649307_16255" dir="ltr">Included from /home/tsib/LLVM/test/src/lib/Target/Cpu0/Cpu0.td:15:<br id="yui_3_16_0_ym19_1_1490000649307_16293">/home/tsib/LLVM/test/src/lib/Target/Cpu0/Cpu0InstrInfo.td:1125:1: error: In anonymous_537: Cannot use 'int_cpu0_GEadd' in an output pattern!<br id="yui_3_16_0_ym19_1_1490000649307_16294">def : Pat<(store (v8i32 (add (v8i32 (load addr:$adr1)), (v8i32 (load addr:$adr2))<br id="yui_3_16_0_ym19_1_1490000649307_16295"><br></div><div id="yui_3_16_0_ym19_1_1490000649307_14462"><br><span></span></div><div id="yui_3_16_0_ym19_1_1490000649307_7712" class="signature">Thanks,<div id="yui_3_16_0_ym19_1_1490000649307_7713">Oleg</div></div></div></body></html>