[patch] if-conversion of loops with conditionals containing memory loads and stores

Sebastian Pop sebpop@gmail.com
Wed Jun 23 18:13:00 GMT 2010


On Wed, Jun 23, 2010 at 11:28, Jeff Law <law@redhat.com> wrote:
> On 06/22/10 14:17, Sebastian Pop wrote:
>>
>> Hi,
>>
>> The attached patches (on top of the previous patch set) are needed to
>> if-convert the DCT loop kernel of FFmpeg.
>>
>> 0009 replaces the memory writes that are in predicated basic blocks
>> with a full write: "if (cond) A[i] = foo" is replaced with "A[i] =
>> cond ? foo : A[i]".  In order to do this, the patch replaces the call
>> to gimple_assign_rhs_could_trap_p with gimple_could_trap_p, as we now
>> have to check that the LHS of assign stmts in conditions do not trap.
>>
>
> Doesn't this run afoul of the C++0x memory model?
>

This still does fit in the -fmemory-model=single as discussed in
http://gcc.gnu.org/ml/gcc/2010-05/msg00171.html

I could add a separate flag for this transformation, such that it will
be easier to separate it from the rest of the tree-if-conversion pass
when implementing the -fmemory-model flag.

Sebastian Pop
--
AMD / Open Source Compiler Engineering / GNU Tools



More information about the Gcc-patches mailing list