<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">Hi Robert,<br>
      <br>
      +          // in the calling BB, infront of the branch
      instruction.<br>
      <br>
      calling BB doesn't seem the right terminology, how about: in the
      predecessor, before the branch instruction.<br>
      <br>
      +          if (PHINode *PN = dyn_cast<PHINode>(WU))<br>
      +            for (int I=0, E=PN->getNumIncomingValues(); I <
      E; ++I)<br>
      +              if (PN->getIncomingValue(I) == CE) {<br>
      +                InsertPos =
      &PN->getIncomingBlock(I)->back();<br>
      +                break;<br>
      +              }<br>
      +          Instruction *NewInst = createReplacementInstr(CE,
      InsertPos);<br>
      <br>
      What happens if the constant expression appears twice in the phi
      instruction? Also there should be spaces around '='<br>
      <br>
      On 23/09/13 17:59, Robert Lytton wrote:<br>
    </div>
    <blockquote
cite="mid:E55040AE4CA5DE4A84D2754CE295AF300149B403@EXMAILBOX1.vo.spidergroup.co.uk"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      <style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
      <div style="direction: ltr;font-family: Tahoma;color:
        #000000;font-size: 10pt;">Hi,<br>
        <br>
        Attached is a patch to fix:<br>
        <br>
           XCore target: fix bug in XCoreLowerThreadLocal.cpp<br>
            <br>
            When a ConstantExpr which uses a thread local is part of a
        PHI node<br>
            instruction, the insruction that replaces the ConstantExpr
        must<br>
            be inserted in the calling block just before the branch
        instruction.<br>
        <br>
        <br>
        Robert<br>
      </div>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Richard Osborne | XMOS
<a class="moz-txt-link-freetext" href="http://www.xmos.com">http://www.xmos.com</a>
</pre>
  </body>
</html>