<div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><div style="line-height: 1.7;"><div style="line-height: 1.7;"><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px; margin: 0px;"><span style="font-size: 18px;">Hi, </span></div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px; margin: 0px;"><br></div><div style="margin: 0px;"><span style="color: rgb(0, 0, 0); font-family: Arial; font-size: 18px;">I am trying to relate normal instructions with predicate instructions. I have read the docume</span><span style="color: rgb(0, 0, 0); font-family: Arial; font-size: 18px;">nt </span><a href="https://llvm.org/docs/HowToUseInstrMappings.html" style="font-size: 18px; text-decoration: underline;"><span style="font-size: 18px;">How To Use Instruction Mappings ¡ª LLVM 12 documentation</span></a><span style="font-size: 18px;">.</span></div><div style="margin: 0px;"><span style="font-size: 18px;">If normal instruction and the corresponding instruction are related, they should have the same BaseOpcode. </span><br></div><div style="margin: 0px;"><span style="font-size: 18px;">The document covers class/def only. It doesn't cover multiclass/defm.</span></div><div style="margin: 0px;"><span style="font-size: 18px;">for example:</span></div><div style="margin: 0px;"><span style="font-size: 18px;">class VFORM<...> </span><span style="font-size: 18px;">{</span><span style="font-size: 18px;">...</span><span style="font-size: 18px;">}</span></div><div style="margin: 0px;"><span style="font-size: 18px;">multiclass MFORM<...> {</span></div><div style="margin: 0px;"><span style="font-size: 18px;">def _aa: VFORM<...>;</span></div><div style="margin: 0px;"><span style="font-size: 18px;">def _bb: VFORM<...>;</span></div><div style="margin: 0px;"><span style="font-size: 18px;">}</span></div><div style="margin: 0px;"><span style="font-size: 18px;">defm MOV: MFORM<...>;</span></div><div style="margin: 0px;"><span style="font-size: 18px;">defm P_MOV: MFORM<...>;</span></div><div style="margin: 0px;"><span style="font-size: 18px;"><br></span></div><div style="margin: 0px;"><span style="font-size: 18px;">P_MOV_aa and P_MOV_bb are the corresponding predicate instruction of MOV_aa and MOV_bb.</span></div><div style="margin: 0px;"><span style="font-size: 18px;">when relating P_MOV_aa with MOV_aa and P_MOV_bb with MOV_bb, they should have the same BaseOpcode.</span></div><div style="margin: 0px;"><span style="font-size: 18px;">I think the normal instruction definition name is the best option for BaseOpcode, such as "MOV_aa" and "MOV_bb".</span></div><div style="margin: 0px;"><span style="font-size: 18px;">Could I get the instruction definition name automatically and assign it to BaseOpcode in td file?</span></div><div style="margin: 0px;"><span style="font-size: 18px;">Or is there a convenint way to set BaseOpcode for normal/predicate instruction when using multiclass/defm?</span></div><div style="margin: 0px;"><br></div></div></div></div><br><br><span title="neteasefooter"><p> </p></span>