Skip to content

Explicit SIMD-Vector Upgrades (Was: Short vector shuffles (fixes #124))

Nick Curtis requested to merge arghdos/loopy:explicit_vec_fix into master

The current status is:

  • Short vector shuffles / vloads / vstores (determined from affine access patterns) -- implemented, albeit the conversion from vstores -> vloads is a bit ugly right now...
  • Better detection of when to promote temporaries to vector-dtypes -- implemented. This takes the form of two promotion heuristics, one for ILP and one for Vec. A temporary is only promoted to a vector-dtype if it's written to by an instruction that directly depends on the vector iname. Those missed in the first pass are recursively promoted after the fact by a write dependency. See find_privitzing_inames for the reasoning behind this.
  • this includes a small markup in the dtype initializer to allow the user to explicitly specify the scalar/vector status of the temporary. I am leaning towards removing this, as I no longer need it (due to 2), and it's a bit buggy. This has been removed.
  • Vector selects to enable conditional assigns from/to vector variables -- implemented, although a bit ugly / hacky
    • use of inline vector literals to allow use of vector inames directly in vector conditionals -- implemented
  • Upgrades to VectorizabilityChecker RE: comparisons, logical/bitwise operators, function calls -- implemented

More generally I'd like some input on "the loopy-onic" way to implement these features, as some of what I'm doing seems like it's potentially not the best way.


Previously was:

@inducer This addresses task 1 in #124. We may want to further refine the error message raised in eval_expr_assert_integer_constant.

To address task 2, I think we need a more thorough approach. Either we need to teach try_vectorized that it's ok to attempt to substitute in the vector iname range in the integer or we can stick with what I did and simply fall back to the unvec approach for non-stupidly simple vectorizations (i.e., for indicies that are not-constant or not identically equal to the vec iname)

If we want to stick with the second approach (what I implemented), we can remove the WIP tag here pending the CI tests passing

Edited by Nick Curtis

Merge request reports