<div dir="ltr">(reposting because my coworker Dean Berris said sending the thread from my corporate email would put it in the spam folder for a lot of people)<div>---</div><div><br></div><div><div>Hi, I'm trying to implement a target-agnostic intrinsic, first targeting</div><div>X86. I'm trying to map the intrinsic SD node to an instruction with a</div><div>certain target opcode that I've introduced. The issues that I'm running into</div><div>are 1. what the correct way to lower the argument is 2. not getting my opcode optimized out. I've done a couple loops</div><div>on the docs so any help would be appreciated!</div><div><br></div><div>Here's a patch on phabricator: </div><div><a href="https://reviews.llvm.org/D27503">https://reviews.llvm.org/D27503</a><br></div><div><br></div><div>Some options I've explored but have been missing some crucial step/concept:</div><div>- tablegen matching?</div><div>- SelectionDAGBuilder.cpp + BuildMI call (but then this runs into the issue</div><div>of lowering the argument correctly - not sure if that's feasible at this</div><div>point in instruction selection)</div><div>- X86ISelLowering -- same confusion as above</div></div></div>