From b6732056a448d39fe6e17a23a4fbc5ccede71781 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Tue, 24 Mar 2020 13:43:00 +0100 Subject: [PATCH] Make helpers static. NFC. --- llvm/lib/Support/OptimalLayout.cpp | 4 ++-- mlir/lib/Conversion/AVX512ToLLVM/ConvertAVX512ToLLVM.cpp | 14 +++++++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/llvm/lib/Support/OptimalLayout.cpp b/llvm/lib/Support/OptimalLayout.cpp index b0c7720..93f912b 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 Fields, - uint64_t Size, Align MaxAlign) { +static void checkValidLayout(ArrayRef 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 7a8c1e8..af29714 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 Type getSrcVectorElementType(OpTy op) { +template +static Type getSrcVectorElementType(OpTy op) { return op.src().getType().template cast().getElementType(); } @@ -38,10 +39,11 @@ template Type getSrcVectorElementType(OpTy op) { /// LLVM Dialect Ops. Convert the type of the result to an LLVM type, pass /// operands as is, preserve attributes. template -LogicalResult matchAndRewriteOneToOne(const ConvertToLLVMPattern &lowering, - LLVMTypeConverter &typeConverter, - Operation *op, ArrayRef operands, - ConversionPatternRewriter &rewriter) { +static LogicalResult +matchAndRewriteOneToOne(const ConvertToLLVMPattern &lowering, + LLVMTypeConverter &typeConverter, Operation *op, + ArrayRef 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 different 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( -- 2.7.4