From c23da89848eaabe9e4602d7508efb2beda7bf398 Mon Sep 17 00:00:00 2001 From: Quinn Dawkins Date: Wed, 30 Oct 2024 11:42:15 -0400 Subject: [PATCH] [Codegen][ROCm] Drop assume alignments This reportedly hurts the LLVM optimizer. We may want to find a better way to annotate alignments. --- .../compiler/Codegen/LLVMGPU/ConvertToROCDL.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/compiler/src/iree/compiler/Codegen/LLVMGPU/ConvertToROCDL.cpp b/compiler/src/iree/compiler/Codegen/LLVMGPU/ConvertToROCDL.cpp index 2e3055eef12b..77c4a1ba1d52 100644 --- a/compiler/src/iree/compiler/Codegen/LLVMGPU/ConvertToROCDL.cpp +++ b/compiler/src/iree/compiler/Codegen/LLVMGPU/ConvertToROCDL.cpp @@ -66,8 +66,21 @@ struct ReplaceGPUBarrierWithLDSBarrier } }; +struct RemoveAssumeAlignOp + : public OpRewritePattern { +public: + using OpRewritePattern::OpRewritePattern; + + LogicalResult matchAndRewrite(memref::AssumeAlignmentOp op, + PatternRewriter &rewriter) const override { + rewriter.eraseOp(op); + return success(); + } +}; + static void populateConvertGPUToAMDGPUPatterns(RewritePatternSet &patterns) { patterns.add(patterns.getContext()); + patterns.add(patterns.getContext()); } } // namespace