<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Oct 12, 2016 at 5:00 PM, Krzysztof Parzyszek via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 10/11/2016 10:13 PM, Peter Collingbourne via llvm-dev wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+ bool SelectFancyImm(SDValue N, SDValue &Op) {<br>
+ if (isa<ConstantSDNode>(N)) {<br>
+ Op = N;<br>
+ return true;<br>
+ } else {<br>
+ return false;<br>
+ }<br>
+ }<br>
</blockquote>
<br>
The result should be a TargetConstant. Something like<br>
<br>
bool SelectFancyImm(SDValue N, SDValue &Op) {<br>
auto *CN = dyn_cast<ConstantSDNode>(N);<br>
if (!CN)<br>
return false;<br>
Op = CurDAG->getTargetConstant(CN-><wbr>getZExtValue(), MVT::i32);<br>
return true;<br>} <br></blockquote></div><div class="gmail_extra"><br></div>Thanks, that got me past that problem.<br clear="all"><div><br></div>-- <br><div class="m_2320508716051824100gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">-- <div>Peter</div></div></div>
</div></div>