Skip to content

Commit

Permalink
[mlir][vector] rephrased description
Browse files Browse the repository at this point in the history
More carefully worded description. Added constructor to options.

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D92664
  • Loading branch information
aartbik committed Dec 4, 2020
1 parent 1b404ad commit fc7818f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
10 changes: 6 additions & 4 deletions mlir/include/mlir/Conversion/Passes.td
Original file line number Diff line number Diff line change
Expand Up @@ -394,9 +394,10 @@ def ConvertVectorToLLVM : Pass<"convert-vector-to-llvm", "ModuleOp"> {

Convert operations from the vector dialect into the LLVM IR dialect
operations. The lowering pass provides several options to control
the kind of optimizations that are allowed. It also provides options
that augment the architectural-neutral vector dialect with
architectural-specific dialects (AVX512, Neon, etc.).
the kinds of optimizations that are allowed. It also provides options
that enable the use of one or more architectural-specific dialects
(AVX512, Neon, SVE, etc.) in combination with the architectural-neutral
vector dialect lowering.

}];
let constructor = "mlir::createConvertVectorToLLVMPass()";
Expand All @@ -411,7 +412,8 @@ def ConvertVectorToLLVM : Pass<"convert-vector-to-llvm", "ModuleOp"> {
"faster code">,
Option<"enableAVX512", "enable-avx512",
"bool", /*default=*/"false",
"Augments the vector dialect with the AVX512 dialect during lowering">
"Enables the use of AVX512 dialect while lowering the vector "
"dialect.">
];
}

Expand Down
11 changes: 8 additions & 3 deletions mlir/include/mlir/Conversion/VectorToLLVM/ConvertVectorToLLVM.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ class OperationPass;
/// This should kept in sync with VectorToLLVM options defined for the
/// ConvertVectorToLLVM pass in include/mlir/Conversion/Passes.td
struct LowerVectorToLLVMOptions {
bool reassociateFPReductions = false;
bool enableIndexOptimizations = true;
bool enableAVX512 = false;
LowerVectorToLLVMOptions()
: reassociateFPReductions(false), enableIndexOptimizations(true),
enableAVX512(false) {}

LowerVectorToLLVMOptions &setReassociateFPReductions(bool b) {
reassociateFPReductions = b;
return *this;
Expand All @@ -36,6 +37,10 @@ struct LowerVectorToLLVMOptions {
enableAVX512 = b;
return *this;
}

bool reassociateFPReductions;
bool enableIndexOptimizations;
bool enableAVX512;
};

/// Collect a set of patterns to convert from Vector contractions to LLVM Matrix
Expand Down

0 comments on commit fc7818f

Please sign in to comment.