@@ -2107,9 +2107,8 @@ class LowerMatrixIntrinsics {
2107
2107
// / Lower load instructions, if shape information is available.
2108
2108
bool VisitLoad (LoadInst *Inst, Value *Ptr, IRBuilder<> &Builder) {
2109
2109
auto I = ShapeMap.find (Inst);
2110
- if (I == ShapeMap.end ())
2111
- return false ;
2112
-
2110
+ assert (I != ShapeMap.end () &&
2111
+ " must only visit instructions with shape info" );
2113
2112
LowerLoad (Inst, Ptr, Inst->getAlign (),
2114
2113
Builder.getInt64 (I->second .getStride ()), Inst->isVolatile (),
2115
2114
I->second );
@@ -2119,9 +2118,8 @@ class LowerMatrixIntrinsics {
2119
2118
bool VisitStore (StoreInst *Inst, Value *StoredVal, Value *Ptr,
2120
2119
IRBuilder<> &Builder) {
2121
2120
auto I = ShapeMap.find (StoredVal);
2122
- if (I == ShapeMap.end ())
2123
- return false ;
2124
-
2121
+ assert (I != ShapeMap.end () &&
2122
+ " must only visit instructions with shape info" );
2125
2123
LowerStore (Inst, StoredVal, Ptr, Inst->getAlign (),
2126
2124
Builder.getInt64 (I->second .getStride ()), Inst->isVolatile (),
2127
2125
I->second );
@@ -2131,8 +2129,8 @@ class LowerMatrixIntrinsics {
2131
2129
// / Lower binary operators, if shape information is available.
2132
2130
bool VisitBinaryOperator (BinaryOperator *Inst) {
2133
2131
auto I = ShapeMap.find (Inst);
2134
- if (I == ShapeMap.end ())
2135
- return false ;
2132
+ assert (I != ShapeMap.end () &&
2133
+ " must only visit instructions with shape info " ) ;
2136
2134
2137
2135
Value *Lhs = Inst->getOperand (0 );
2138
2136
Value *Rhs = Inst->getOperand (1 );
@@ -2163,8 +2161,8 @@ class LowerMatrixIntrinsics {
2163
2161
// / Lower unary operators, if shape information is available.
2164
2162
bool VisitUnaryOperator (UnaryOperator *Inst) {
2165
2163
auto I = ShapeMap.find (Inst);
2166
- if (I == ShapeMap.end ())
2167
- return false ;
2164
+ assert (I != ShapeMap.end () &&
2165
+ " must only visit instructions with shape info " ) ;
2168
2166
2169
2167
Value *Op = Inst->getOperand (0 );
2170
2168
0 commit comments