Skip to content

Latest commit

 

History

History
43 lines (29 loc) · 2.85 KB

README_SLP.md

File metadata and controls

43 lines (29 loc) · 2.85 KB

SLP-Vectorization

The SLP directory contains 11 files, each dealing with a different SLP topic.

Please note that a superword in this project describes an SLP vector containing the elements. This term was chosen because a vector is slightly overloaded with meanings in C++.

  • CostModel.h

    • Contains the cost model, which assigns cost to scalar operations, superwords and entire patterns using a visitor pattern.
  • GraphConversion.h

    • A very important file that contains the ConversionManager class. The conversion manager keeps track of created vector operations, extractions and maintains a ConversionState. The conversion state is responsible for remembering which scalar/superword values have been computed already. The conversion manager is also responsible for gracefully resetting the function state in case an SLP graph is not deemed profitable.
  • PatternVisitors.h

    • Contains the visitor template and the LeafPatternVisitor, which can determine the scalar values that need to be computed for every leaf pattern (e.g. a BroadcastInsertPattern needs a scalar broadcast value and scalar insert values).
  • ScoreModel.h

    • Contains the Look-Ahead-Score score model from the original Look-Ahead SLP publication [1]. Also contains the XOR chain model.
  • Seeding.h

    • Contains the classes used for top-down and bottom-up seeding.
  • SLPGraph.h

    • Contains the superword logic and the logic for actual SLP graphs (nodes and multinodes). Note: there is no explicit SLPGraphEdge class or something similar.
  • SLPGraphBuilder.h

    • Contains a graph builder that constructs SLP graphs as described in Porpodas et al. [1].
  • SLPPatternMatch.h

    • Responsible for selecting the best patterns based on the cost model and the current conversion state.
  • SLPVectorizationPatterns.h

    • The individual patterns that can be applied to superwords and their match and rewrite logic. They were designed in a somewhat similar fashion compared to MLIR's pattern rewrite framework.
  • Util.h

    • Some utility functions, such as vectorizable(...) or commutative(...).

Known Issues

  • ShufflePattern: With shuffle patterns enabled, the output of the kernels sometimes does not match the expected output. This might be due to the reordering changing semantics and the shuffle pattern accessing elements with changed semantics by accident.
  • The SPN compiler options are replicated inside the util class. This is a little bit annoying.

References

[1] Vasileios Porpodas, Rodrigo C. O. Rocha, and Luís F. W. Góes. 2018. Look-ahead SLP: auto-vectorization in the presence of commutative operations. In Proceedings of the 2018 International Symposium on Code Generation and Optimization (CGO 2018). Association for Computing Machinery, New York, NY, USA, 163–174.