This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [trans-mem] thread-private malloc optimizations
> (1) Inside that loop, you need to check for self-assignment like
> can happen in loops:
>
> bb1:
> x_1 = ...
> goto bb3;
> bb2:
> x_2 = ...
> goto bb3;
> bb3:
> x_3 = PHI (x_1(1), x_2(2), x_3(3))
> ...
> goto bb3
I can't seem to come up with a testcase to see an example. Would I just
ignore self-assignment in the loop, that is take the result of analyzing
just x_1 and x_2?
> (2) You need to perform a MIN operation there between the old
> retval and the one you get from the recursive call. At the
> moment you're promoting thread_local to transaction_local.
>
> The rest of the patch looks ok.
That was on purpose, see comment. The caller (requires_barrier)
generates a log for mem_thread_local, whereas there is no log created
for mem_transaction_local. If we pass back mem_thread_local, we'd
create a log twice. Isn't the whole purpose of knowing that all the PHI
arguments have been handled, not having to generate a log or
save/restore pair?
Aldy