RFC: Enable vectorization of call instructions in the loop vectorizer

James Molloy James.Molloy at arm.com
Thu Dec 19 05:38:54 PST 2013


Hi Renato,

Thanks for the review!

> Are you going to use this for non-Lib calls, too? If so, I suggest changing the names of this and related calls.

Not at the moment. You're referring to the metadata-passing mechanism, which will be eventually implemented as part of TLI, I think. I'd like to keep getLibFunc as-is at the moment, and change the name when the metadata-passing stuff and API is fully fleshed out (not speculatively, is what I'm saying).

> These could be merged into: getFunction(Func, VF)
> and if VF == 1, you return the scalarized one. Other calls in the vectorizer do that.

Very reasonable, although I think the new name "getFunction" is ambiguous. I'd like to keep it as "getVectorizedFunction", but with a large note in the doxygen that if VF == 1, it scalarizes. Same for getVectorizedCall().

If I make those changes, is it OK?

James


From: Renato Golin [mailto:renato.golin at linaro.org]
Sent: 19 December 2013 13:26
To: James Molloy
Cc: Hal Finkel; Arnold Schwaighofer; llvm-commits
Subject: Re: RFC: Enable vectorization of call instructions in the loop vectorizer

Hi James,

Comments below.


   /// getLibFunc - Search for a particular function name.  If it is one of the
   /// known library functions, return true and set F to the corresponding value.
-  bool getLibFunc(StringRef funcName, LibFunc::Func &F) const;
+  virtual bool getLibFunc(StringRef funcName, LibFunc::Func &F) const;

Are you going to use this for non-Lib calls, too? If so, I suggest changing the names of this and related calls.


+  virtual Function *getScalarized(LibFunc::Func F) {
+    return NULL;
+  }
+  virtual Function *getVectorized(LibFunc::Func F, unsigned VF) {
+    return NULL;
+  }

These could be merged into: getFunction(Func, VF)
and if VF == 1, you return the scalarized one. Other calls in the vectorizer do that.


+  virtual CallInst *getVectorizedCall(LibFunc::Func F, unsigned VF,
+                                      ArrayRef<Value*> Args) {
+    return NULL;
+  }

and getFunctionCall(...)
with the same behaviour about VF above.

AFACT, the scalar and vector parts of the vectorizer are well defined, and you don't need to specify it explicitly.

cheers,
--renato

-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

ARM Limited, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No: 2557590
ARM Holdings plc, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No: 2548782
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131219/97f22500/attachment.html>


More information about the llvm-commits mailing list