Skip to content

[Matrix] Assert that there's shapeinfo in Visit* (NFC). #142416

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 2, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2107,9 +2107,8 @@ class LowerMatrixIntrinsics {
/// Lower load instructions, if shape information is available.
bool VisitLoad(LoadInst *Inst, Value *Ptr, IRBuilder<> &Builder) {
auto I = ShapeMap.find(Inst);
if (I == ShapeMap.end())
return false;

assert(I != ShapeMap.end() &&
"must only visit instructions with shape info");
LowerLoad(Inst, Ptr, Inst->getAlign(),
Builder.getInt64(I->second.getStride()), Inst->isVolatile(),
I->second);
Expand All @@ -2119,9 +2118,8 @@ class LowerMatrixIntrinsics {
bool VisitStore(StoreInst *Inst, Value *StoredVal, Value *Ptr,
IRBuilder<> &Builder) {
auto I = ShapeMap.find(StoredVal);
if (I == ShapeMap.end())
return false;

assert(I != ShapeMap.end() &&
"must only visit instructions with shape info");
LowerStore(Inst, StoredVal, Ptr, Inst->getAlign(),
Builder.getInt64(I->second.getStride()), Inst->isVolatile(),
I->second);
Expand All @@ -2131,8 +2129,8 @@ class LowerMatrixIntrinsics {
/// Lower binary operators, if shape information is available.
bool VisitBinaryOperator(BinaryOperator *Inst) {
auto I = ShapeMap.find(Inst);
if (I == ShapeMap.end())
return false;
assert(I != ShapeMap.end() &&
"must only visit instructions with shape info");

Value *Lhs = Inst->getOperand(0);
Value *Rhs = Inst->getOperand(1);
Expand Down Expand Up @@ -2163,8 +2161,8 @@ class LowerMatrixIntrinsics {
/// Lower unary operators, if shape information is available.
bool VisitUnaryOperator(UnaryOperator *Inst) {
auto I = ShapeMap.find(Inst);
if (I == ShapeMap.end())
return false;
assert(I != ShapeMap.end() &&
"must only visit instructions with shape info");

Value *Op = Inst->getOperand(0);

Expand Down
Loading