@@ -1062,13 +1062,16 @@ class LowerMatrixIntrinsics {
1062
1062
Value *Op1;
1063
1063
Value *Op2;
1064
1064
if (auto *BinOp = dyn_cast<BinaryOperator>(Inst))
1065
- Changed |= VisitBinaryOperator (BinOp);
1066
- if (auto *UnOp = dyn_cast<UnaryOperator>(Inst))
1067
- Changed |= VisitUnaryOperator (UnOp);
1068
- if (match (Inst, m_Load (m_Value (Op1))))
1069
- Changed |= VisitLoad (cast<LoadInst>(Inst), Op1, Builder);
1065
+ VisitBinaryOperator (BinOp);
1066
+ else if (auto *UnOp = dyn_cast<UnaryOperator>(Inst))
1067
+ VisitUnaryOperator (UnOp);
1068
+ else if (match (Inst, m_Load (m_Value (Op1))))
1069
+ VisitLoad (cast<LoadInst>(Inst), Op1, Builder);
1070
1070
else if (match (Inst, m_Store (m_Value (Op1), m_Value (Op2))))
1071
- Changed |= VisitStore (cast<StoreInst>(Inst), Op1, Op2, Builder);
1071
+ VisitStore (cast<StoreInst>(Inst), Op1, Op2, Builder);
1072
+ else
1073
+ continue ;
1074
+ Changed = true ;
1072
1075
}
1073
1076
1074
1077
if (ORE) {
@@ -2105,29 +2108,27 @@ class LowerMatrixIntrinsics {
2105
2108
}
2106
2109
2107
2110
// / Lower load instructions, if shape information is available.
2108
- bool VisitLoad (LoadInst *Inst, Value *Ptr, IRBuilder<> &Builder) {
2111
+ void VisitLoad (LoadInst *Inst, Value *Ptr, IRBuilder<> &Builder) {
2109
2112
auto I = ShapeMap.find (Inst);
2110
2113
assert (I != ShapeMap.end () &&
2111
2114
" must only visit instructions with shape info" );
2112
2115
LowerLoad (Inst, Ptr, Inst->getAlign (),
2113
2116
Builder.getInt64 (I->second .getStride ()), Inst->isVolatile (),
2114
2117
I->second );
2115
- return true ;
2116
2118
}
2117
2119
2118
- bool VisitStore (StoreInst *Inst, Value *StoredVal, Value *Ptr,
2120
+ void VisitStore (StoreInst *Inst, Value *StoredVal, Value *Ptr,
2119
2121
IRBuilder<> &Builder) {
2120
2122
auto I = ShapeMap.find (Inst);
2121
2123
assert (I != ShapeMap.end () &&
2122
2124
" must only visit instructions with shape info" );
2123
2125
LowerStore (Inst, StoredVal, Ptr, Inst->getAlign (),
2124
2126
Builder.getInt64 (I->second .getStride ()), Inst->isVolatile (),
2125
2127
I->second );
2126
- return true ;
2127
2128
}
2128
2129
2129
2130
// / Lower binary operators, if shape information is available.
2130
- bool VisitBinaryOperator (BinaryOperator *Inst) {
2131
+ void VisitBinaryOperator (BinaryOperator *Inst) {
2131
2132
auto I = ShapeMap.find (Inst);
2132
2133
assert (I != ShapeMap.end () &&
2133
2134
" must only visit instructions with shape info" );
@@ -2155,11 +2156,10 @@ class LowerMatrixIntrinsics {
2155
2156
Result.addNumComputeOps (getNumOps (Result.getVectorTy ()) *
2156
2157
Result.getNumVectors ()),
2157
2158
Builder);
2158
- return true ;
2159
2159
}
2160
2160
2161
2161
// / Lower unary operators, if shape information is available.
2162
- bool VisitUnaryOperator (UnaryOperator *Inst) {
2162
+ void VisitUnaryOperator (UnaryOperator *Inst) {
2163
2163
auto I = ShapeMap.find (Inst);
2164
2164
assert (I != ShapeMap.end () &&
2165
2165
" must only visit instructions with shape info" );
@@ -2191,7 +2191,6 @@ class LowerMatrixIntrinsics {
2191
2191
Result.addNumComputeOps (getNumOps (Result.getVectorTy ()) *
2192
2192
Result.getNumVectors ()),
2193
2193
Builder);
2194
- return true ;
2195
2194
}
2196
2195
2197
2196
// / Helper to linearize a matrix expression tree into a string. Currently
0 commit comments