XCore target: fix bug in XCoreLowerThreadLocal.cpp

Rafael Espíndola rafael.espindola at gmail.com
Fri Sep 27 16:54:30 PDT 2013


I don't think this correctly handles invokes:

For the purposes of the SSA form, the definition of the value returned
by the ‘invoke‘ instruction is deemed to occur on the edge from the
current block to the “normal” label. If the callee unwinds then no
return value is available.

On 24 September 2013 05:02, Robert Lytton <robert at xmos.com> wrote:
> Hi Richard,
> The code has been changed to handle duplicate constant expressions in the
> phi instruction  (only triggers under O0).
> Robert
>
> ________________________________
> From: Richard Osborne
> Sent: 23 September 2013 18:22
> To: Robert Lytton
> Cc: llvm-commits at cs.uiuc.edu
> Subject: Re: XCore target: fix bug in XCoreLowerThreadLocal.cpp
>
> Hi Robert,
>
> +          // in the calling BB, infront of the branch instruction.
>
> calling BB doesn't seem the right terminology, how about: in the
> predecessor, before the branch instruction.
>
> +          if (PHINode *PN = dyn_cast<PHINode>(WU))
> +            for (int I=0, E=PN->getNumIncomingValues(); I < E; ++I)
> +              if (PN->getIncomingValue(I) == CE) {
> +                InsertPos = &PN->getIncomingBlock(I)->back();
> +                break;
> +              }
> +          Instruction *NewInst = createReplacementInstr(CE, InsertPos);
>
> What happens if the constant expression appears twice in the phi
> instruction? Also there should be spaces around '='
>
> On 23/09/13 17:59, Robert Lytton wrote:
>
> Hi,
>
> Attached is a patch to fix:
>
>    XCore target: fix bug in XCoreLowerThreadLocal.cpp
>
>     When a ConstantExpr which uses a thread local is part of a PHI node
>     instruction, the insruction that replaces the ConstantExpr must
>     be inserted in the calling block just before the branch instruction.
>
>
> Robert
>
>
>
> --
> Richard Osborne | XMOS
> http://www.xmos.com
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>




More information about the llvm-commits mailing list