[PATCH] [LegalizeVectors] Improve vector CTPOP expansion

hfinkel at anl.gov hfinkel at anl.gov
Wed May 27 11:44:05 PDT 2015


REPOSITORY
  rL LLVM

================
Comment at: include/llvm/Target/TargetLowering.h:280
@@ +279,3 @@
+  /// count by unrolling the operation instead of using vector bit manipulation.
+  virtual bool isCheapToUnrollVectorPopCount(EVT VT) const { return true; }
+
----------------
This highlights an unfortunate terminology collision that we really should fix. Essentially everywhere in LLVM, "Unroll" refers to something done to loops (not vectors). The operation referred to here is called 'Scalarize', not only in TTI and its users, but also all over CodeGen too, and I think that's a better name (we're breaking the vector apart into scalar operations, and then rebuilding a vector from the results).

I'd like to not make the problem worse with this patch: Please call the operation Scalarize, not Unroll. Fixing the other few places in CodeGen (just the users of DAG.UnrollVectorOp in practice) would also be a nice follow-up.

http://reviews.llvm.org/D10002

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list