<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"><head><!--[if gte mso 9]><xml><o:OfficeDocumentSettings><o:AllowPNG/><o:PixelsPerInch>96</o:PixelsPerInch></o:OfficeDocumentSettings></xml><![endif]--></head><body><div class="yahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;"><div dir="ltr" data-setdir="false">Hello all,</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">I am experimenting with the LLVM code and want to add a new intrinsic. I followed the steps in this article - <span><a href="https://llvm.org/docs/ExtendingLLVM.html" rel="nofollow" target="_blank" class="enhancr_card_4334887812">Extending LLVM: Adding instructions, intrinsics, types, etc. — LLVM 10 documentation</a></span><div><br></div><div id="ydp8840ec97enhancr_card_4334887812" class="ydp8840ec97yahoo-link-enhancr-card ydp8840ec97ymail-preserve-class ydp8840ec97ymail-preserve-style" style="max-width:400px;font-family:YahooSans, "Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif" data-url="https://llvm.org/docs/ExtendingLLVM.html" data-type="YENHANCER" data-size="MEDIUM" contenteditable="false"><a href="https://llvm.org/docs/ExtendingLLVM.html" style="text-decoration:none !important;color:#000 !important" class="ydp8840ec97yahoo-enhancr-cardlink" rel="nofollow" target="_blank"><table border="0" class="ydp8840ec97card-wrapper ydp8840ec97yahoo-ignore-table" cellpadding="0" cellspacing="0" style="max-width:400px"><tbody><tr><td width="400"><table border="0" class="ydp8840ec97card ydp8840ec97yahoo-ignore-table" cellpadding="0" cellspacing="0" width="100%" style="max-width:400px;border-width:1px;border-style:solid;border-color:rgb(224, 228, 233);border-radius:2px"><tbody><tr><td class="ydp8840ec97card-primary-image-cell" background="https://s.yimg.com/lo/api/res/1.2/fdPsS_BLHRsXBNzcjWzusQ--~A/Zmk9ZmlsbDt3PTQwMDtoPTIwMDthcHBpZD1pZXh0cmFjdA--/https://llvm.org/_static/logo.png.cf.jpg" bgcolor="#000000" valign="top" height="175" style="background-color: rgb(0, 0, 0); background-size: cover; position: relative; border-radius: 2px 2px 0px 0px; min-height: 175px;"><!--[if gte mso 9]><v:rect fill="true" stroke="false" style="width:396px;height:175px;position:absolute;top:0;left:0;"><v:fill type="frame" color="#000000" src="https://s.yimg.com/lo/api/res/1.2/fdPsS_BLHRsXBNzcjWzusQ--~A/Zmk9ZmlsbDt3PTQwMDtoPTIwMDthcHBpZD1pZXh0cmFjdA--/https://llvm.org/_static/logo.png.cf.jpg"/></v:rect><![endif]--><table border="0" class="ydp8840ec97card-overlay-container-table ydp8840ec97yahoo-ignore-table" cellpadding="0" cellspacing="0" style="width:100%"><tbody><tr><td class="ydp8840ec97card-overlay-cell" background="https://s.yimg.com/cv/ae/nq/storm/assets/enhancrV21/1/enhancr_gradient-400x175.png" bgcolor="transparent" valign="top" style="background-color: transparent; border-radius: 2px 2px 0px 0px; min-height: 175px;"><!--[if gte mso 9]><v:rect fill="true" stroke="false" style="width:396px;height:175px;position:absolute;top:-18px;left:0;"><v:fill type="pattern" color="#000000" src="https://s.yimg.com/cv/ae/nq/storm/assets/enhancrV21/1/enhancr_gradient-400x175.png"/><v:textbox inset="0,0,20px,0"><![endif]--><table border="0" class="ydp8840ec97yahoo-ignore-table" height="175" style="width: 100%; min-height: 175px;"><tbody><tr><td class="ydp8840ec97card-richInfo2" style="text-align:left;padding:15px 0 0 15px;vertical-align:top"></td><td class="ydp8840ec97card-actions" style="text-align:right;padding:15px 15px 0 0;vertical-align:top"><div class="ydp8840ec97card-share-container"></div></td></tr></tbody></table><!--[if gte mso 9]></v:textbox></v:rect><![endif]--></td></tr></tbody></table></td></tr><tr><td><table border="0" align="center" class="ydp8840ec97card-info ydp8840ec97yahoo-ignore-table" cellpadding="0" cellspacing="0" style="background:#fff;position:relative;z-index:2;width:100%;max-width:400px;border-radius:0 0 2px 2px;border-top:1px solid rgb(224, 228, 233)"><tbody><tr><td style="background-color:#ffffff;padding:16px 0 16px 12px;vertical-align:top;border-radius:0 0 0 2px"></td><td style="vertical-align:middle;padding:12px 24px 16px 12px;width:99%;font-family:YahooSans, "Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif;border-radius:0 0 2px 0"><h2 class="ydp8840ec97card-title" style="font-size: 14px; line-height: 19px; margin: 0px 0px 6px; font-family: YahooSans, "Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif; color: rgb(38, 40, 42); max-width: 314px;">Extending LLVM: Adding instructions, intrinsics, types, etc. — LLVM 10 d...</h2><p class="ydp8840ec97card-description" style="font-size: 12px; line-height: 16px; margin: 0px; color: rgb(151, 155, 167);"></p></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></a></div><div><br></div><div dir="ltr" data-setdir="false">I am not using '<span><code class="ydp5b3a48b7docutils ydp5b3a48b7literal ydp5b3a48b7notranslate" style="font-family: Consolas, "Deja Vu Sans Mono", "Bitstream Vera Sans Mono", monospace; font-size: 0.95em; color: rgb(0, 0, 0);"><span class="ydp5b3a48b7pre">llvm_any*_ty</span></code><span style="color: rgb(0, 0, 0); font-family: "Lucida Grande", "Lucida Sans Unicode", Geneva, Verdana, sans-serif; font-size: 14px;"> types'. <span><span style="color: rgb(0, 0, 0); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 16px;">My intrinsic function looks like:</span></span></span></span></div><div dir="ltr" data-setdir="false"> <span>def int_foo: GCCBuiltin<"__foo">, Intrinsic<[llvm_i32_ty], [llvm_i16_ty, llvm_i16_ty], []>;</span><br></div><div dir="ltr" data-setdir="false"><span>I also defined it in 'Builtins.def'.</span></div><div dir="ltr" data-setdir="false"><span><br></span></div><div dir="ltr" data-setdir="false">If I use this, the generated IR shows up with the suffix 'i16.i16'. Why?</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">As a result, it doesn't match in the instruction selection & lowering phase. If I manually edit the IR file and remove, the .i16.i16 suffix, it matches.</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">Thanks in advance!</div><div><br></div></div></div></body></html>