XCore target: fix bug in XCoreLowerThreadLocal.cpp

Rafael Espíndola rafael.espindola at gmail.com
Sat Sep 28 09:45:21 PDT 2013


On 28 September 2013 05:41, Robert Lytton <robert at xmos.com> wrote:
> Hi Rafael,
>
> I have not looked at C++ at all viz exceptions - so thank you for bringing it to light.
>
> I intend the default lowering to replace const expressions in an instruction with run time expressions immediately in front of the instruction. For Phi nodes, these expressions need to be placed prior to the preceding terminator instruction.
>
> Reading the LanRef leads me to understand the 'invoke' instructions as terminator instructions, thus we can insert new expressions in front of them.
> The only issue is with the return value but this is not an issue to us viz:
>
>     There must be no non-phi instructions between the start of a basic block and the PHI instructions: i.e. PHI instructions must be first in a basic block.
>     For the purposes of the SSA form, the use of each incoming value is deemed to occur on the edge from the corresponding predecessor block to the current block (but after any definition of an ‘invoke‘ instruction’s return value on the same edge).
>
> I apologise if I am not following, and thank you for your input and interest.

The issues is just that the return value of the invoke is made
available at the edge, so if you want to put something in between an
invoke and a phi use, you have to split the edge.

I am not familiar with the code you are changing, but if invokes are
not expected it is probably a good idea to add an assert.

Cheers,
Rafael




More information about the llvm-commits mailing list