<div dir="ltr"><div class="gmail_extra">Hi James,<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">Comments below.</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">
<div class="gmail_extra">   /// getLibFunc - Search for a particular function name.  If it is one of the</div><div class="gmail_extra">   /// known library functions, return true and set F to the corresponding value.</div>
<div class="gmail_extra">-  bool getLibFunc(StringRef funcName, LibFunc::Func &F) const;</div><div class="gmail_extra">+  virtual bool getLibFunc(StringRef funcName, LibFunc::Func &F) const;</div><div class="gmail_extra">
<br></div><div class="gmail_extra">Are you going to use this for non-Lib calls, too? If so, I suggest changing the names of this and related calls.</div></div><div class="gmail_extra"><br></div><div class="gmail_extra"><br>
</div><div class="gmail_extra"><div class="gmail_extra">+  virtual Function *getScalarized(LibFunc::Func F) {</div><div class="gmail_extra">+    return NULL;</div><div class="gmail_extra">+  }</div><div class="gmail_extra">
+  virtual Function *getVectorized(LibFunc::Func F, unsigned VF) {<br></div><div class="gmail_extra">+    return NULL;</div><div class="gmail_extra">+  }</div><div class="gmail_extra"><br></div><div class="gmail_extra">These could be merged into: getFunction(Func, VF)</div>
<div class="gmail_extra">and if VF == 1, you return the scalarized one. Other calls in the vectorizer do that.</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_extra">
+  virtual CallInst *getVectorizedCall(LibFunc::Func F, unsigned VF,</div><div class="gmail_extra">+                                      ArrayRef<Value*> Args) {</div><div class="gmail_extra">+    return NULL;</div>
<div class="gmail_extra">+  }</div><div class="gmail_extra"><br></div><div class="gmail_extra">and getFunctionCall(...)</div><div class="gmail_extra">with the same behaviour about VF above.</div><div class="gmail_extra"><br>
</div><div class="gmail_extra">AFACT, the scalar and vector parts of the vectorizer are well defined, and you don't need to specify it explicitly.</div><div class="gmail_extra"><br></div><div class="gmail_extra">cheers,</div>
<div class="gmail_extra">--renato</div></div></div></div>