File tree Expand file tree Collapse file tree 1 file changed +2
-10
lines changed
mlir/lib/Dialect/AMDGPU/IR Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -562,11 +562,7 @@ struct FoldGatherToLDSOfCast final : OpRewritePattern<GatherToLDSOp> {
562562
563563 // Check source.
564564 if (auto castOp = gatherOp.getSrc ().getDefiningOp <memref::CastOp>()) {
565- auto fromType = dyn_cast<MemRefType>(castOp.getSource ().getType ());
566- auto toType = dyn_cast<MemRefType>(castOp.getSource ().getType ());
567-
568- if (memref::CastOp::canFoldIntoConsumerOp (castOp) && fromType && toType &&
569- fromType.getElementType () == toType.getElementType ()) {
565+ if (memref::CastOp::canFoldIntoConsumerOp (castOp)) {
570566 rewriter.modifyOpInPlace (gatherOp, [&] {
571567 gatherOp.getSrcMutable ().assign (castOp.getSource ());
572568 });
@@ -576,11 +572,7 @@ struct FoldGatherToLDSOfCast final : OpRewritePattern<GatherToLDSOp> {
576572
577573 // Check target.
578574 if (auto castOp = gatherOp.getDst ().getDefiningOp <memref::CastOp>()) {
579- auto fromType = dyn_cast<MemRefType>(castOp.getSource ().getType ());
580- auto toType = dyn_cast<MemRefType>(castOp.getSource ().getType ());
581-
582- if (memref::CastOp::canFoldIntoConsumerOp (castOp) && fromType && toType &&
583- fromType.getElementType () == toType.getElementType ()) {
575+ if (memref::CastOp::canFoldIntoConsumerOp (castOp)) {
584576 rewriter.modifyOpInPlace (gatherOp, [&] {
585577 gatherOp.getDstMutable ().assign (castOp.getSource ());
586578 });
You can’t perform that action at this time.
0 commit comments