<div dir="ltr">On Sat, Mar 30, 2013 at 11:58 AM, Sean Silva <span dir="ltr"><<a href="mailto:silvas@purdue.edu" target="_blank">silvas@purdue.edu</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><span style="font-size:13px;font-family:arial,sans-serif">Could you give a bit more background on the motivation for this? I wasn't able to find any discussion on llvmdev.</span></div>
</div></blockquote><div><br></div><div style>The only real motivation is compatibility with CUDA. This pass is needed for linking with certain CUDA libraries that rely on this to implement selecting between code paths based on fast-math flags. I would love to get rid of this in the future, but it was created long before I had any say in it. :)</div>
<div style><br></div><div style>The idea is that most users won't use it, but those that want to link to certain CUDA libraries will (at least for now). I just want to upstream it to maximize compatibility between the open-source version and the proprietary bits that ship with CUDA.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="im">
<div><span style="font-size:13px;font-family:arial,sans-serif"><br></span></div><div><span style="font-size:13px;font-family:arial,sans-serif">+// This pass replaces occurences of __nvvm_reflect("string") with an</span><br style="font-size:13px;font-family:arial,sans-serif">
<span style="font-size:13px;font-family:arial,sans-serif">+// integer based on -nvvm-reflect-list string=<int> option given to this pass.</span><span style="font-size:13px;font-family:arial,sans-serif"><br>
</span></div><div><span style="font-size:13px;font-family:arial,sans-serif"><br></span></div></div><div><span style="font-size:13px;font-family:arial,sans-serif">Please give an example of usage here.</span></div>
<div><span style="font-size:13px;font-family:arial,sans-serif"><br></span></div><div><span style="font-size:13px;font-family:arial,sans-serif">It also seems that in some places you say "0/1", but in this description you say "<int>". Is any int allowed? Please clarify.</span></div>
</div></blockquote><div><br></div><div style>Technically any int is allowed, but only 0/1 is actually used in practice right now. I'll update the comments.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div class="im">
<div><span style="font-size:13px;font-family:arial,sans-serif"><br></span></div><div><span style="font-size:13px;font-family:arial,sans-serif">+ int reflectVal = 0; // The default value is 0</span><span style="font-size:13px;font-family:arial,sans-serif"><br>
</span></div><div><span style="font-size:13px;font-family:arial,sans-serif"><br></span></div></div><div><font color="#000000" face="arial, sans-serif">Please put this information in the top-of-the-file comment.</font></div>
</div></blockquote><div><br></div><div style>Sure.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">
<span style="font-size:13px;font-family:arial,sans-serif"><div class="im"><div><span style="font-size:13px;font-family:arial,sans-serif"><br></span></div><div>+ for (unsigned i = 0, e = ReflectList.size(); i != e; ++i) {<br>
+ // DEBUG(dbgs() << "Option : " << ReflectList[i] << std::endl);<span style="font-size:13px;font-family:arial,sans-serif"><br></span></div><div><br></div></div><div class="im"><div>+ reflectArg = reflectArg.substr(0, reflectArg.size() - 1);<br>
+ // DEBUG(dbgs() << "Arg of _reflect : " << reflectArg << std::endl);<span style="font-size:13px;font-family:arial,sans-serif"><br></span></div><div><br></div></div><div class="im">+ //std::map<std::string, int> VarMap;</div>
</span><br style="font-size:13px;font-family:arial,sans-serif">
<span style="font-size:13px;font-family:arial,sans-serif">+ StringMap<int> VarMap;</span><br><div><span style="font-size:13px;font-family:arial,sans-serif"><br></span></div><div>
<span style="font-size:13px;font-family:arial,sans-serif">Please remove commented-out code.</span></div></div></blockquote><div><br></div><div style>Oops...</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div class="im"><div><span style="font-size:13px;font-family:arial,sans-serif"><br></span></div>
<div><span style="font-size:13px;font-family:arial,sans-serif">+static std::vector<std::string></span><br style="font-size:13px;font-family:arial,sans-serif"><span style="font-size:13px;font-family:arial,sans-serif">+Tokenize(const std::string &str, const std::string &delim) {</span><br style="font-size:13px;font-family:arial,sans-serif">
<span style="font-size:13px;font-family:arial,sans-serif">+ std::vector<std::string> tokens;</span><br style="font-size:13px;font-family:arial,sans-serif"><br></div></div><div><font color="#000000" face="arial, sans-serif">Is there a particular reason you aren't following the LLVM naming convention here and throughout?</font></div>
</div></blockquote><div><br></div><div style>Not really. Internally, attempts to follow the LLVM style are lax. This is just a case I missed... :(</div><div style><br></div><div style>Thanks for the review!</div><div> </div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><span class="HOEnZb"><font color="#888888">
<div><font color="#000000" face="arial, sans-serif"><br></font></div><div><font color="#000000" face="arial, sans-serif">-- Sean Silva</font></div></font></span></div>
<br>_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><br><div>Thanks,</div><div><br></div><div>Justin Holewinski</div>
</div></div>