Skip to content

Commit acda939

Browse files
committed
Drop redundant lines
1 parent bc4c650 commit acda939

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

mlir/lib/Dialect/AMDGPU/IR/AMDGPUDialect.cpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff 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
});

0 commit comments

Comments
 (0)