[Soot-list] LazyCodeMotion issue

Eric Bodden bodden at st.informatik.tu-darmstadt.de
Sat May 1 14:57:21 EDT 2010


Hi Arie.

I am sorry but I am not at all familiar with this code. But if you are
reasonably sure that your assessment is correct then please submit a
patch. I would be happy to integrate it for you.

Eric

--
Dr. Eric Bodden
Software Technology Group, Technische Universität Darmstadt, Germany
Tel: +49 6151 16-5478    Fax: +49 6151 16-5410
Mailing Address: S2|02 A209, Hochschulstraße 10, 64289 Darmstadt



On 1 May 2010 17:56, Arie Zilberstein <arie.zilberstein at gmail.com> wrote:
> Hi,
> There has been no response yet on the topic of LazyCodeMotion.
> Does anybody know if LazyCodeMotion is in working condition? I suspect that
> this analysis might be broken.
> Best,
> Arie
>
> On Sat, Apr 24, 2010 at 5:58 PM, Arie Zilberstein
> <arie.zilberstein at gmail.com> wrote:
>>
>> Hi,
>> I want to utilize the LazyCodeMotion analysis to remove some redundancies
>> from code.
>> I crafted an example code which I thought was amenable to optimization:
>> private static void testPre(int a, int b) {
>> int sum = 0;
>> int c = a + b;
>> int d = a + b;
>> sum += c;
>> sum += d;
>> System.out.println(sum);
>> }
>> I expected LazyCodeMotion to assign the redundant computation (a+b) to a
>> temporary variable, and replace all following computations by this
>> temporary. However, while a temporary is indeed created, the replacement
>> does not happen.
>> Debugging through the code I found the following:
>> 1. The code section titled "insert the computations" does its job
>> correctly: the expression a+b is indeed assigned to a new temporary $lcm0
>> variable.
>> 2. The code section titled "replace old computations by the helper-vars"
>> does not replace c or d with an assignment to $lcm0.
>> 3. The reason for that is the condition "if (!latestSet.contains(rhs) &&
>> notIsolatedSet.contains(rhs))". The left side is false because, latestSet
>> contains the a+b expression. Therefore no replacement is done.
>> My question is -- is there a bug in LazyCodeMotion or is it a
>> misunderstanding on my part?
>> Best,
>> Arie
>
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>
>


More information about the Soot-list mailing list