<div dir="ltr"><div>Hi Lukas,</div><div><br></div><div dir="ltr">+ Florian and Sanjay.<br><div><br></div></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 22 Dec 2020 at 02:06, Lukas Sommer <<a href="mailto:sommer@esa.tu-darmstadt.de" target="_blank">sommer@esa.tu-darmstadt.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
  
    
  
  <div>
    <p>Hi Venkat.,</p>
    <p>thanks for adding the support for libmvec!</p>
    <p>Is there a pass or something similar to replace calls to
      intrinsics that already operate on vector operands with calls to
      libmvec? <br></p></div></blockquote><div>I am not aware of any existing pass. </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><p>
    </p>
    <p>inject-tli-mappings seems to add the attributes only to scalar
      calls to intrinsics such as llvm.exp and the loop-vectorizer then
      might vectorize these calls. <br>
    </p>
    <p>In my use case, I'm getting vectorized calls to LLVM intrinsics
      from MLIR and would like to replace those with calls to libmvec,
      but as the code is already vectorized, the LoopVectorizer does not
      do these replacements. <br>
    </p>
    <p>So for example, in the LLVM IR generated from MLIR, there is a
      call such as:</p>
    <p>%103 = fmul <4 x double> %102, <double -5.000000e-01,
      double -5.000000e-01, double -5.000000e-01, double
      -5.000000e-01><br>
      %104 = tail call <4 x double> @llvm.exp.v4f64(<4 x
      double> %103)</p>
    <p>I would like to have a pass replace the call to llvm.exp.v4f64
      with a call @_ZGVdN4v_exp(<4 x double>), whose declaration
      is inserted by inject-tli-mappings.</p>
    <p>Are you aware of such a pass or another way to achieve this
      behavior?</p></div></blockquote><div>May be we should have one IR pass which does this conversion or make the code gen lower it to the required call. </div><div>I have added few others to comment.</div><div><br></div><div>regards,</div><div>Venkat.</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>
    <p>Thanks in advance,</p>
    <p>Lukas<br>
    </p>
    <pre cols="72">Lukas Sommer, M.Sc.
TU Darmstadt
Embedded Systems and Applications Group (ESA)
Hochschulstr. 10, 64289 Darmstadt, Germany
Phone: +49 6151 1622429
<a href="http://www.esa.informatik.tu-darmstadt.de" target="_blank">www.esa.informatik.tu-darmstadt.de</a></pre>
    <div>On 23.09.20 17:11, Venkataramanan Kumar
      via llvm-dev wrote:<br>
    </div>
    <blockquote type="cite">
      
      <div dir="ltr">
        <div dir="ltr"><br>
          <div>Hi Florian and Alexandre, </div>
        </div>
        <br>
        <div class="gmail_quote">
          <div dir="ltr" class="gmail_attr">On Tue, 15 Sep 2020 at
            19:30, Alexandre Bique <<a href="mailto:bique.alexandre@gmail.com" target="_blank">bique.alexandre@gmail.com</a>>
            wrote:<br>
          </div>
          <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Tue, Sep 15, 2020 at
            3:58 PM Venkataramanan Kumar<br>
            <<a href="mailto:venkataramanan.kumar.llvm@gmail.com" target="_blank">venkataramanan.kumar.llvm@gmail.com</a>>
            wrote:<br>
            > I have not yet started the patch work.<br>
            ><br>
            > Collected information about the ABI for the routines. 
             To start with I am thinking of supporting 
            pow/lib/exp/sin/cos/log routines till VF 8 which are non
            masked variants in the initial patch.<br>
            > I will try to send the patch early next week.<br>
            <br>
            Great, let me know if you need help or don't have time to
            look at it.<br>
          </blockquote>
          <div><br>
          </div>
          <div>I made a patch and submitted it here.  </div>
          <div><a href="https://reviews.llvm.org/D88154" target="_blank">https://reviews.llvm.org/D88154</a><br>
          </div>
          <div><br>
          </div>
          <div>regards,</div>
          <div>venkat.</div>
          <div> </div>
          <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
            <br>
            Regards,<br>
            Alexandre<br>
          </blockquote>
        </div>
      </div>
      <br>
      <fieldset></fieldset>
      <pre>_______________________________________________
LLVM Developers mailing list
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre>
    </blockquote>
  </div>

</blockquote></div></div>