[llvm-dev] LibCallAliasAnalysis class instantiation parameter

Chris Chrulski via llvm-dev llvm-dev at lists.llvm.org
Thu Aug 6 08:34:28 PDT 2015


Hello,
Can anybody tell me the intent of the LibCallAliasAnalysisclass? I see that to instantiate it, it requires a class derived from the purevirtual class LibCallInfo, but I cannot find any classes in the source treethat derive from LibCallInfo. Is this derived class intended to be suppliedfrom a compiler front-end, library writer, or the llvm backend?   I was looking at a case similar to the following:
          #include <math.h>
double x[1000], y[1000];double angle;  void rotate(int point_count) {   int i;     for (i=0; i < point_count; i++) {        double tmp_x = x[i];        x[i] = tmp_x * cos(angle) - y[i] *sin(angle);        y[i] = y[i] * cos(angle) + tmp_x *sin(angle);   }}  In this case, the queries done by getModRefInfo are unableto avoid loading the ‘angle’ variable from memory for each call to sin/cos.Based on the comments in LibCallSemantics.h, it appears that LibCallAliasAnalysis shouldbe able to handle this case by recognizing that sin/cos only affect errno. However, I don’t see any way of enabling this analysis without an appropriate derivation of LibCallInfo. Does anybody have info for using this analysis?
Thanks, Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150806/3f806e2a/attachment.html>


More information about the llvm-dev mailing list