[Soot-list] Constant propagation analysis in SOOT

Zhoulai zell08v at gmail.com
Tue Sep 10 01:19:55 EDT 2013


Dear all,

I am about to use  a constant propagation/folder  analysis under Soot
framework. It seems  that there exists  one such implementation in
SOOT already:

soot.jimple.toolkits.scalar.ConstantPropagatorAndFolder

However,  this implementation seems to be naive.  If I understand correctly
its source code,

http://www.massapi.com/source/sootsrc-2.4.0/src/soot/jimple/toolkits/scalar/ConstantPropagatorAndFolder.java.html

the implementation associates with local variables a constant only if this
underlined variable has a single definition site.   For example, the
implementation  cannot decide that 'x' is a constant  for the snippet below:

y=3; z=3; if (?) {x=y} else {x=z};
print (x);

In my application, I need that 'x' be recognized as constant. Although this
is not a difficult problem, I would try to avoid code duplication whenever
possible. So would you please tell me whether Soot has built in a more
sophisticated constant propagation analysis than its
"ConstantPropagatorAndFolder" mentioned above, such as the conditional
constant propagation?  Thanks in advance.

Zhoulai (zell)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20130910/5c6454c6/attachment.html 


More information about the Soot-list mailing list