Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions mlir/lib/Transforms/Utils/DialectConversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2527,6 +2527,7 @@ LogicalResult OperationConverter::legalizeConvertedOpResultTypes(
opReplacement->getConverter());
rewriterImpl.mapping.map(result, castValue);
inverseMapping[castValue].push_back(result);
llvm::erase(inverseMapping[newValue], result);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably a very short list. Open to changing it to a Set though.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, list is usually very short, so a vector should be fine.

}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: mlir-opt -test-target-materialization-with-no-uses %s | FileCheck %s
// RUN: mlir-opt -test-target-materialization-with-no-uses -split-input-file %s | FileCheck %s

// The conversion is set up as follows:
// - type_changer ops are illegal;
Expand All @@ -25,3 +25,12 @@ func.func @foo() {
"test.type_consumer"(%2) : (i64) -> ()
return
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add // ----- here and -split-input-file in the // RUN: line?

// -----

// CHECK-LABEL: @direct_forward
func.func @direct_forward(%arg0 : i16) -> i16 {
// CHECK-NEXT: return
%0 = "test.type_changer"(%arg0) : (i16) -> i16
return %0 : i16
}