Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let ConvertToROCDL use MathToROCDL, not MathToLLVM #19994

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions compiler/src/iree/compiler/Codegen/LLVMGPU/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ iree_compiler_cc_library(
"@llvm-project//mlir:LinalgTransforms",
"@llvm-project//mlir:MathDialect",
"@llvm-project//mlir:MathToLLVM",
"@llvm-project//mlir:MathToROCDL",
"@llvm-project//mlir:MemRefDialect",
"@llvm-project//mlir:MemRefToLLVM",
"@llvm-project//mlir:MemRefTransforms",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ iree_cc_library(
MLIRLinalgTransforms
MLIRMathDialect
MLIRMathToLLVM
MLIRMathToROCDL
MLIRMemRefDialect
MLIRMemRefToLLVM
MLIRMemRefTransforms
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "mlir/Conversion/LLVMCommon/ConversionTarget.h"
#include "mlir/Conversion/LLVMCommon/LoweringOptions.h"
#include "mlir/Conversion/LLVMCommon/TypeConverter.h"
#include "mlir/Conversion/MathToLLVM/MathToLLVM.h"
#include "mlir/Conversion/MathToROCDL/MathToROCDL.h"
#include "mlir/Conversion/MemRefToLLVM/MemRefToLLVM.h"
#include "mlir/Conversion/UBToLLVM/UBToLLVM.h"
#include "mlir/Conversion/VectorToLLVM/ConvertVectorToLLVM.h"
Expand Down Expand Up @@ -217,7 +217,6 @@ struct ConvertToROCDLPass final
populateLowerHALInterfaceOp(llvmPatterns);
populateLLVMConversionPatterns(&getContext(), llvmPatterns, converter);
populateComplexToLLVMConversionPatterns(converter, llvmPatterns);
populateMathToLLVMConversionPatterns(converter, llvmPatterns);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You won't want to get rid of this since this has patterns that the device libraries don't - that is, MathToROCDL only includes things that don't get covered by MathToLLVM

iree_compiler::populateIREEResolveExtractStridedMetadataPatterns(
llvmPatterns);
populateFinalizeMemRefToLLVMConversionPatterns(converter, llvmPatterns);
Expand All @@ -240,6 +239,7 @@ struct ConvertToROCDLPass final
LLVMConversionTarget target(getContext());
populateFuncToLLVMFuncOpConversionPattern(converter, llvmPatterns);
configureGpuToROCDLConversionLegality(target);
populateMathToROCDLConversionPatterns(converter, llvmPatterns);
ub::populateUBToLLVMConversionPatterns(converter, llvmPatterns);

if (failed(applyPartialConversion(m, target, std::move(llvmPatterns))))
Expand Down
Loading