26
26
#include " mlir/Dialect/Func/IR/FuncOps.h"
27
27
#include " mlir/Dialect/MemRef/IR/MemRef.h"
28
28
#include " mlir/Dialect/OpenMP/OpenMPDialect.h"
29
- #include " mlir/Dialect/SCF/SCF.h"
29
+ #include " mlir/Dialect/SCF/IR/ SCF.h"
30
30
#include " mlir/IR/BlockAndValueMapping.h"
31
31
32
32
using namespace mlir ;
@@ -277,7 +277,7 @@ bool isCaptured(Value v, Operation *potentialUser = nullptr,
277
277
continue ;
278
278
}
279
279
if (auto s = dyn_cast<AffineStoreOp>(u)) {
280
- if (s.value () == v)
280
+ if (s.getValue () == v)
281
281
return true ;
282
282
continue ;
283
283
}
@@ -659,7 +659,7 @@ struct SimplifySubIndexUsers : public OpRewritePattern<SubIndexOp> {
659
659
rewriter.replaceOpWithNewOp <memref::DeallocOp>(dealloc,
660
660
subindex.source ());
661
661
} else if (auto loadOp = dyn_cast<memref::LoadOp>(use.getOwner ())) {
662
- if (loadOp.memref () == subindex) {
662
+ if (loadOp.getMemref () == subindex) {
663
663
SmallVector<Value, 4 > indices = loadOp.indices ();
664
664
if (subindex.getType ().cast <MemRefType>().getShape ().size () ==
665
665
subindex.source ()
@@ -691,7 +691,7 @@ struct SimplifySubIndexUsers : public OpRewritePattern<SubIndexOp> {
691
691
changed = true ;
692
692
}
693
693
} else if (auto storeOp = dyn_cast<memref::StoreOp>(use.getOwner ())) {
694
- if (storeOp.memref () == subindex) {
694
+ if (storeOp.getMemref () == subindex) {
695
695
SmallVector<Value, 4 > indices = storeOp.indices ();
696
696
if (subindex.getType ().cast <MemRefType>().getShape ().size () ==
697
697
subindex.source ()
@@ -722,7 +722,7 @@ struct SimplifySubIndexUsers : public OpRewritePattern<SubIndexOp> {
722
722
changed = true ;
723
723
}
724
724
} else if (auto storeOp = dyn_cast<memref::AtomicRMWOp>(use.getOwner ())) {
725
- if (storeOp.memref () == subindex) {
725
+ if (storeOp.getMemref () == subindex) {
726
726
SmallVector<Value, 4 > indices = storeOp.indices ();
727
727
if (subindex.getType ().cast <MemRefType>().getShape ().size () ==
728
728
subindex.source ()
@@ -754,7 +754,7 @@ struct SimplifySubIndexUsers : public OpRewritePattern<SubIndexOp> {
754
754
changed = true ;
755
755
}
756
756
} else if (auto storeOp = dyn_cast<AffineStoreOp>(use.getOwner ())) {
757
- if (storeOp.memref () == subindex) {
757
+ if (storeOp.getMemref () == subindex) {
758
758
if (subindex.getType ().cast <MemRefType>().getShape ().size () + 1 ==
759
759
subindex.source ()
760
760
.getType ()
@@ -778,12 +778,12 @@ struct SimplifySubIndexUsers : public OpRewritePattern<SubIndexOp> {
778
778
.getShape ()
779
779
.size () == indices.size ());
780
780
rewriter.replaceOpWithNewOp <memref::StoreOp>(
781
- storeOp, storeOp.value (), subindex.source (), indices);
781
+ storeOp, storeOp.getValue (), subindex.source (), indices);
782
782
changed = true ;
783
783
}
784
784
}
785
785
} else if (auto storeOp = dyn_cast<AffineLoadOp>(use.getOwner ())) {
786
- if (storeOp.memref () == subindex) {
786
+ if (storeOp.getMemref () == subindex) {
787
787
if (subindex.getType ().cast <MemRefType>().getShape ().size () + 1 ==
788
788
subindex.source ()
789
789
.getType ()
@@ -858,7 +858,7 @@ struct SimplifySubViewUsers : public OpRewritePattern<memref::SubViewOp> {
858
858
rewriter.replaceOpWithNewOp <memref::DeallocOp>(dealloc,
859
859
subindex.source ());
860
860
} else if (auto loadOp = dyn_cast<memref::LoadOp>(use.getOwner ())) {
861
- if (loadOp.memref () == subindex) {
861
+ if (loadOp.getMemref () == subindex) {
862
862
SmallVector<Value, 4 > indices = loadOp.indices ();
863
863
if (subindex.getType ().cast <MemRefType>().getShape ().size () ==
864
864
subindex.source ()
@@ -893,7 +893,7 @@ struct SimplifySubViewUsers : public OpRewritePattern<memref::SubViewOp> {
893
893
changed = true ;
894
894
}
895
895
} else if (auto storeOp = dyn_cast<memref::StoreOp>(use.getOwner ())) {
896
- if (storeOp.memref () == subindex) {
896
+ if (storeOp.getMemref () == subindex) {
897
897
SmallVector<Value, 4 > indices = storeOp.indices ();
898
898
if (subindex.getType ().cast <MemRefType>().getShape ().size () ==
899
899
subindex.source ()
@@ -940,7 +940,7 @@ struct SimplifySubViewUsers : public OpRewritePattern<memref::SubViewOp> {
940
940
changed = true ;
941
941
}
942
942
} else if (auto storeOp = dyn_cast<AffineStoreOp>(use.getOwner ())) {
943
- if (storeOp.memref () == subindex) {
943
+ if (storeOp.getMemref () == subindex) {
944
944
if (subindex.getType ().cast <MemRefType>().getShape ().size () + 1 ==
945
945
subindex.source ()
946
946
.getType ()
@@ -964,12 +964,12 @@ struct SimplifySubViewUsers : public OpRewritePattern<memref::SubViewOp> {
964
964
.getShape ()
965
965
.size () == indices.size ());
966
966
rewriter.replaceOpWithNewOp <memref::StoreOp>(
967
- storeOp, storeOp.value (), subindex.source (), indices);
967
+ storeOp, storeOp.getValue (), subindex.source (), indices);
968
968
changed = true ;
969
969
}
970
970
}
971
971
} else if (auto storeOp = dyn_cast<AffineLoadOp>(use.getOwner ())) {
972
- if (storeOp.memref () == subindex) {
972
+ if (storeOp.getMemref () == subindex) {
973
973
if (subindex.getType ().cast <MemRefType>().getShape ().size () + 1 ==
974
974
subindex.source ()
975
975
.getType ()
@@ -1090,18 +1090,18 @@ template <typename T> struct LoadSelect : public OpRewritePattern<T> {
1090
1090
};
1091
1091
1092
1092
template <> Value LoadSelect<memref::LoadOp>::ptr(memref::LoadOp op) {
1093
- return op.memref ();
1093
+ return op.getMemref ();
1094
1094
}
1095
1095
template <>
1096
1096
MutableOperandRange LoadSelect<memref::LoadOp>::ptrMutable(memref::LoadOp op) {
1097
- return op.memrefMutable ();
1097
+ return op.getMemrefMutable ();
1098
1098
}
1099
1099
template <> Value LoadSelect<AffineLoadOp>::ptr(AffineLoadOp op) {
1100
- return op.memref ();
1100
+ return op.getMemref ();
1101
1101
}
1102
1102
template <>
1103
1103
MutableOperandRange LoadSelect<AffineLoadOp>::ptrMutable(AffineLoadOp op) {
1104
- return op.memrefMutable ();
1104
+ return op.getMemrefMutable ();
1105
1105
}
1106
1106
template <> Value LoadSelect<LLVM::LoadOp>::ptr(LLVM::LoadOp op) {
1107
1107
return op.getAddr ();
@@ -1469,7 +1469,7 @@ class MetaPointer2Memref final : public OpRewritePattern<Op> {
1469
1469
1470
1470
LogicalResult matchAndRewrite (Op op,
1471
1471
PatternRewriter &rewriter) const override {
1472
- Value opPtr = op.memref ();
1472
+ Value opPtr = op.getMemref ();
1473
1473
Pointer2MemrefOp src = opPtr.getDefiningOp <polygeist::Pointer2MemrefOp>();
1474
1474
if (!src)
1475
1475
return failure ();
@@ -1493,7 +1493,7 @@ class MetaPointer2Memref final : public OpRewritePattern<Op> {
1493
1493
}
1494
1494
}
1495
1495
if (eq) {
1496
- op.memrefMutable ().assign (before.source ());
1496
+ op.getMemrefMutable ().assign (before.source ());
1497
1497
return success ();
1498
1498
}
1499
1499
}
@@ -1592,7 +1592,7 @@ Value MetaPointer2Memref<AffineStoreOp>::computeIndex(
1592
1592
template <>
1593
1593
void MetaPointer2Memref<AffineStoreOp>::rewrite(
1594
1594
AffineStoreOp op, Value ptr, PatternRewriter &rewriter) const {
1595
- rewriter.replaceOpWithNewOp <LLVM::StoreOp>(op, op.value (), ptr);
1595
+ rewriter.replaceOpWithNewOp <LLVM::StoreOp>(op, op.getValue (), ptr);
1596
1596
}
1597
1597
1598
1598
// Below is actually wrong as and(40, 1) != 0 !=== and(40 != 0, 1 != 0) =
@@ -1624,7 +1624,7 @@ class CmpAnd final : public OpRewritePattern<arith::CmpIOp> {
1624
1624
};
1625
1625
*/
1626
1626
1627
- #include " mlir/Dialect/SCF/SCF.h"
1627
+ #include " mlir/Dialect/SCF/IR/ SCF.h"
1628
1628
struct IfAndLazy : public OpRewritePattern <scf::IfOp> {
1629
1629
using OpRewritePattern<scf::IfOp>::OpRewritePattern;
1630
1630
@@ -1827,7 +1827,7 @@ struct MoveIntoIfs : public OpRewritePattern<scf::IfOp> {
1827
1827
storeOp.getMapOperands ());
1828
1828
indices.push_back (apply->getResult (0 ));
1829
1829
}
1830
- rewriter.replaceOpWithNewOp <memref::LoadOp>(storeOp, storeOp.memref (),
1830
+ rewriter.replaceOpWithNewOp <memref::LoadOp>(storeOp, storeOp.getMemref (),
1831
1831
indices);
1832
1832
} else if (auto storeOp = dyn_cast<AffineStoreOp>(use.getOwner ())) {
1833
1833
std::vector<Value> indices;
@@ -1838,8 +1838,8 @@ struct MoveIntoIfs : public OpRewritePattern<scf::IfOp> {
1838
1838
storeOp.getMapOperands ());
1839
1839
indices.push_back (apply->getResult (0 ));
1840
1840
}
1841
- rewriter.replaceOpWithNewOp <memref::StoreOp>(storeOp, storeOp.value (),
1842
- storeOp.memref (), indices);
1841
+ rewriter.replaceOpWithNewOp <memref::StoreOp>(storeOp, storeOp.getValue (),
1842
+ storeOp.getMemref (), indices);
1843
1843
}
1844
1844
}
1845
1845
rewriter.finalizeRootUpdate (prevOp);
0 commit comments