<div dir="ltr"><div>Hi, Richard, <br><br></div><div>I think we are solving a same problem. I am working on shader language too.  I am not satisfied with current binaries because vector operations are kept in llvm opt. <br>
<br></div><div>glsl shader language has an operation called "swizzle". It can select sub-components of a vector. If a shader only takes components "xy" for a vec4. it's certainly wasteful to generate 4 operations for a scalar processor. <br>
<br></div><div>i think a good solution for llvm is in codegen. Many compiler has codegen optimizer. A DSE is good enough. <br><br>Which posted patch about TBAA? you have yet another solution except decompose-vectors?<br><br>
</div><div><br>thanks,<br></div><div>--lx<br> <br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Oct 25, 2013 at 6:06 PM, Richard Sandiford <span dir="ltr"><<a href="mailto:rsandifo@linux.vnet.ibm.com" target="_blank">rsandifo@linux.vnet.ibm.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">Liu Xin <<a href="mailto:navy.xliu@gmail.com">navy.xliu@gmail.com</a>> writes:<br>

> Hi, LLVM community,<br>
><br>
> I write some code in hand using LLVM IR. for simplicity, I write them in <4<br>
> x float>. now I found some stores for elements are useless.<br>
><br>
> for example, If I store {0.0, 1.0, 2.0, 3.0} to a <4 x float> %a. maybe<br>
> only %a.xy is alive in my program.  our target doesn't feature SIMD<br>
> instruction, which means we have to lower vector to many  scalar<br>
> instructions. I found llvm doesn't have DSE in codegen , right?<br>
><br>
><br>
> Is there a pass which can break down vector operation to scalars?<br>
<br>
</div></div>I wanted the same thing for SystemZ, which doesn't have vectors,<br>
in order to improve the llvmpipe code.  FWIW, here's what I have locally.<br>
<br>
It is able to decompose loads and stores, but I found in the llvmpipe case<br>
that this made things worse with TBAA, because DAGCombiner::GaterAllAliases<br>
has some fairly strict limits.  So I disabled that by default; use<br>
-decompose-vector-load-store to reenable.<br>
<br>
The main motivation for z was instead to get InstCombine to rewrite<br>
things like scalarised selects.<br>
<br>
I haven't submitted it yet because it's less of a win than the TBAA<br>
DAGCombiner patch I posted, so I didn't want to distract from that.<br>
It would also need some TargetTransformInfo hooks to decide which<br>
vectors should be decomposed.<br>
<br>
Thanks,<br>
Richard<br>
<br>
</blockquote></div><br></div>