[Mlir-commits] [mlir] b673205 - Make helpers static. NFC.
Benjamin Kramer
llvmlistbot at llvm.org
Tue Mar 24 05:44:02 PDT 2020
Author: Benjamin Kramer
Date: 2020-03-24T13:43:00+01:00
New Revision: b6732056a448d39fe6e17a23a4fbc5ccede71781
URL: https://github.com/llvm/llvm-project/commit/b6732056a448d39fe6e17a23a4fbc5ccede71781
DIFF: https://github.com/llvm/llvm-project/commit/b6732056a448d39fe6e17a23a4fbc5ccede71781.diff
LOG: Make helpers static. NFC.
Added:
Modified:
llvm/lib/Support/OptimalLayout.cpp
mlir/lib/Conversion/AVX512ToLLVM/ConvertAVX512ToLLVM.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Support/OptimalLayout.cpp b/llvm/lib/Support/OptimalLayout.cpp
index b0c7720e71c6..93f912bf73a3 100644
--- a/llvm/lib/Support/OptimalLayout.cpp
+++ b/llvm/lib/Support/OptimalLayout.cpp
@@ -15,8 +15,8 @@
using namespace llvm;
#ifndef NDEBUG
-void checkValidLayout(ArrayRef<OptimalLayoutField> Fields,
- uint64_t Size, Align MaxAlign) {
+static void checkValidLayout(ArrayRef<OptimalLayoutField> Fields, uint64_t Size,
+ Align MaxAlign) {
uint64_t LastEnd = 0;
Align ComputedMaxAlign;
for (auto &Field : Fields) {
diff --git a/mlir/lib/Conversion/AVX512ToLLVM/ConvertAVX512ToLLVM.cpp b/mlir/lib/Conversion/AVX512ToLLVM/ConvertAVX512ToLLVM.cpp
index 7a8c1e81fcb8..af29714eb69a 100644
--- a/mlir/lib/Conversion/AVX512ToLLVM/ConvertAVX512ToLLVM.cpp
+++ b/mlir/lib/Conversion/AVX512ToLLVM/ConvertAVX512ToLLVM.cpp
@@ -27,7 +27,8 @@ using namespace mlir::edsc::intrinsics;
using namespace mlir::vector;
using namespace mlir::avx512;
-template <typename OpTy> Type getSrcVectorElementType(OpTy op) {
+template <typename OpTy>
+static Type getSrcVectorElementType(OpTy op) {
return op.src().getType().template cast<VectorType>().getElementType();
}
@@ -38,10 +39,11 @@ template <typename OpTy> Type getSrcVectorElementType(OpTy op) {
/// LLVM Dialect Ops. Convert the type of the result to an LLVM type, pass
/// operands as is, preserve attributes.
template <typename SourceOp, typename TargetOp>
-LogicalResult matchAndRewriteOneToOne(const ConvertToLLVMPattern &lowering,
- LLVMTypeConverter &typeConverter,
- Operation *op, ArrayRef<Value> operands,
- ConversionPatternRewriter &rewriter) {
+static LogicalResult
+matchAndRewriteOneToOne(const ConvertToLLVMPattern &lowering,
+ LLVMTypeConverter &typeConverter, Operation *op,
+ ArrayRef<Value> operands,
+ ConversionPatternRewriter &rewriter) {
unsigned numResults = op->getNumResults();
Type packedType;
@@ -75,6 +77,7 @@ LogicalResult matchAndRewriteOneToOne(const ConvertToLLVMPattern &lowering,
return success();
}
+namespace {
// TODO(ntv): Patterns are too verbose due to the fact that we have 1 op (e.g.
// MaskRndScaleOp) and
diff erent possible target ops. It would be better to take
// a Functor so that all these conversions become 1-liners.
@@ -145,6 +148,7 @@ struct ScaleFOpPD512Conversion : public ConvertToLLVMPattern {
*this, this->typeConverter, op, operands, rewriter);
}
};
+} // namespace
/// Populate the given list with patterns that convert from AVX512 to LLVM.
void mlir::populateAVX512ToLLVMConversionPatterns(
More information about the Mlir-commits
mailing list