Thank you Eli, it seems to fix my bug.<br><br>  Damien<br><br><div class="gmail_quote">On Mon, Jul 18, 2011 at 7:25 PM, Eli Friedman <span dir="ltr"><<a href="mailto:eli.friedman@gmail.com" target="_blank">eli.friedman@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<div><div></div><div>On Mon, Jul 18, 2011 at 6:35 PM, Damien Vincent <<a href="mailto:damien.llvm@gmail.com" target="_blank">damien.llvm@gmail.com</a>> wrote:<br>
><br>
>   Hi,<br>
><br>
> The target I am working on does not support i8 loading: it supports only 32<br>
> bit aligned loads.<br>
> I had to custom lower i8 load so that only i32 loads are generated.<br>
><br>
> My issue is the following:<br>
> In a very specific case, the lowering stage generates the following pattern<br>
> where the load is a i32 load:<br>
> (and (load x), 255)<br>
> This pattern is somehow converted by the DAG combiner back to:<br>
>  (zextload x, i8)<br>
> And then, during the instruction selection phase, I get:<br>
> error in backend: Cannot select: 0xb3a5558: i32,ch = load 0xb3823c4,<br>
> 0xb3a1890, 0xb3a2440<LD1[%4](align=4), zext from i8><br>
> because the instruction is simply not supported by the backend (that's the<br>
> initial reason for implementing the custom lowering !)<br>
><br>
> How come the DAG combiner converts my lowering back to an i8 loading ?<br>
> Looking at the DAGCombiner.cpp code, this transformation is done because<br>
> isLoadExtLegal returns true in the case of custom lowering of load which<br>
> does not seem logical to me (do you have an explanation for this ?).<br>
><br>
> Well, I assume I didn't do sth the right way... Can you point a mistake in<br>
> my reasoning ?<br>
<br>
</div></div>Looks like a bug to me too. :)  r135462 should fix it.<br>
<font color="#888888"><br>
-Eli<br>
</font></blockquote></div><br>