[PATCH] D57117: GlobalISel: Add helper to LLT to get a scalar or vector

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 23 13:54:24 PST 2019


arsenm marked an inline comment as done.
arsenm added inline comments.


================
Comment at: include/llvm/Support/LowLevelTypeImpl.h:73
 
+  static LLT scalarOrVector(uint16_t NumElements, LLT ScalarTy) {
+    return NumElements == 1 ? ScalarTy : LLT::vector(NumElements, ScalarTy);
----------------
paquette wrote:
> What happens if `NumElements == 0`? Seems good to assert that it's greater than 0 in both functions, unless a vector of 0 elements is the desired behaviour.
I think that would be redundant with the assert in vector()


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57117/new/

https://reviews.llvm.org/D57117





More information about the llvm-commits mailing list