<div>The bfiPlusMask case in motivation.ll is not instcombine-canonical. Running instcombine on it similarly disrupts your BFI pattern, so patching dagcombine doesn't seem like it will solve the problem. Is it possible for you to instead generalize the BFI matching code to recognize patterns even when they have been disrupted by this canonicalization?</div>
<div><br></div><div>Dan<br><br><div class="gmail_quote">On Wed, Jan 30, 2013 at 11:41 AM, Quentin Colombet <span dir="ltr"><<a href="mailto:qcolombet@apple.com" target="_blank">qcolombet@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><br></div><div>To give a bit of motivation for the proposed patch, here is an example on how it can be used.</div>
<div><br></div><div>Consider the attached motivation.ll file.</div><div>Compile it using thumb with swift cpu, i.e.,</div><div>llc -march thumb motivation.ll -o - -mcpu=swift  -O3</div><div><br></div><div>The produced output will be similar to attached current.s.</div>
<div><br></div><div>As you may have noticed, the produced code is really different between the two functions of motivation.ll file, whereas the input code is very similar. In fact, I would have expected for the second function, the same code as the first function plus a AND instruction, i.e., like attached expected.s.</div>
<div><br></div><div>Using the hook proposed in the previous patch, one can achieve the expected output with the attached earlyDAGCombineARMExample.patch.</div><div><br></div><div>Note: My point is to illustrate the motivation of my previous patch and get reviews for it. Do not spend time reviewing the earlyDAGCombineARMExample.patch, it is not intended to be committed (at least in that thread :)).</div>
<div><br></div><div>Thanks,</div><div><br><div>
<div style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-wrap:break-word;word-spacing:0px">
-Quentin</div><div style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-wrap:break-word;word-spacing:0px">
<br></div><div style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-wrap:break-word;word-spacing:0px">
</div></div></div></div><br><div style="word-wrap:break-word"><div><div><div style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-wrap:break-word;word-spacing:0px">
</div></div></div></div>
<br><div style="word-wrap:break-word"><div><div><div style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-wrap:break-word;word-spacing:0px">
</div></div></div></div>
<br><div style="word-wrap:break-word"><div><div><div style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-wrap:break-word;word-spacing:0px">
</div></div></div></div>
<br><div style="word-wrap:break-word"><div><div><div style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-wrap:break-word;word-spacing:0px">
</div>

</div>
<br><div><div>On Jan 29, 2013, at 11:05 AM, Quentin Colombet <<a href="mailto:qcolombet@apple.com" target="_blank">qcolombet@apple.com</a>> wrote:</div><br><blockquote type="cite"><div style="word-wrap:break-word">
Hi,<div><br></div><div>Currently in DAG combiner, we have roughly the following workflow for each Selection DAG node:</div><div>1. Target-independent DAG combine</div><div>2. Target-specific DAG combine</div><div><br></div>
<div>I'd like to add a target-specific DAG combine pass before any target-independent, i.e.,</div><div><div>1. Target-specific DAG combine</div><div>2. Target-independent DAG combine</div><div>3. Target-specific DAG combine</div>
</div><div><br></div><div>Attached is a patch that realizes that.</div><div><br></div><div>The patch uses the exact same construction as the existing "late" target-specific DAG combine hook. In other words, it defines three new methods in the base class of target lowering:</div>
<div>- One to set which types of SDNode should be processed through the "early" target specific DAG combine</div><div>- One to query whether a type of SDNode has been marked as should be "early" DAG combined.</div>
<div>- One virtual method that is the hook to the "early" DAG combine processing.</div><div>And adds the call to the related hook in DAGCombiner.</div><div><br></div><div>Thanks for your reviews.</div><div><div>

<div style="font-family:Helvetica;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word">
<br></div><div style="font-family:Helvetica;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word">
-Quentin</div>

</div>
</div></div><span><earlyTargetSpecificDAGCombine.patch></span><div style="word-wrap:break-word"><div></div></div>
_______________________________________________<br>llvm-commits mailing list<br><a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div></div><br>_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
<br></blockquote></div><br></div>