After some thought, to put this more simply (more direct), it would be fine if the getelementptr is lowered into IR assuming an x86 architecture. The real problem is that I don't want the x86 code generation, I still want to deal in LLVM IR just with the GEP lowered, and it lowered for the x86 architecture is fine.<br>
<br>Is there any way to do this?<br><br><div class="gmail_quote">On Thu, Dec 8, 2011 at 11:39 AM, Ryan Taylor <span dir="ltr"><<a href="mailto:ryta1203@gmail.com">ryta1203@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Or is it in the docs such that when you use the word "independent", you really mean "independent of a particular target" and not actually "target independent"?<div class="HOEnZb"><div class="h5">
<br><br><div class="gmail_quote">
On Thu, Dec 8, 2011 at 11:18 AM, Ryan Taylor <span dir="ltr"><<a href="mailto:ryta1203@gmail.com" target="_blank">ryta1203@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div><div><br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Ryan Taylor</b> <span dir="ltr"><<a href="mailto:ryta1203@gmail.com" target="_blank">ryta1203@gmail.com</a>></span><br>

Date: Thu, Dec 8, 2011 at 11:13 AM<br>
Subject: Re: [LLVMdev] GetElementPtr<br>To: Reid Kleckner <<a href="mailto:reid.kleckner@gmail.com" target="_blank">reid.kleckner@gmail.com</a>><br><br><br>There is no support for gep, it's my understanding that it's target-independent, so there's no reason to put the lowering in the target lowering portion is there?<br>


<br>Eventually the GEP has to be lowered correctly, to the target architecture, but the docs state that it's target-independent, so given that it should be possible to lower it without knowing any specifics about the target, correct?<div>


<div><br>
<br><div class="gmail_quote">On Thu, Dec 8, 2011 at 11:08 AM, Reid Kleckner <span dir="ltr"><<a href="mailto:reid.kleckner@gmail.com" target="_blank">reid.kleckner@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



Why would you want to remove all GEP instructions?  inttoptr+math+ptrtoint don't have the exact same semantics in LLVM IR.  GEP instructions have certain guarantees about what addresses can be computed with them that straight pointer arithmetic doesn't.<span><font color="#888888"><div>





<br></div></font></span><div><span><font color="#888888">Reid</font></span><div><div><br><br><div class="gmail_quote">On Thu, Dec 8, 2011 at 2:00 PM, Ryan Taylor <span dir="ltr"><<a href="mailto:ryta1203@gmail.com" target="_blank">ryta1203@gmail.com</a>></span> wrote:<br>



<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Do you think I could use the SelectionDAGBuilder in a pass to accomplish this for me? if there is already code that does this I don't really think I should have to do this again, unless it's not possible to access that code from the stage where I want to use it?<br>






<br><div class="gmail_quote">On Thu, Dec 8, 2011 at 12:56 AM, Pedro Ferreira <span dir="ltr"><<a href="mailto:pedro.ferreira@imgtec.com" target="_blank">pedro.ferreira@imgtec.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">







  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    I was unaware of its removal. I am still using 2.8. I grep'd the
    source tree for that pass and found it on the header I mentioned; it
    led me to believe the pass was still there.<br>
    <br>
    The transformation itself isn't complicated; doing it manually
    should be simple.<div><div><div><br>
    <br>
    On 07/12/11 21:50, Ryan Taylor wrote:
    </div><blockquote type="cite"><div>
      
      There is a GEPSplitterPass in the Scalar.h but not in the
      LLVM_SRC/lib/Transforms/Scalar folder, there is no
      GEPSplitterPass.cpp file. Is it possible to get this from 2.8 and
      compile it and use it for 2.9?<br>
      <br>
      </div><div class="gmail_quote"><div>
        On Wed, Dec 7, 2011 at 12:31 PM, Ryan Taylor <span dir="ltr"><<a href="mailto:ryta1203@gmail.com" target="_blank">ryta1203@gmail.com</a>></span>
        wrote:<br>
        </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>
          Looking at the release notes for 2.9, it appears that
          GEPSplitterPass has been removed from 2.9. Is this the case,
          can I access it anyways or no?<br>
          <br>
          Due to all the changes between versions of LLVM, it's not
          timely to switch to any other version of LLVM, since the code
          modifications would be too many. Any other ideas?
          </div><div>
            <div><br>
              <br>
              <div class="gmail_quote"><div>On Wed, Dec 7, 2011 at 12:14 PM,
                Ryan Taylor <span dir="ltr"><<a href="mailto:ryta1203@gmail.com" target="_blank">ryta1203@gmail.com</a>></span>
                wrote:<br>
                </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>
                  Yes, exactly along these lines, how do I use this
                  pass? It's not documented in the Transforms section of
                  <a href="http://llvm.org" target="_blank">llvm.org</a>
                  </div><div>
                    <div><br>
                      <br>
                      <div class="gmail_quote"><div>
                        On Wed, Dec 7, 2011 at 6:06 AM, Pedro Ferreira <span dir="ltr"><<a href="mailto:pedro.ferreira@imgtec.com" target="_blank">pedro.ferreira@imgtec.com</a>></span>
                        wrote:<br>
                        </div><div><div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                          <div bgcolor="#FFFFFF" text="#000000"> You
                            mean, something along the lines of the
                            GEPSplitterPass?<br>
                            <br>
                            // GEPSplitter - Split complex GEPs into
                            simple ones<br>
                            <br>
                            in<br>
                            <br>
                            ./include/llvm/Transforms/Scalar.h
                            <div><br>
                              <br>
                              On 06/12/11 20:53, Ryan Taylor wrote: </div>
                            <blockquote type="cite">
                              <div> Does a transform exist to breakdown
                                the GEP?<br>
                                <br>
                                <fieldset></fieldset>
                                <br>
                              </div>
                              <pre>_______________________________________________
LLVM Developers mailing list
<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a>
</pre>
                            </blockquote>
                            <br>
                          </div>
                        </blockquote>
                      </div></div></div>
                      <br>
                    </div>
                  </div>
                </blockquote>
              </div>
              <br>
            </div>
          </div>
        </blockquote>
      </div>
      <br>
    </blockquote>
    <br>
  </div></div></div>

</blockquote></div><br>
<br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br></div></div></div>
</blockquote></div><br>
</div></div></div><br>
</div></div></blockquote></div><br>
</div></div></blockquote></div><br>