Skip to content

[mlir][Transforms] Dialect Conversion: No target mat. for 1:N replacement #117513

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

Conversation

matthias-springer
Copy link
Member

@matthias-springer matthias-springer commented Nov 25, 2024

During a 1:N replacement (applySignatureConversion or replaceOpWithMultiple), the dialect conversion driver used to insert two materializations:

  • Argument materialization: convert N replacement values to 1 SSA value of the original type S.
  • Target materialization: convert original type to legalized type T.

The target materialization is unnecessary. Subsequent patterns receive the replacement values via their adaptors. These patterns have their own type converter. When they see a replacement value of type S, they will automatically insert a target materialization to type T. There is no reason to do this already during the 1:N replacement. (The functionality used to be duplicated in remapValues and insertNTo1Materialization.)

Special case: If a subsequent pattern does not have a type converter, it does not insert any target materializations. That's because the absence of a type converter indicates that the pattern does not care about type legality. Therefore, it is correct to pass an SSA value of type S (or any other type) to the pattern.

Note: Most patterns in TestPatterns.cpp run without a type converter. To make sure that the tests still behave the same, some of these patterns now have a type converter.

This commit is in preparation of adding 1:N support to the conversion value mapping. Before making any further changes to the mapping infrastructure, I'd like to make sure that the code base around it (that uses the mapping) is robust.

@llvmbot
Copy link
Member

llvmbot commented Nov 25, 2024

@llvm/pr-subscribers-mlir-llvm

@llvm/pr-subscribers-mlir

Author: Matthias Springer (matthias-springer)

Changes

During a 1:N replacement (block signature conversion or replaceOpWithMultiple), the dialect conversion driver used to insert two materializations:

  • Argument materialization: convert N replacement values to 1 SSA value of the original type S.
  • Target materialization: convert original type to legalized type T.

The target materialization is unnecessary. Subsequent patterns receive the replacement values via their adaptors. These patterns have their own type converter. When they see a replacement value of type S, they will automatically insert a target materialization to type T. There is no reason to do this already during the 1:N replacement.

Special case: If a subsequent pattern does not have a type converter, it does not insert any target materializations. That's because the absence of a type converter indicates the pattern does not care about type legality. Therefore, it is correct to pass an SSA value of type S (or any other type) to the pattern.

This commit is in preparation of adding 1:N support to the conversion value mapping. Before making any further changes to the mapping infrastructure, I'd like to make sure that the code base around it (that uses the mapping) is robust.


Full diff: https://github.com/llvm/llvm-project/pull/117513.diff

3 Files Affected:

  • (modified) mlir/lib/Transforms/Utils/DialectConversion.cpp (+1-23)
  • (modified) mlir/test/Transforms/test-legalizer.mlir (+4-4)
  • (modified) mlir/test/lib/Dialect/Test/TestPatterns.cpp (+23-22)
diff --git a/mlir/lib/Transforms/Utils/DialectConversion.cpp b/mlir/lib/Transforms/Utils/DialectConversion.cpp
index 710c976281dc3d..c2a70bfa54b1b0 100644
--- a/mlir/lib/Transforms/Utils/DialectConversion.cpp
+++ b/mlir/lib/Transforms/Utils/DialectConversion.cpp
@@ -830,8 +830,7 @@ struct ConversionPatternRewriterImpl : public RewriterBase::Listener {
   /// function will be deleted when full 1:N support has been added.
   ///
   /// This function inserts an argument materialization back to the original
-  /// type, followed by a target materialization to the legalized type (if
-  /// applicable).
+  /// type.
   void insertNTo1Materialization(OpBuilder::InsertPoint ip, Location loc,
                                  ValueRange replacements, Value originalValue,
                                  const TypeConverter *converter);
@@ -1372,27 +1371,6 @@ void ConversionPatternRewriterImpl::insertNTo1Materialization(
                                      /*inputs=*/replacements, originalType,
                                      /*originalType=*/Type(), converter);
   mapping.map(originalValue, argMat);
-
-  // Insert target materialization to the legalized type.
-  Type legalOutputType;
-  if (converter) {
-    legalOutputType = converter->convertType(originalType);
-  } else if (replacements.size() == 1) {
-    // When there is no type converter, assume that the replacement value
-    // types are legal. This is reasonable to assume because they were
-    // specified by the user.
-    // FIXME: This won't work for 1->N conversions because multiple output
-    // types are not supported in parts of the dialect conversion. In such a
-    // case, we currently use the original value type.
-    legalOutputType = replacements[0].getType();
-  }
-  if (legalOutputType && legalOutputType != originalType) {
-    Value targetMat = buildUnresolvedMaterialization(
-        MaterializationKind::Target, computeInsertPoint(argMat), loc,
-        /*inputs=*/argMat, /*outputType=*/legalOutputType,
-        /*originalType=*/originalType, converter);
-    mapping.map(argMat, targetMat);
-  }
 }
 
 Value ConversionPatternRewriterImpl::findOrBuildReplacementValue(
diff --git a/mlir/test/Transforms/test-legalizer.mlir b/mlir/test/Transforms/test-legalizer.mlir
index e05f444afa68f0..624add08846a28 100644
--- a/mlir/test/Transforms/test-legalizer.mlir
+++ b/mlir/test/Transforms/test-legalizer.mlir
@@ -124,10 +124,10 @@ func.func @no_remap_nested() {
   // CHECK-NEXT: "foo.region"
   // expected-remark@+1 {{op 'foo.region' is not legalizable}}
   "foo.region"() ({
-    // CHECK-NEXT: ^bb0(%{{.*}}: i64, %{{.*}}: i16, %{{.*}}: i64):
-    ^bb0(%i0: i64, %unused: i16, %i1: i64):
-      // CHECK-NEXT: "test.valid"{{.*}} : (i64, i64)
-      "test.invalid"(%i0, %i1) : (i64, i64) -> ()
+    // CHECK-NEXT: ^bb0(%{{.*}}: f64, %{{.*}}: i16, %{{.*}}: f64):
+    ^bb0(%i0: f64, %unused: i16, %i1: f64):
+      // CHECK-NEXT: "test.valid"{{.*}} : (f64, f64)
+      "test.invalid"(%i0, %i1) : (f64, f64) -> ()
   }) : () -> ()
   // expected-remark@+1 {{op 'func.return' is not legalizable}}
   return
diff --git a/mlir/test/lib/Dialect/Test/TestPatterns.cpp b/mlir/test/lib/Dialect/Test/TestPatterns.cpp
index bbd55938718fe7..e931b394c86210 100644
--- a/mlir/test/lib/Dialect/Test/TestPatterns.cpp
+++ b/mlir/test/lib/Dialect/Test/TestPatterns.cpp
@@ -979,8 +979,8 @@ struct TestDropOpSignatureConversion : public ConversionPattern {
 };
 /// This pattern simply updates the operands of the given operation.
 struct TestPassthroughInvalidOp : public ConversionPattern {
-  TestPassthroughInvalidOp(MLIRContext *ctx)
-      : ConversionPattern("test.invalid", 1, ctx) {}
+  TestPassthroughInvalidOp(MLIRContext *ctx, const TypeConverter &converter)
+      : ConversionPattern(converter, "test.invalid", 1, ctx) {}
   LogicalResult
   matchAndRewrite(Operation *op, ArrayRef<Value> operands,
                   ConversionPatternRewriter &rewriter) const final {
@@ -1254,18 +1254,18 @@ struct TestLegalizePatternDriver
     TestTypeConverter converter;
     mlir::RewritePatternSet patterns(&getContext());
     populateWithGenerated(patterns);
-    patterns.add<
-        TestRegionRewriteBlockMovement, TestDetachedSignatureConversion,
-        TestRegionRewriteUndo, TestCreateBlock, TestCreateIllegalBlock,
-        TestUndoBlockArgReplace, TestUndoBlockErase, TestPassthroughInvalidOp,
-        TestSplitReturnType, TestChangeProducerTypeI32ToF32,
-        TestChangeProducerTypeF32ToF64, TestChangeProducerTypeF32ToInvalid,
-        TestUpdateConsumerType, TestNonRootReplacement,
-        TestBoundedRecursiveRewrite, TestNestedOpCreationUndoRewrite,
-        TestReplaceEraseOp, TestCreateUnregisteredOp, TestUndoMoveOpBefore,
-        TestUndoPropertiesModification, TestEraseOp>(&getContext());
-    patterns.add<TestDropOpSignatureConversion, TestDropAndReplaceInvalidOp>(
-        &getContext(), converter);
+    patterns
+        .add<TestRegionRewriteBlockMovement, TestDetachedSignatureConversion,
+             TestRegionRewriteUndo, TestCreateBlock, TestCreateIllegalBlock,
+             TestUndoBlockArgReplace, TestUndoBlockErase, TestSplitReturnType,
+             TestChangeProducerTypeI32ToF32, TestChangeProducerTypeF32ToF64,
+             TestChangeProducerTypeF32ToInvalid, TestUpdateConsumerType,
+             TestNonRootReplacement, TestBoundedRecursiveRewrite,
+             TestNestedOpCreationUndoRewrite, TestReplaceEraseOp,
+             TestCreateUnregisteredOp, TestUndoMoveOpBefore,
+             TestUndoPropertiesModification, TestEraseOp>(&getContext());
+    patterns.add<TestDropOpSignatureConversion, TestDropAndReplaceInvalidOp,
+                 TestPassthroughInvalidOp>(&getContext(), converter);
     mlir::populateAnyFunctionOpInterfaceTypeConversionPattern(patterns,
                                                               converter);
     mlir::populateCallOpTypeConversionPattern(patterns, converter);
@@ -1697,8 +1697,9 @@ struct TestTypeConversionAnotherProducer
 };
 
 struct TestReplaceWithLegalOp : public ConversionPattern {
-  TestReplaceWithLegalOp(MLIRContext *ctx)
-      : ConversionPattern("test.replace_with_legal_op", /*benefit=*/1, ctx) {}
+  TestReplaceWithLegalOp(const TypeConverter &converter, MLIRContext *ctx)
+      : ConversionPattern(converter, "test.replace_with_legal_op",
+                          /*benefit=*/1, ctx) {}
   LogicalResult
   matchAndRewrite(Operation *op, ArrayRef<Value> operands,
                   ConversionPatternRewriter &rewriter) const final {
@@ -1820,12 +1821,12 @@ struct TestTypeConversionDriver
 
     // Initialize the set of rewrite patterns.
     RewritePatternSet patterns(&getContext());
-    patterns.add<TestTypeConsumerForward, TestTypeConversionProducer,
-                 TestSignatureConversionUndo,
-                 TestTestSignatureConversionNoConverter>(converter,
-                                                         &getContext());
-    patterns.add<TestTypeConversionAnotherProducer, TestReplaceWithLegalOp>(
-        &getContext());
+    patterns
+        .add<TestTypeConsumerForward, TestTypeConversionProducer,
+             TestSignatureConversionUndo,
+             TestTestSignatureConversionNoConverter, TestReplaceWithLegalOp>(
+            converter, &getContext());
+    patterns.add<TestTypeConversionAnotherProducer>(&getContext());
     mlir::populateAnyFunctionOpInterfaceTypeConversionPattern(patterns,
                                                               converter);
 

@llvmbot
Copy link
Member

llvmbot commented Nov 25, 2024

@llvm/pr-subscribers-mlir-core

Author: Matthias Springer (matthias-springer)

Changes

During a 1:N replacement (block signature conversion or replaceOpWithMultiple), the dialect conversion driver used to insert two materializations:

  • Argument materialization: convert N replacement values to 1 SSA value of the original type S.
  • Target materialization: convert original type to legalized type T.

The target materialization is unnecessary. Subsequent patterns receive the replacement values via their adaptors. These patterns have their own type converter. When they see a replacement value of type S, they will automatically insert a target materialization to type T. There is no reason to do this already during the 1:N replacement.

Special case: If a subsequent pattern does not have a type converter, it does not insert any target materializations. That's because the absence of a type converter indicates the pattern does not care about type legality. Therefore, it is correct to pass an SSA value of type S (or any other type) to the pattern.

This commit is in preparation of adding 1:N support to the conversion value mapping. Before making any further changes to the mapping infrastructure, I'd like to make sure that the code base around it (that uses the mapping) is robust.


Full diff: https://github.com/llvm/llvm-project/pull/117513.diff

3 Files Affected:

  • (modified) mlir/lib/Transforms/Utils/DialectConversion.cpp (+1-23)
  • (modified) mlir/test/Transforms/test-legalizer.mlir (+4-4)
  • (modified) mlir/test/lib/Dialect/Test/TestPatterns.cpp (+23-22)
diff --git a/mlir/lib/Transforms/Utils/DialectConversion.cpp b/mlir/lib/Transforms/Utils/DialectConversion.cpp
index 710c976281dc3d..c2a70bfa54b1b0 100644
--- a/mlir/lib/Transforms/Utils/DialectConversion.cpp
+++ b/mlir/lib/Transforms/Utils/DialectConversion.cpp
@@ -830,8 +830,7 @@ struct ConversionPatternRewriterImpl : public RewriterBase::Listener {
   /// function will be deleted when full 1:N support has been added.
   ///
   /// This function inserts an argument materialization back to the original
-  /// type, followed by a target materialization to the legalized type (if
-  /// applicable).
+  /// type.
   void insertNTo1Materialization(OpBuilder::InsertPoint ip, Location loc,
                                  ValueRange replacements, Value originalValue,
                                  const TypeConverter *converter);
@@ -1372,27 +1371,6 @@ void ConversionPatternRewriterImpl::insertNTo1Materialization(
                                      /*inputs=*/replacements, originalType,
                                      /*originalType=*/Type(), converter);
   mapping.map(originalValue, argMat);
-
-  // Insert target materialization to the legalized type.
-  Type legalOutputType;
-  if (converter) {
-    legalOutputType = converter->convertType(originalType);
-  } else if (replacements.size() == 1) {
-    // When there is no type converter, assume that the replacement value
-    // types are legal. This is reasonable to assume because they were
-    // specified by the user.
-    // FIXME: This won't work for 1->N conversions because multiple output
-    // types are not supported in parts of the dialect conversion. In such a
-    // case, we currently use the original value type.
-    legalOutputType = replacements[0].getType();
-  }
-  if (legalOutputType && legalOutputType != originalType) {
-    Value targetMat = buildUnresolvedMaterialization(
-        MaterializationKind::Target, computeInsertPoint(argMat), loc,
-        /*inputs=*/argMat, /*outputType=*/legalOutputType,
-        /*originalType=*/originalType, converter);
-    mapping.map(argMat, targetMat);
-  }
 }
 
 Value ConversionPatternRewriterImpl::findOrBuildReplacementValue(
diff --git a/mlir/test/Transforms/test-legalizer.mlir b/mlir/test/Transforms/test-legalizer.mlir
index e05f444afa68f0..624add08846a28 100644
--- a/mlir/test/Transforms/test-legalizer.mlir
+++ b/mlir/test/Transforms/test-legalizer.mlir
@@ -124,10 +124,10 @@ func.func @no_remap_nested() {
   // CHECK-NEXT: "foo.region"
   // expected-remark@+1 {{op 'foo.region' is not legalizable}}
   "foo.region"() ({
-    // CHECK-NEXT: ^bb0(%{{.*}}: i64, %{{.*}}: i16, %{{.*}}: i64):
-    ^bb0(%i0: i64, %unused: i16, %i1: i64):
-      // CHECK-NEXT: "test.valid"{{.*}} : (i64, i64)
-      "test.invalid"(%i0, %i1) : (i64, i64) -> ()
+    // CHECK-NEXT: ^bb0(%{{.*}}: f64, %{{.*}}: i16, %{{.*}}: f64):
+    ^bb0(%i0: f64, %unused: i16, %i1: f64):
+      // CHECK-NEXT: "test.valid"{{.*}} : (f64, f64)
+      "test.invalid"(%i0, %i1) : (f64, f64) -> ()
   }) : () -> ()
   // expected-remark@+1 {{op 'func.return' is not legalizable}}
   return
diff --git a/mlir/test/lib/Dialect/Test/TestPatterns.cpp b/mlir/test/lib/Dialect/Test/TestPatterns.cpp
index bbd55938718fe7..e931b394c86210 100644
--- a/mlir/test/lib/Dialect/Test/TestPatterns.cpp
+++ b/mlir/test/lib/Dialect/Test/TestPatterns.cpp
@@ -979,8 +979,8 @@ struct TestDropOpSignatureConversion : public ConversionPattern {
 };
 /// This pattern simply updates the operands of the given operation.
 struct TestPassthroughInvalidOp : public ConversionPattern {
-  TestPassthroughInvalidOp(MLIRContext *ctx)
-      : ConversionPattern("test.invalid", 1, ctx) {}
+  TestPassthroughInvalidOp(MLIRContext *ctx, const TypeConverter &converter)
+      : ConversionPattern(converter, "test.invalid", 1, ctx) {}
   LogicalResult
   matchAndRewrite(Operation *op, ArrayRef<Value> operands,
                   ConversionPatternRewriter &rewriter) const final {
@@ -1254,18 +1254,18 @@ struct TestLegalizePatternDriver
     TestTypeConverter converter;
     mlir::RewritePatternSet patterns(&getContext());
     populateWithGenerated(patterns);
-    patterns.add<
-        TestRegionRewriteBlockMovement, TestDetachedSignatureConversion,
-        TestRegionRewriteUndo, TestCreateBlock, TestCreateIllegalBlock,
-        TestUndoBlockArgReplace, TestUndoBlockErase, TestPassthroughInvalidOp,
-        TestSplitReturnType, TestChangeProducerTypeI32ToF32,
-        TestChangeProducerTypeF32ToF64, TestChangeProducerTypeF32ToInvalid,
-        TestUpdateConsumerType, TestNonRootReplacement,
-        TestBoundedRecursiveRewrite, TestNestedOpCreationUndoRewrite,
-        TestReplaceEraseOp, TestCreateUnregisteredOp, TestUndoMoveOpBefore,
-        TestUndoPropertiesModification, TestEraseOp>(&getContext());
-    patterns.add<TestDropOpSignatureConversion, TestDropAndReplaceInvalidOp>(
-        &getContext(), converter);
+    patterns
+        .add<TestRegionRewriteBlockMovement, TestDetachedSignatureConversion,
+             TestRegionRewriteUndo, TestCreateBlock, TestCreateIllegalBlock,
+             TestUndoBlockArgReplace, TestUndoBlockErase, TestSplitReturnType,
+             TestChangeProducerTypeI32ToF32, TestChangeProducerTypeF32ToF64,
+             TestChangeProducerTypeF32ToInvalid, TestUpdateConsumerType,
+             TestNonRootReplacement, TestBoundedRecursiveRewrite,
+             TestNestedOpCreationUndoRewrite, TestReplaceEraseOp,
+             TestCreateUnregisteredOp, TestUndoMoveOpBefore,
+             TestUndoPropertiesModification, TestEraseOp>(&getContext());
+    patterns.add<TestDropOpSignatureConversion, TestDropAndReplaceInvalidOp,
+                 TestPassthroughInvalidOp>(&getContext(), converter);
     mlir::populateAnyFunctionOpInterfaceTypeConversionPattern(patterns,
                                                               converter);
     mlir::populateCallOpTypeConversionPattern(patterns, converter);
@@ -1697,8 +1697,9 @@ struct TestTypeConversionAnotherProducer
 };
 
 struct TestReplaceWithLegalOp : public ConversionPattern {
-  TestReplaceWithLegalOp(MLIRContext *ctx)
-      : ConversionPattern("test.replace_with_legal_op", /*benefit=*/1, ctx) {}
+  TestReplaceWithLegalOp(const TypeConverter &converter, MLIRContext *ctx)
+      : ConversionPattern(converter, "test.replace_with_legal_op",
+                          /*benefit=*/1, ctx) {}
   LogicalResult
   matchAndRewrite(Operation *op, ArrayRef<Value> operands,
                   ConversionPatternRewriter &rewriter) const final {
@@ -1820,12 +1821,12 @@ struct TestTypeConversionDriver
 
     // Initialize the set of rewrite patterns.
     RewritePatternSet patterns(&getContext());
-    patterns.add<TestTypeConsumerForward, TestTypeConversionProducer,
-                 TestSignatureConversionUndo,
-                 TestTestSignatureConversionNoConverter>(converter,
-                                                         &getContext());
-    patterns.add<TestTypeConversionAnotherProducer, TestReplaceWithLegalOp>(
-        &getContext());
+    patterns
+        .add<TestTypeConsumerForward, TestTypeConversionProducer,
+             TestSignatureConversionUndo,
+             TestTestSignatureConversionNoConverter, TestReplaceWithLegalOp>(
+            converter, &getContext());
+    patterns.add<TestTypeConversionAnotherProducer>(&getContext());
     mlir::populateAnyFunctionOpInterfaceTypeConversionPattern(patterns,
                                                               converter);
 

Copy link

github-actions bot commented Nov 25, 2024

✅ With the latest revision this PR passed the C/C++ code formatter.

@matthias-springer matthias-springer force-pushed the users/matthias-springer/do_not_build_target_mat branch from ec18101 to d2d3eb9 Compare November 25, 2024 09:36
@matthias-springer matthias-springer marked this pull request as ready for review November 25, 2024 09:44
@matthias-springer matthias-springer force-pushed the users/matthias-springer/do_not_build_target_mat branch 2 times, most recently from 7330a8b to 4369986 Compare November 29, 2024 06:51
@matthias-springer matthias-springer marked this pull request as draft November 30, 2024 08:08
@matthias-springer matthias-springer force-pushed the users/matthias-springer/do_not_build_target_mat branch from 4369986 to 2ec040d Compare December 1, 2024 20:43
@matthias-springer matthias-springer force-pushed the users/matthias-springer/do_not_build_target_mat branch 2 times, most recently from f9e8758 to ddc9294 Compare December 15, 2024 19:29
@matthias-springer matthias-springer changed the base branch from main to users/matthias-springer/vec_to_llvm_conv December 15, 2024 19:29
@matthias-springer matthias-springer force-pushed the users/matthias-springer/vec_to_llvm_conv branch from e5926b6 to 03fcf33 Compare December 17, 2024 10:28
Base automatically changed from users/matthias-springer/vec_to_llvm_conv to main December 17, 2024 10:37
@matthias-springer matthias-springer force-pushed the users/matthias-springer/do_not_build_target_mat branch from ddc9294 to 6041464 Compare December 20, 2024 13:48
@matthias-springer matthias-springer marked this pull request as ready for review December 20, 2024 13:49
Copy link
Member

@zero9178 zero9178 left a comment

Choose a reason for hiding this comment

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

LGTM as discussed in the comments, thank you! I think it is better to land this as early as reasonable compared to the larger PR. The more we can split out and phase in gradually the better probably

@@ -2864,6 +2843,9 @@ void TypeConverter::SignatureConversion::remapInput(unsigned origInputNo,

LogicalResult TypeConverter::convertType(Type t,
SmallVectorImpl<Type> &results) const {
assert(this && "expected non-null type converter");
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
assert(this && "expected non-null type converter");

This assert only protects against a case that is already in UB as far as C++ is concerned and would e.g. get optimized out in release builds.

Copy link
Member Author

@matthias-springer matthias-springer Dec 23, 2024

Choose a reason for hiding this comment

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

I know this is not really needed, but I spent an hour debugging patterns that run without type converters (running in debug mode). (Can also be helpful for finding bugs in the dialect conversion framework.) When convertType is called on a null type converter, the stack trace looks really odd and makes it look like something is wrong with the caching logic / mutex synchronization inside of TypeConverter::convertType.

@matthias-springer matthias-springer force-pushed the users/matthias-springer/do_not_build_target_mat branch from 6041464 to 759edf6 Compare December 23, 2024 12:10
@matthias-springer matthias-springer merged commit 3cc311a into main Dec 23, 2024
8 checks passed
@matthias-springer matthias-springer deleted the users/matthias-springer/do_not_build_target_mat branch December 23, 2024 12:27
@llvm-ci
Copy link
Collaborator

llvm-ci commented Dec 23, 2024

LLVM Buildbot has detected a new failure on builder sanitizer-x86_64-linux-fast running on sanitizer-buildbot4 while building mlir at step 2 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/169/builds/6738

Here is the relevant piece of the build log for the reference
Step 2 (annotate) failure: 'python ../sanitizer_buildbot/sanitizers/zorg/buildbot/builders/sanitizers/buildbot_selector.py' (failure)
...
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using lld-link: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/lld-link
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using ld64.lld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using wasm-ld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using ld.lld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/ld.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using lld-link: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/lld-link
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using ld64.lld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using wasm-ld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/main.py:72: note: The test suite configuration requested an individual test timeout of 0 seconds but a timeout of 900 seconds was requested on the command line. Forcing timeout to be 900 seconds.
-- Testing: 88018 tests, 88 workers --
Testing:  0.. 10.. 20.. 30
FAIL: MLIR :: Conversion/NVGPUToNVVM/nvgpu-to-nvvm.mlir (2730 of 88018)
******************** TEST 'MLIR :: Conversion/NVGPUToNVVM/nvgpu-to-nvvm.mlir' FAILED ********************
Exit Code: 2

Command Output (stdout):
--
# RUN: at line 1
/home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/mlir-opt /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/test/Conversion/NVGPUToNVVM/nvgpu-to-nvvm.mlir -convert-nvgpu-to-nvvm | /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/FileCheck /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/test/Conversion/NVGPUToNVVM/nvgpu-to-nvvm.mlir
# executed command: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/mlir-opt /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/test/Conversion/NVGPUToNVVM/nvgpu-to-nvvm.mlir -convert-nvgpu-to-nvvm
# .---command stderr------------
# | =================================================================
# | ==3605555==ERROR: AddressSanitizer: stack-use-after-return on address 0x78fa985c1ea0 at pc 0x5b5e80359bb3 bp 0x7ffcc8a227d0 sp 0x7ffcc8a227c8
# | READ of size 8 at 0x78fa985c1ea0 thread T0
# |     #0 0x5b5e80359bb2 in operator() /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/lib/Conversion/LLVMCommon/TypeConverter.cpp:257:14
# |     #1 0x5b5e80359bb2 in operator() /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/include/mlir/Transforms/DialectConversion.h:449:17
# |     #2 0x5b5e80359bb2 in __invoke<(lambda at /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/include/mlir/Transforms/DialectConversion.h:430:12) &, mlir::OpBuilder &, mlir::TypeRange, mlir::ValueRange, mlir::Location, mlir::Type> /home/b/sanitizer-x86_64-linux-fast/build/libcxx_install_asan_ubsan/include/c++/v1/__type_traits/invoke.h:149:25
# |     #3 0x5b5e80359bb2 in __call<(lambda at /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/include/mlir/Transforms/DialectConversion.h:430:12) &, mlir::OpBuilder &, mlir::TypeRange, mlir::ValueRange, mlir::Location, mlir::Type> /home/b/sanitizer-x86_64-linux-fast/build/libcxx_install_asan_ubsan/include/c++/v1/__type_traits/invoke.h:216:12
# |     #4 0x5b5e80359bb2 in operator() /home/b/sanitizer-x86_64-linux-fast/build/libcxx_install_asan_ubsan/include/c++/v1/__functional/function.h:169:12
# |     #5 0x5b5e80359bb2 in std::__1::__function::__func<std::__1::enable_if<std::is_invocable_v<mlir::LLVMTypeConverter::LLVMTypeConverter(mlir::MLIRContext*, mlir::LowerToLLVMOptions const&, mlir::DataLayoutAnalysis const*)::$_19, mlir::OpBuilder&, mlir::Type, mlir::ValueRange, mlir::Location, mlir::Type>, std::__1::function<llvm::SmallVector<mlir::Value, 6u> (mlir::OpBuilder&, mlir::TypeRange, mlir::ValueRange, mlir::Location, mlir::Type)>>::type mlir::TypeConverter::wrapTargetMaterialization<mlir::Type, mlir::LLVMTypeConverter::LLVMTypeConverter(mlir::MLIRContext*, mlir::LowerToLLVMOptions const&, mlir::DataLayoutAnalysis const*)::$_19>(mlir::LLVMTypeConverter::LLVMTypeConverter(mlir::MLIRContext*, mlir::LowerToLLVMOptions const&, mlir::DataLayoutAnalysis const*)::$_19&&) const::'lambda'(mlir::OpBuilder&, mlir::TypeRange, mlir::ValueRange, mlir::Location, mlir::Type), std::__1::allocator<std::__1::enable_if<std::is_invocable_v<mlir::LLVMTypeConverter::LLVMTypeConverter(mlir::MLIRContext*, mlir::LowerToLLVMOptions const&, mlir::DataLayoutAnalysis const*)::$_19, mlir::OpBuilder&, mlir::Type, mlir::ValueRange, mlir::Location, mlir::Type>, std::__1::function<llvm::SmallVector<mlir::Value, 6u> (mlir::OpBuilder&, mlir::TypeRange, mlir::ValueRange, mlir::Location, mlir::Type)>>::type mlir::TypeConverter::wrapTargetMaterialization<mlir::Type, mlir::LLVMTypeConverter::LLVMTypeConverter(mlir::MLIRContext*, mlir::LowerToLLVMOptions const&, mlir::DataLayoutAnalysis const*)::$_19>(mlir::LLVMTypeConverter::LLVMTypeConverter(mlir::MLIRContext*, mlir::LowerToLLVMOptions const&, mlir::DataLayoutAnalysis const*)::$_19&&) const::'lambda'(mlir::OpBuilder&, mlir::TypeRange, mlir::ValueRange, mlir::Location, mlir::Type)>, llvm::SmallVector<mlir::Value, 6u> (mlir::OpBuilder&, mlir::TypeRange, mlir::ValueRange, mlir::Location, mlir::Type)>::operator()(mlir::OpBuilder&, mlir::TypeRange&&, mlir::ValueRange&&, mlir::Location&&, mlir::Type&&) /home/b/sanitizer-x86_64-linux-fast/build/libcxx_install_asan_ubsan/include/c++/v1/__functional/function.h:314:10
# |     #6 0x5b5e80bab56c in operator() /home/b/sanitizer-x86_64-linux-fast/build/libcxx_install_asan_ubsan/include/c++/v1/__functional/function.h:431:12
# |     #7 0x5b5e80bab56c in operator() /home/b/sanitizer-x86_64-linux-fast/build/libcxx_install_asan_ubsan/include/c++/v1/__functional/function.h:990:10
# |     #8 0x5b5e80bab56c in mlir::TypeConverter::materializeTargetConversion(mlir::OpBuilder&, mlir::Location, mlir::TypeRange, mlir::ValueRange, mlir::Type) const /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/lib/Transforms/Utils/DialectConversion.cpp:2993:9
# |     #9 0x5b5e80ba59b2 in legalizeUnresolvedMaterialization /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/lib/Transforms/Utils/DialectConversion.cpp:2642:39
# |     #10 0x5b5e80ba59b2 in mlir::OperationConverter::convertOperations(llvm::ArrayRef<mlir::Operation*>) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/lib/Transforms/Utils/DialectConversion.cpp:2729:18
# |     #11 0x5b5e80bb4d40 in applyPartialConversion /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/lib/Transforms/Utils/DialectConversion.cpp:3388:22
# |     #12 0x5b5e80bb4d40 in mlir::applyPartialConversion(mlir::Operation*, mlir::ConversionTarget const&, mlir::FrozenRewritePatternSet const&, mlir::ConversionConfig) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/lib/Transforms/Utils/DialectConversion.cpp:3394:10
# |     #13 0x5b5e8051235e in (anonymous namespace)::ConvertNVGPUToNVVMPass::runOnOperation() /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/lib/Conversion/NVGPUToNVVM/NVGPUToNVVM.cpp:479:16
# |     #14 0x5b5e80a9018c in operator() /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/lib/Pass/Pass.cpp:526:17
# |     #15 0x5b5e80a9018c in void llvm::function_ref<void ()>::callback_fn<mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int)::$_1>(long) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:46:12
# |     #16 0x5b5e80a8143c in operator() /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:69:12
# |     #17 0x5b5e80a8143c in executeAction<mlir::PassExecutionAction, mlir::Pass &> /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/include/mlir/IR/MLIRContext.h:280:7
# |     #18 0x5b5e80a8143c in mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/lib/Pass/Pass.cpp:520:21
# |     #19 0x5b5e80a82647 in mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/lib/Pass/Pass.cpp:592:16
# |     #20 0x5b5e80a88eb1 in runPasses /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/lib/Pass/Pass.cpp:905:10
# |     #21 0x5b5e80a88eb1 in mlir::PassManager::run(mlir::Operation*) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/lib/Pass/Pass.cpp:885:60
# |     #22 0x5b5e80a74fd8 in performActions(llvm::raw_ostream&, std::__1::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:474:17
# |     #23 0x5b5e80a7460c in processBuffer /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:542:12
# |     #24 0x5b5e80a7460c in operator() /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:625:12
# |     #25 0x5b5e80a7460c in llvm::LogicalResult llvm::function_ref<llvm::LogicalResult (std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>::callback_fn<mlir::MlirOptMain(llvm::raw_ostream&, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&)::$_0>(long, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:46:12
Step 10 (stage2/asan_ubsan check) failure: stage2/asan_ubsan check (failure)
...
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using lld-link: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/lld-link
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using ld64.lld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using wasm-ld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using ld.lld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/ld.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using lld-link: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/lld-link
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using ld64.lld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using wasm-ld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/main.py:72: note: The test suite configuration requested an individual test timeout of 0 seconds but a timeout of 900 seconds was requested on the command line. Forcing timeout to be 900 seconds.
-- Testing: 88018 tests, 88 workers --
Testing:  0.. 10.. 20.. 30
FAIL: MLIR :: Conversion/NVGPUToNVVM/nvgpu-to-nvvm.mlir (2730 of 88018)
******************** TEST 'MLIR :: Conversion/NVGPUToNVVM/nvgpu-to-nvvm.mlir' FAILED ********************
Exit Code: 2

Command Output (stdout):
--
# RUN: at line 1
/home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/mlir-opt /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/test/Conversion/NVGPUToNVVM/nvgpu-to-nvvm.mlir -convert-nvgpu-to-nvvm | /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/FileCheck /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/test/Conversion/NVGPUToNVVM/nvgpu-to-nvvm.mlir
# executed command: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/mlir-opt /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/test/Conversion/NVGPUToNVVM/nvgpu-to-nvvm.mlir -convert-nvgpu-to-nvvm
# .---command stderr------------
# | =================================================================
# | ==3605555==ERROR: AddressSanitizer: stack-use-after-return on address 0x78fa985c1ea0 at pc 0x5b5e80359bb3 bp 0x7ffcc8a227d0 sp 0x7ffcc8a227c8
# | READ of size 8 at 0x78fa985c1ea0 thread T0
# |     #0 0x5b5e80359bb2 in operator() /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/lib/Conversion/LLVMCommon/TypeConverter.cpp:257:14
# |     #1 0x5b5e80359bb2 in operator() /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/include/mlir/Transforms/DialectConversion.h:449:17
# |     #2 0x5b5e80359bb2 in __invoke<(lambda at /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/include/mlir/Transforms/DialectConversion.h:430:12) &, mlir::OpBuilder &, mlir::TypeRange, mlir::ValueRange, mlir::Location, mlir::Type> /home/b/sanitizer-x86_64-linux-fast/build/libcxx_install_asan_ubsan/include/c++/v1/__type_traits/invoke.h:149:25
# |     #3 0x5b5e80359bb2 in __call<(lambda at /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/include/mlir/Transforms/DialectConversion.h:430:12) &, mlir::OpBuilder &, mlir::TypeRange, mlir::ValueRange, mlir::Location, mlir::Type> /home/b/sanitizer-x86_64-linux-fast/build/libcxx_install_asan_ubsan/include/c++/v1/__type_traits/invoke.h:216:12
# |     #4 0x5b5e80359bb2 in operator() /home/b/sanitizer-x86_64-linux-fast/build/libcxx_install_asan_ubsan/include/c++/v1/__functional/function.h:169:12
# |     #5 0x5b5e80359bb2 in std::__1::__function::__func<std::__1::enable_if<std::is_invocable_v<mlir::LLVMTypeConverter::LLVMTypeConverter(mlir::MLIRContext*, mlir::LowerToLLVMOptions const&, mlir::DataLayoutAnalysis const*)::$_19, mlir::OpBuilder&, mlir::Type, mlir::ValueRange, mlir::Location, mlir::Type>, std::__1::function<llvm::SmallVector<mlir::Value, 6u> (mlir::OpBuilder&, mlir::TypeRange, mlir::ValueRange, mlir::Location, mlir::Type)>>::type mlir::TypeConverter::wrapTargetMaterialization<mlir::Type, mlir::LLVMTypeConverter::LLVMTypeConverter(mlir::MLIRContext*, mlir::LowerToLLVMOptions const&, mlir::DataLayoutAnalysis const*)::$_19>(mlir::LLVMTypeConverter::LLVMTypeConverter(mlir::MLIRContext*, mlir::LowerToLLVMOptions const&, mlir::DataLayoutAnalysis const*)::$_19&&) const::'lambda'(mlir::OpBuilder&, mlir::TypeRange, mlir::ValueRange, mlir::Location, mlir::Type), std::__1::allocator<std::__1::enable_if<std::is_invocable_v<mlir::LLVMTypeConverter::LLVMTypeConverter(mlir::MLIRContext*, mlir::LowerToLLVMOptions const&, mlir::DataLayoutAnalysis const*)::$_19, mlir::OpBuilder&, mlir::Type, mlir::ValueRange, mlir::Location, mlir::Type>, std::__1::function<llvm::SmallVector<mlir::Value, 6u> (mlir::OpBuilder&, mlir::TypeRange, mlir::ValueRange, mlir::Location, mlir::Type)>>::type mlir::TypeConverter::wrapTargetMaterialization<mlir::Type, mlir::LLVMTypeConverter::LLVMTypeConverter(mlir::MLIRContext*, mlir::LowerToLLVMOptions const&, mlir::DataLayoutAnalysis const*)::$_19>(mlir::LLVMTypeConverter::LLVMTypeConverter(mlir::MLIRContext*, mlir::LowerToLLVMOptions const&, mlir::DataLayoutAnalysis const*)::$_19&&) const::'lambda'(mlir::OpBuilder&, mlir::TypeRange, mlir::ValueRange, mlir::Location, mlir::Type)>, llvm::SmallVector<mlir::Value, 6u> (mlir::OpBuilder&, mlir::TypeRange, mlir::ValueRange, mlir::Location, mlir::Type)>::operator()(mlir::OpBuilder&, mlir::TypeRange&&, mlir::ValueRange&&, mlir::Location&&, mlir::Type&&) /home/b/sanitizer-x86_64-linux-fast/build/libcxx_install_asan_ubsan/include/c++/v1/__functional/function.h:314:10
# |     #6 0x5b5e80bab56c in operator() /home/b/sanitizer-x86_64-linux-fast/build/libcxx_install_asan_ubsan/include/c++/v1/__functional/function.h:431:12
# |     #7 0x5b5e80bab56c in operator() /home/b/sanitizer-x86_64-linux-fast/build/libcxx_install_asan_ubsan/include/c++/v1/__functional/function.h:990:10
# |     #8 0x5b5e80bab56c in mlir::TypeConverter::materializeTargetConversion(mlir::OpBuilder&, mlir::Location, mlir::TypeRange, mlir::ValueRange, mlir::Type) const /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/lib/Transforms/Utils/DialectConversion.cpp:2993:9
# |     #9 0x5b5e80ba59b2 in legalizeUnresolvedMaterialization /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/lib/Transforms/Utils/DialectConversion.cpp:2642:39
# |     #10 0x5b5e80ba59b2 in mlir::OperationConverter::convertOperations(llvm::ArrayRef<mlir::Operation*>) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/lib/Transforms/Utils/DialectConversion.cpp:2729:18
# |     #11 0x5b5e80bb4d40 in applyPartialConversion /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/lib/Transforms/Utils/DialectConversion.cpp:3388:22
# |     #12 0x5b5e80bb4d40 in mlir::applyPartialConversion(mlir::Operation*, mlir::ConversionTarget const&, mlir::FrozenRewritePatternSet const&, mlir::ConversionConfig) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/lib/Transforms/Utils/DialectConversion.cpp:3394:10
# |     #13 0x5b5e8051235e in (anonymous namespace)::ConvertNVGPUToNVVMPass::runOnOperation() /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/lib/Conversion/NVGPUToNVVM/NVGPUToNVVM.cpp:479:16
# |     #14 0x5b5e80a9018c in operator() /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/lib/Pass/Pass.cpp:526:17
# |     #15 0x5b5e80a9018c in void llvm::function_ref<void ()>::callback_fn<mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int)::$_1>(long) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:46:12
# |     #16 0x5b5e80a8143c in operator() /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:69:12
# |     #17 0x5b5e80a8143c in executeAction<mlir::PassExecutionAction, mlir::Pass &> /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/include/mlir/IR/MLIRContext.h:280:7
# |     #18 0x5b5e80a8143c in mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/lib/Pass/Pass.cpp:520:21
# |     #19 0x5b5e80a82647 in mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/lib/Pass/Pass.cpp:592:16
# |     #20 0x5b5e80a88eb1 in runPasses /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/lib/Pass/Pass.cpp:905:10
# |     #21 0x5b5e80a88eb1 in mlir::PassManager::run(mlir::Operation*) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/lib/Pass/Pass.cpp:885:60
# |     #22 0x5b5e80a74fd8 in performActions(llvm::raw_ostream&, std::__1::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:474:17
# |     #23 0x5b5e80a7460c in processBuffer /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:542:12
# |     #24 0x5b5e80a7460c in operator() /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:625:12
# |     #25 0x5b5e80a7460c in llvm::LogicalResult llvm::function_ref<llvm::LogicalResult (std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>::callback_fn<mlir::MlirOptMain(llvm::raw_ostream&, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&)::$_0>(long, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:46:12

matthias-springer added a commit that referenced this pull request Dec 23, 2024
matthias-springer added a commit that referenced this pull request Dec 23, 2024
Fix a use-after-return in #117513. Free-standing lambdas should not be
defined inside of the `LLVMTypeConverter` constructor because they go
out of scope.
pranavk added a commit to pranavk/llvm-project that referenced this pull request Dec 23, 2024
bchetioui added a commit to bchetioui/llvm-project that referenced this pull request Dec 27, 2024
materialization.

When replacing a block argument, previously to llvm#117513, we would
automatically insert a N->1 argument materialization. After llvm#117513,
this is no longer the case for 1->1 mappings.

As a result, no materialization is added until `ReplaceBlockArgRewrite`
is committed, where `findOrBuildReplacementValue` inserts a source
materialization. The switch from an argument materialization to a source
materialization causes legalization to fail.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mlir:core MLIR Core Infrastructure mlir:llvm mlir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants