<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">On 03/22/2013 03:22 PM, Nadav Rotem
      wrote:<br>
    </div>
    <blockquote
      cite="mid:CE4D8862-255B-4530-A367-9E323F4741ED@apple.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      Hi Reed, 
      <div><br>
      </div>
      <div>We will need to reconstruct the target machine and the TTI
        chain when the function attributes change. We currently don't
        have code for doing that but I suggest that you talk with Bill
        Wendling about the best way to implement this. </div>
      <div><br>
      </div>
    </blockquote>
    <br>
    Cool. Bill's new attribute work has already made this task much
    easier for me.<br>
    <br>
    I'm willing to contribute to the compiler in this area and any
    advice is greatly appreciated.<br>
    <br>
    If Bill is already scheduled to do this then i can also wait like I
    did for his attribute work.<br>
    <br>
    Reed<br>
    <br>
    <blockquote
      cite="mid:CE4D8862-255B-4530-A367-9E323F4741ED@apple.com"
      type="cite">
      <div>Thanks,</div>
      <div>Nadav</div>
      <div><br>
        <div>
          <div>On Mar 22, 2013, at 11:30 AM, Reed Kotler <<a
              moz-do-not-send="true" href="mailto:rkotler@mips.com">rkotler@mips.com</a>>
            wrote:</div>
          <br class="Apple-interchange-newline">
          <blockquote type="cite">
            <div style="letter-spacing: normal; orphans: auto;
              text-align: start; text-indent: 0px; text-transform: none;
              white-space: normal; widows: auto; word-spacing: 0px;
              -webkit-text-stroke-width: 0px;">Just realized that
              BasicTransformInfoClass is an immutable pass.<br>
              <br>
              Not sure how to reconcile this with fact that there will
              be different answers needed depending on the subtarget.<br>
              <br>
              Seems like BasicTansformInfoClass should become a function
              pass that does not modify  anything.<br>
              <br>
              On 03/22/2013 09:43 AM, Reed Kotler wrote:<br>
              <blockquote type="cite">Another way to do this would to be
                to have a reset virtual function<br>
                which is passed the Function, and the address of TLI so
                that it could be<br>
                modified.<br>
                <br>
                This seems somewhat cleaner.<br>
                <br>
                The reset virtual function would be added to base class
                TargetLoweringBase.<br>
                <br>
                <br>
                On 03/22/2013 09:22 AM, reed kotler wrote:<br>
                <blockquote type="cite">For being able to change
                  subtargets within a compilation unit, among<br>
                  other things, I need to be able to change the target
                  lowering class that<br>
                  is used by BasicTTI<br>
                  <br>
                  For example we have a mips16 and non mips16 version.<br>
                  <br>
                  On the original call that creates this class, I'd like
                  to pass the<br>
                  address of the address of the TargetLoweringBase
                  class.<br>
                  <br>
                  That way I can insert a function pass before this pass
                  which examines<br>
                  the function attributes and changes the pointer.<br>
                  <br>
                  So we would get:<br>
                  <br>
                  ImmutablePass *<br>
                  llvm::createBasicTargetTransformInfoPass(const
                  TargetLoweringBase<br>
                  **TLI_) {<br>
                    return new BasicTTI(TLI);<br>
                  }<br>
                  <br>
                  we would add the variable<br>
                  <br>
                  TargetLoweringBase **TLI_<br>
                  <br>
                  and at the beginning of each pass<br>
                  <br>
                  TLI = *TLI_;<br>
                  <br>
                  Maybe there is a more elegant way to do this but this
                  is essentially<br>
                  what I need to do.<br>
                </blockquote>
              </blockquote>
              <br>
              <br>
              _______________________________________________<br>
              LLVM Developers mailing list<br>
              <a moz-do-not-send="true"
                href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>
                      <a moz-do-not-send="true"
                href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a><br>
              <a moz-do-not-send="true"
                href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a></div>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
  </body>
</html>