<div dir="ltr">I'm not clear, but it sounds like maybe your issue is not just alignment, but that you have no 1/2-byte load or store operations at all on your target?<div><br></div><div>Do you mean that to do any 2-byte store, even if it's naturally aligned, you need to load the 4-byte word that contains it, replace the low or high half as appropriate, and then use a 4-byte store to store back the modified value?</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 29, 2016 at 2:07 PM, jingu kang 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">Hi Krzysztof,<br>
<br>
Thanks for response.<br>
<br>
The method is working almost of test cases which use load and store<br>
instructions connected with chain. There is other situation. Let's<br>
look at a example as follows:<br>
<br>
typedef unsigned short int UV __attribute__((vector_size (8)));<br>
<br>
void test (UV *x, UV *y) {<br>
  *x = *y / ((UV) { 4, 4, 4, 4 });<br>
 }<br>
<br>
The target does not support vector type so CodeGen tries to split and<br>
scalarize vector to legalize type. While legalizing vector type, the<br>
stores of each vector elements nodes are generated from<br>
'DAGTypeLegalizer::SplitVecOp_STORE'. But the stores are not connected<br>
with chain. I guess it assumes each vector element's address is<br>
different. The each store is lowered to load and store nodes with high<br>
and low address but they are not connected with the other store's one.<br>
It causes problem. I am not sure how to solve this situation<br>
correctly.<br>
<br>
Thanks,<br>
JinGu Kang<br>
<br>
<br>
2016-01-29 18:11 GMT+00:00 Krzysztof Parzyszek via llvm-dev<br>
<<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>>:<br>
<div class="HOEnZb"><div class="h5">> On 1/29/2016 10:47 AM, JinGu Kang via llvm-dev wrote:<br>
>><br>
>><br>
>> I am doing it with lowering store as follow:<br>
>><br>
>> 1. make low and high address with alignment.<br>
>> 2. load 2 words from low and high address.<br>
>> 3. manipulate them with values to store according to alignment.<br>
>> 4. store 2 words modified to low and high address<br>
><br>
><br>
> Sounds ok.<br>
><br>
><br>
>> In order to keep the order between loads and stores, I have used chain and<br>
>> glue on the DAG but some passes have mixed it in machine instruction<br>
>> level.<br>
><br>
><br>
> Glue isn't necessary, chains are sufficient.<br>
><br>
> I'm not sure what pass reordered dependent loads and stores, but that sounds<br>
> bad.  What matters in cases like this are the MachineMemOperands.  If there<br>
> isn't any on a load/store instruction, it should be treated conservatively<br>
> (i.e. alias everything else), if there is one, it'd better be correct.<br>
> Wrong MMO could certainly lead to such behavior.<br>
><br>
> -Krzysztof<br>
><br>
><br>
> --<br>
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by<br>
> The Linux Foundation<br>
><br>
> _______________________________________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</div></div></blockquote></div><br></div>