Skip to content

[mlir][bufferization]-Add ControlBuildSubsetExtractionFn to TensorEmptyElimination #120851

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

Conversation

amirBish
Copy link
Contributor

This PR Adds a ControlBuildSubsetExtractionFn to the tensor empty elimination util, This will control the building of the subsets extraction of the
SubsetInsertionOpInterface.

This control function returns the subsets extraction value that will replace the emptyTensorOp use
which is being consumed by a specefic user (which the
util expects to eliminate it).

The default control function will stay like today's behavior without any additional changes.

@llvmbot llvmbot added mlir mlir:bufferization Bufferization infrastructure labels Dec 21, 2024
@llvmbot
Copy link
Member

llvmbot commented Dec 21, 2024

@llvm/pr-subscribers-mlir-bufferization

Author: Amir Bishara (amirBish)

Changes

This PR Adds a ControlBuildSubsetExtractionFn to the tensor empty elimination util, This will control the building of the subsets extraction of the
SubsetInsertionOpInterface.

This control function returns the subsets extraction value that will replace the emptyTensorOp use
which is being consumed by a specefic user (which the
util expects to eliminate it).

The default control function will stay like today's behavior without any additional changes.


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

2 Files Affected:

  • (modified) mlir/include/mlir/Dialect/Bufferization/Transforms/Transforms.h (+30-2)
  • (modified) mlir/lib/Dialect/Bufferization/Transforms/EmptyTensorElimination.cpp (+29-20)
diff --git a/mlir/include/mlir/Dialect/Bufferization/Transforms/Transforms.h b/mlir/include/mlir/Dialect/Bufferization/Transforms/Transforms.h
index 892675954493b9..bd9242e2caccb4 100644
--- a/mlir/include/mlir/Dialect/Bufferization/Transforms/Transforms.h
+++ b/mlir/include/mlir/Dialect/Bufferization/Transforms/Transforms.h
@@ -10,7 +10,9 @@
 #define MLIR_DIALECT_BUFFERIZATION_TRANSFORMS_TRANSFORMS_H
 
 #include "mlir/Dialect/Bufferization/Transforms/OneShotAnalysis.h"
+#include "mlir/Dialect/Tensor/IR/Tensor.h"
 #include "mlir/IR/Operation.h"
+#include "mlir/Interfaces/SubsetOpInterface.h"
 
 namespace mlir {
 namespace bufferization {
@@ -34,13 +36,39 @@ struct OneShotBufferizationOptions;
 /// "tensor.empty" op.
 LogicalResult eliminateEmptyTensors(RewriterBase &rewriter, Operation *op);
 
+/// Find a valid insertion point for a replacement of `emptyTensorOp`'s
+/// use of `user` operation, assuming that the replacement may use any
+/// value from `neededValues`.
+Operation *findValidInsertionPoint(Operation *emptyTensorOp, Operation *user,
+                                   const SmallVector<Value> &neededValues);
+
+/// A function type that defines a callBack to control the build of the
+/// subsets extraction of the `SubsetInsertionOpInterface`.
+/// The subsets extraction value will replace the `emptyTensorOp` value
+/// which is being consumed by `user`, failing of building such a value
+/// should be indicated with an empty value.
+/// This function should guarantee the legality of the replacement.
+using ControlBuildSubsetExtractionFn =
+    std::function<Value(RewriterBase &, SubsetInsertionOpInterface,
+                        tensor::EmptyOp emptyTensorOp, Operation *user)>;
+
+/// This method Builds and returns a subset extraction value for the
+/// destination tensor that the given `op` inserts into.
+/// It returns a value which should replace the `emptyTensorOp` use
+/// that is being consumed by `user`, If no such a value found it
+/// will return an empty Value.
+Value buildSubsetExtraction(RewriterBase &rewriter,
+                            SubsetInsertionOpInterface op,
+                            tensor::EmptyOp emptyTensorOp, Operation *user);
+
 /// Try to eliminate "tensor.empty" ops inside `op`.
 ///
 /// This function overload accepts an existing `OneShotAnalysisState`, which
 /// contains in-place bufferization decisions. This overload is useful if an
 /// existing analysis should be reused for empty tensor elimination.
-LogicalResult eliminateEmptyTensors(RewriterBase &rewriter, Operation *op,
-                                    OneShotAnalysisState &state);
+LogicalResult eliminateEmptyTensors(
+    RewriterBase &rewriter, Operation *op, OneShotAnalysisState &state,
+    ControlBuildSubsetExtractionFn subsetsExtractionFn = buildSubsetExtraction);
 
 /// Within the given operation, hoist buffers from loops where possible. See
 /// "BufferLoopHoistingPass" for more information.
diff --git a/mlir/lib/Dialect/Bufferization/Transforms/EmptyTensorElimination.cpp b/mlir/lib/Dialect/Bufferization/Transforms/EmptyTensorElimination.cpp
index abc0635a2cdff0..dabb44edd32783 100644
--- a/mlir/lib/Dialect/Bufferization/Transforms/EmptyTensorElimination.cpp
+++ b/mlir/lib/Dialect/Bufferization/Transforms/EmptyTensorElimination.cpp
@@ -51,9 +51,9 @@ neededValuesDominateInsertionPoint(const DominanceInfo &domInfo,
 /// Find a valid insertion point for a replacement of `emptyTensorOp`'s
 /// use of `user` operation, assuming that the replacement may use any
 /// value from `neededValues`.
-static Operation *
-findValidInsertionPoint(Operation *emptyTensorOp, Operation *user,
-                        const SmallVector<Value> &neededValues) {
+Operation *mlir::bufferization::findValidInsertionPoint(
+    Operation *emptyTensorOp, Operation *user,
+    const SmallVector<Value> &neededValues) {
   DominanceInfo domInfo;
   Operation *candidateInsertionPoint = emptyTensorOp;
 
@@ -93,8 +93,31 @@ findValidInsertionPoint(Operation *emptyTensorOp, Operation *user,
   return nullptr;
 }
 
+Value mlir::bufferization::buildSubsetExtraction(RewriterBase &rewriter,
+                                                 SubsetInsertionOpInterface op,
+                                                 tensor::EmptyOp emptyTensorOp,
+                                                 Operation *user) {
+
+  mlir::OpBuilder::InsertionGuard guard(rewriter);
+  // All values that are needed to create the replacement op.
+  SmallVector<Value> neededValues = op.getValuesNeededToBuildSubsetExtraction();
+  // Find a suitable insertion point. If no suitable insertion point
+  // for the replacement can be found, return an empty value to skip
+  // this replacement.
+  Operation *insertionPoint =
+      findValidInsertionPoint(emptyTensorOp, user, neededValues);
+  if (!insertionPoint)
+    return {};
+
+  rewriter.setInsertionPoint(insertionPoint);
+  Value replacement =
+      op.buildSubsetExtraction(rewriter, emptyTensorOp->getLoc());
+  return replacement;
+}
+
 LogicalResult mlir::bufferization::eliminateEmptyTensors(
-    RewriterBase &rewriter, Operation *op, OneShotAnalysisState &state) {
+    RewriterBase &rewriter, Operation *op, OneShotAnalysisState &state,
+    ControlBuildSubsetExtractionFn subsetsExtractionFn) {
   OpBuilder::InsertionGuard g(rewriter);
   llvm::DenseSet<OpOperand *> visitedOpOperands;
   op->walk([&](SubsetInsertionOpInterface op) {
@@ -105,10 +128,6 @@ LogicalResult mlir::bufferization::eliminateEmptyTensors(
     if (!state.isInPlace(source))
       return WalkResult::skip();
 
-    // All values that are needed to create the replacement op.
-    SmallVector<Value> neededValues =
-        op.getValuesNeededToBuildSubsetExtraction();
-
     // Find tensor.empty ops on the reverse SSA use-def chain. Only follow
     // equivalent tensors. I.e., stop when there are ops such as extract_slice
     // on the path.
@@ -129,7 +148,7 @@ LogicalResult mlir::bufferization::eliminateEmptyTensors(
         &visitedOpOperands);
 
     for (Value v : emptyTensors) {
-      Operation *emptyTensorOp = v.getDefiningOp();
+      auto emptyTensorOp = v.getDefiningOp<tensor::EmptyOp>();
 
       // Find the use to be replaced from the use-def chain.
       auto iter = llvm::find_if(
@@ -142,17 +161,7 @@ LogicalResult mlir::bufferization::eliminateEmptyTensors(
         continue;
       OpOperand *useToBeReplaced = *iter;
       Operation *user = useToBeReplaced->getOwner();
-
-      // Find a suitable insertion point. If no suitable insertion point for
-      // the replacement can be found, skip this replacement.
-      Operation *insertionPoint =
-          findValidInsertionPoint(emptyTensorOp, user, neededValues);
-      if (!insertionPoint)
-        continue;
-
-      rewriter.setInsertionPoint(insertionPoint);
-      Value replacement =
-          op.buildSubsetExtraction(rewriter, emptyTensorOp->getLoc());
+      auto replacement = subsetsExtractionFn(rewriter, op, emptyTensorOp, user);
       if (!replacement)
         continue;
       if (emptyTensorOp == replacement.getDefiningOp())

@llvmbot
Copy link
Member

llvmbot commented Dec 21, 2024

@llvm/pr-subscribers-mlir

Author: Amir Bishara (amirBish)

Changes

This PR Adds a ControlBuildSubsetExtractionFn to the tensor empty elimination util, This will control the building of the subsets extraction of the
SubsetInsertionOpInterface.

This control function returns the subsets extraction value that will replace the emptyTensorOp use
which is being consumed by a specefic user (which the
util expects to eliminate it).

The default control function will stay like today's behavior without any additional changes.


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

2 Files Affected:

  • (modified) mlir/include/mlir/Dialect/Bufferization/Transforms/Transforms.h (+30-2)
  • (modified) mlir/lib/Dialect/Bufferization/Transforms/EmptyTensorElimination.cpp (+29-20)
diff --git a/mlir/include/mlir/Dialect/Bufferization/Transforms/Transforms.h b/mlir/include/mlir/Dialect/Bufferization/Transforms/Transforms.h
index 892675954493b9..bd9242e2caccb4 100644
--- a/mlir/include/mlir/Dialect/Bufferization/Transforms/Transforms.h
+++ b/mlir/include/mlir/Dialect/Bufferization/Transforms/Transforms.h
@@ -10,7 +10,9 @@
 #define MLIR_DIALECT_BUFFERIZATION_TRANSFORMS_TRANSFORMS_H
 
 #include "mlir/Dialect/Bufferization/Transforms/OneShotAnalysis.h"
+#include "mlir/Dialect/Tensor/IR/Tensor.h"
 #include "mlir/IR/Operation.h"
+#include "mlir/Interfaces/SubsetOpInterface.h"
 
 namespace mlir {
 namespace bufferization {
@@ -34,13 +36,39 @@ struct OneShotBufferizationOptions;
 /// "tensor.empty" op.
 LogicalResult eliminateEmptyTensors(RewriterBase &rewriter, Operation *op);
 
+/// Find a valid insertion point for a replacement of `emptyTensorOp`'s
+/// use of `user` operation, assuming that the replacement may use any
+/// value from `neededValues`.
+Operation *findValidInsertionPoint(Operation *emptyTensorOp, Operation *user,
+                                   const SmallVector<Value> &neededValues);
+
+/// A function type that defines a callBack to control the build of the
+/// subsets extraction of the `SubsetInsertionOpInterface`.
+/// The subsets extraction value will replace the `emptyTensorOp` value
+/// which is being consumed by `user`, failing of building such a value
+/// should be indicated with an empty value.
+/// This function should guarantee the legality of the replacement.
+using ControlBuildSubsetExtractionFn =
+    std::function<Value(RewriterBase &, SubsetInsertionOpInterface,
+                        tensor::EmptyOp emptyTensorOp, Operation *user)>;
+
+/// This method Builds and returns a subset extraction value for the
+/// destination tensor that the given `op` inserts into.
+/// It returns a value which should replace the `emptyTensorOp` use
+/// that is being consumed by `user`, If no such a value found it
+/// will return an empty Value.
+Value buildSubsetExtraction(RewriterBase &rewriter,
+                            SubsetInsertionOpInterface op,
+                            tensor::EmptyOp emptyTensorOp, Operation *user);
+
 /// Try to eliminate "tensor.empty" ops inside `op`.
 ///
 /// This function overload accepts an existing `OneShotAnalysisState`, which
 /// contains in-place bufferization decisions. This overload is useful if an
 /// existing analysis should be reused for empty tensor elimination.
-LogicalResult eliminateEmptyTensors(RewriterBase &rewriter, Operation *op,
-                                    OneShotAnalysisState &state);
+LogicalResult eliminateEmptyTensors(
+    RewriterBase &rewriter, Operation *op, OneShotAnalysisState &state,
+    ControlBuildSubsetExtractionFn subsetsExtractionFn = buildSubsetExtraction);
 
 /// Within the given operation, hoist buffers from loops where possible. See
 /// "BufferLoopHoistingPass" for more information.
diff --git a/mlir/lib/Dialect/Bufferization/Transforms/EmptyTensorElimination.cpp b/mlir/lib/Dialect/Bufferization/Transforms/EmptyTensorElimination.cpp
index abc0635a2cdff0..dabb44edd32783 100644
--- a/mlir/lib/Dialect/Bufferization/Transforms/EmptyTensorElimination.cpp
+++ b/mlir/lib/Dialect/Bufferization/Transforms/EmptyTensorElimination.cpp
@@ -51,9 +51,9 @@ neededValuesDominateInsertionPoint(const DominanceInfo &domInfo,
 /// Find a valid insertion point for a replacement of `emptyTensorOp`'s
 /// use of `user` operation, assuming that the replacement may use any
 /// value from `neededValues`.
-static Operation *
-findValidInsertionPoint(Operation *emptyTensorOp, Operation *user,
-                        const SmallVector<Value> &neededValues) {
+Operation *mlir::bufferization::findValidInsertionPoint(
+    Operation *emptyTensorOp, Operation *user,
+    const SmallVector<Value> &neededValues) {
   DominanceInfo domInfo;
   Operation *candidateInsertionPoint = emptyTensorOp;
 
@@ -93,8 +93,31 @@ findValidInsertionPoint(Operation *emptyTensorOp, Operation *user,
   return nullptr;
 }
 
+Value mlir::bufferization::buildSubsetExtraction(RewriterBase &rewriter,
+                                                 SubsetInsertionOpInterface op,
+                                                 tensor::EmptyOp emptyTensorOp,
+                                                 Operation *user) {
+
+  mlir::OpBuilder::InsertionGuard guard(rewriter);
+  // All values that are needed to create the replacement op.
+  SmallVector<Value> neededValues = op.getValuesNeededToBuildSubsetExtraction();
+  // Find a suitable insertion point. If no suitable insertion point
+  // for the replacement can be found, return an empty value to skip
+  // this replacement.
+  Operation *insertionPoint =
+      findValidInsertionPoint(emptyTensorOp, user, neededValues);
+  if (!insertionPoint)
+    return {};
+
+  rewriter.setInsertionPoint(insertionPoint);
+  Value replacement =
+      op.buildSubsetExtraction(rewriter, emptyTensorOp->getLoc());
+  return replacement;
+}
+
 LogicalResult mlir::bufferization::eliminateEmptyTensors(
-    RewriterBase &rewriter, Operation *op, OneShotAnalysisState &state) {
+    RewriterBase &rewriter, Operation *op, OneShotAnalysisState &state,
+    ControlBuildSubsetExtractionFn subsetsExtractionFn) {
   OpBuilder::InsertionGuard g(rewriter);
   llvm::DenseSet<OpOperand *> visitedOpOperands;
   op->walk([&](SubsetInsertionOpInterface op) {
@@ -105,10 +128,6 @@ LogicalResult mlir::bufferization::eliminateEmptyTensors(
     if (!state.isInPlace(source))
       return WalkResult::skip();
 
-    // All values that are needed to create the replacement op.
-    SmallVector<Value> neededValues =
-        op.getValuesNeededToBuildSubsetExtraction();
-
     // Find tensor.empty ops on the reverse SSA use-def chain. Only follow
     // equivalent tensors. I.e., stop when there are ops such as extract_slice
     // on the path.
@@ -129,7 +148,7 @@ LogicalResult mlir::bufferization::eliminateEmptyTensors(
         &visitedOpOperands);
 
     for (Value v : emptyTensors) {
-      Operation *emptyTensorOp = v.getDefiningOp();
+      auto emptyTensorOp = v.getDefiningOp<tensor::EmptyOp>();
 
       // Find the use to be replaced from the use-def chain.
       auto iter = llvm::find_if(
@@ -142,17 +161,7 @@ LogicalResult mlir::bufferization::eliminateEmptyTensors(
         continue;
       OpOperand *useToBeReplaced = *iter;
       Operation *user = useToBeReplaced->getOwner();
-
-      // Find a suitable insertion point. If no suitable insertion point for
-      // the replacement can be found, skip this replacement.
-      Operation *insertionPoint =
-          findValidInsertionPoint(emptyTensorOp, user, neededValues);
-      if (!insertionPoint)
-        continue;
-
-      rewriter.setInsertionPoint(insertionPoint);
-      Value replacement =
-          op.buildSubsetExtraction(rewriter, emptyTensorOp->getLoc());
+      auto replacement = subsetsExtractionFn(rewriter, op, emptyTensorOp, user);
       if (!replacement)
         continue;
       if (emptyTensorOp == replacement.getDefiningOp())

@amirBish
Copy link
Contributor Author

@matthias-springer This is the PR which adds the control function, as a follow up for this PR #118958 .

Would appreciate your review :)

@amirBish
Copy link
Contributor Author

@matthias-springer ping, can you have a look please

…tyElimination util

This PR Adds a `ControlBuildSubsetExtractionFn` to
the tensor empty elimination util, This will control
the building of the subsets extraction of the
`SubsetInsertionOpInterface`.

This control function returns the subsets extraction
value that will replace the `emptyTensorOp` use
which is being consumed by a specefic user (which the
 util expects to eliminate it).

The default control function will stay like  today's
behavior without any additional changes.
@amirBish amirBish force-pushed the amirBish/mlir/add-conrol-for-eliminate-tensor-empty branch from b2c97a0 to c94756c Compare December 28, 2024 11:11
@amirBish amirBish merged commit 7e749d4 into llvm:main Dec 28, 2024
8 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Dec 28, 2024

LLVM Buildbot has detected a new failure on builder clang-aarch64-sve2-vla running on linaro-g4-02 while building mlir at step 7 "ninja check 1".

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

Here is the relevant piece of the build log for the reference
Step 7 (ninja check 1) failure: stage 1 checked (failure)
******************** TEST 'HWAddressSanitizer-aarch64 :: TestCases/Linux/fixed-shadow.c' FAILED ********************
Exit Code: 2

Command Output (stdout):
--
1 0x10000000000
2 0x20000000000
3 0x30000000000
4 0x40000000000
5 0x50000000000
6 0x60000000000
7 0x70000000000
8 0x80000000000
9 0x90000000000
10 0xa0000000000
11 0xb0000000000
12 0xc0000000000
13 0xd0000000000
14 0xe0000000000
15 0xf0000000000
16 0x100000000000
17 0x110000000000
18 0x120000000000
19 0x130000000000
20 0x140000000000
21 0x150000000000
22 0x160000000000
23 0x170000000000
24 0x180000000000
25 0x190000000000
26 0x1a0000000000
27 0x1b0000000000
28 0x1c0000000000
29 0x1d0000000000
30 0x1e0000000000
31 0x1f0000000000
32 0x200000000000
33 0x210000000000
34 0x220000000000
35 0x230000000000
36 0x240000000000
37 0x250000000000
38 0x260000000000
39 0x270000000000
40 0x280000000000
41 0x290000000000
42 0x2a0000000000
43 0x2b0000000000
44 0x2c0000000000
45 0x2d0000000000
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Dec 28, 2024

LLVM Buildbot has detected a new failure on builder sanitizer-aarch64-linux-bootstrap-msan running on sanitizer-buildbot10 while building mlir at step 2 "annotate".

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

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-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using lld-link: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/lld-link
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using ld64.lld: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using wasm-ld: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using ld.lld: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/ld.lld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using lld-link: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/lld-link
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using ld64.lld: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using wasm-ld: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/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: 85649 tests, 72 workers --
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80
FAIL: LLVM :: tools/dsymutil/X86/DWARFLinkerParallel/dead-stripped.cpp (72450 of 85649)
******************** TEST 'LLVM :: tools/dsymutil/X86/DWARFLinkerParallel/dead-stripped.cpp' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/dsymutil --linker parallel --no-odr -f -y /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/test/tools/dsymutil/X86/DWARFLinkerParallel/../dummy-debug-map.map -oso-prepend-path  /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/test/tools/dsymutil/X86/DWARFLinkerParallel/../../Inputs/dead-stripped -o - | /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/llvm-dwarfdump - --debug-info |  /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/FileCheck /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/test/tools/dsymutil/X86/DWARFLinkerParallel/dead-stripped.cpp --implicit-check-not  "{{DW_AT_low_pc|DW_AT_high_pc|DW_AT_location|DW_TAG|NULL}}"
+ /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/llvm-dwarfdump - --debug-info
+ /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/dsymutil --linker parallel --no-odr -f -y /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/test/tools/dsymutil/X86/DWARFLinkerParallel/../dummy-debug-map.map -oso-prepend-path /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/test/tools/dsymutil/X86/DWARFLinkerParallel/../../Inputs/dead-stripped -o -
+ /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/FileCheck /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/test/tools/dsymutil/X86/DWARFLinkerParallel/dead-stripped.cpp --implicit-check-not '{{DW_AT_low_pc|DW_AT_high_pc|DW_AT_location|DW_TAG|NULL}}'
warning: Unable to open /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/test/tools/dsymutil/X86/DWARFLinkerParallel/../../Inputs/dead-stripped/2.o No such file or directory
warning: Unable to open /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/test/tools/dsymutil/X86/DWARFLinkerParallel/../../Inputs/dead-stripped/3.o No such file or directory
warning: Unable to open /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/test/tools/dsymutil/X86/DWARFLinkerParallel/../../Inputs/dead-stripped/4.o No such file or directory
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
warning: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/test/tools/dsymutil/X86/DWARFLinkerParallel/../../Inputs/dead-stripped/2.o: No such file or directory
note: while processing /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/test/tools/dsymutil/X86/DWARFLinkerParallel/../../Inputs/dead-stripped/2.o
warning: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/test/tools/dsymutil/X86/DWARFLinkerParallel/../../Inputs/dead-stripped/3.o: No such file or directory
note: while processing /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/test/tools/dsymutil/X86/DWARFLinkerParallel/../../Inputs/dead-stripped/3.o
warning: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/test/tools/dsymutil/X86/DWARFLinkerParallel/../../Inputs/dead-stripped/4.o: No such file or directory
note: while processing /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/test/tools/dsymutil/X86/DWARFLinkerParallel/../../Inputs/dead-stripped/4.o
warning: verification skipped for x86_64 because writing to stdout.
 #0 0x0000ae0c3e5669ac ___interceptor_backtrace /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/msan/../sanitizer_common/sanitizer_common_interceptors.inc:4497:13
 #1 0x0000ae0c433c3e68 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/lib/Support/Unix/Signals.inc:727:7
 #2 0x0000ae0c433bea3c llvm::sys::RunSignalHandlers() /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/lib/Support/Signals.cpp:106:18
 #3 0x0000ae0c433c4c04 SignalHandler(int) /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/lib/Support/Unix/Signals.inc:413:1
 #4 0x0000ae0c3e597ab4 ~ScopedThreadLocalStateBackup /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/msan/msan.h:352:37
 #5 0x0000ae0c3e597ab4 SignalHandler(int) /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/msan/msan_interceptors.cpp:1124:1
 #6 0x0000f0004367e8f8 (linux-vdso.so.1+0x8f8)
 #7 0x0000f00043152f5c (/lib/aarch64-linux-gnu/libc.so.6+0xa2f5c)
 #8 0x0000ae0c3e5a52f4 __msan::SetShadow(void const*, unsigned long, unsigned char) /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/msan/msan_poisoning.cpp:217:12
 #9 0x0000ae0c3e5a45b4 __msan::MsanThread::ClearShadowForThreadStackAndTLS() /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/msan/msan_thread.cpp:31:7
#10 0x0000ae0c3e5a471c malloc_storage /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/msan/msan_thread.h:45:59
#11 0x0000ae0c3e5a471c __msan::MsanThread::Init() /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/msan/msan_thread.cpp:45:3
#12 0x0000ae0c3e54b4e0 MsanThreadStartFunc(void*) /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/msan/msan_interceptors.cpp:1156:22
#13 0x0000f0004313597c (/lib/aarch64-linux-gnu/libc.so.6+0x8597c)
#14 0x0000f0004319ba4c (/lib/aarch64-linux-gnu/libc.so.6+0xeba4c)
MemorySanitizer:DEADLYSIGNAL
==546826==ERROR: MemorySanitizer: SEGV on unknown address 0x60000080e000 (pc 0xf00043152f5c bp 0xf0000080d860 sp 0xf0000080d800 T547404)
==546826==The signal is caused by a WRITE memory access.
Step 11 (stage2/msan check) failure: stage2/msan check (failure)
...
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using lld-link: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/lld-link
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using ld64.lld: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using wasm-ld: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using ld.lld: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/ld.lld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using lld-link: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/lld-link
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using ld64.lld: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using wasm-ld: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-aarch64-linux-bootstrap-msan/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: 85649 tests, 72 workers --
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80
FAIL: LLVM :: tools/dsymutil/X86/DWARFLinkerParallel/dead-stripped.cpp (72450 of 85649)
******************** TEST 'LLVM :: tools/dsymutil/X86/DWARFLinkerParallel/dead-stripped.cpp' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/dsymutil --linker parallel --no-odr -f -y /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/test/tools/dsymutil/X86/DWARFLinkerParallel/../dummy-debug-map.map -oso-prepend-path  /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/test/tools/dsymutil/X86/DWARFLinkerParallel/../../Inputs/dead-stripped -o - | /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/llvm-dwarfdump - --debug-info |  /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/FileCheck /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/test/tools/dsymutil/X86/DWARFLinkerParallel/dead-stripped.cpp --implicit-check-not  "{{DW_AT_low_pc|DW_AT_high_pc|DW_AT_location|DW_TAG|NULL}}"
+ /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/llvm-dwarfdump - --debug-info
+ /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/dsymutil --linker parallel --no-odr -f -y /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/test/tools/dsymutil/X86/DWARFLinkerParallel/../dummy-debug-map.map -oso-prepend-path /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/test/tools/dsymutil/X86/DWARFLinkerParallel/../../Inputs/dead-stripped -o -
+ /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm_build_msan/bin/FileCheck /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/test/tools/dsymutil/X86/DWARFLinkerParallel/dead-stripped.cpp --implicit-check-not '{{DW_AT_low_pc|DW_AT_high_pc|DW_AT_location|DW_TAG|NULL}}'
warning: Unable to open /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/test/tools/dsymutil/X86/DWARFLinkerParallel/../../Inputs/dead-stripped/2.o No such file or directory
warning: Unable to open /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/test/tools/dsymutil/X86/DWARFLinkerParallel/../../Inputs/dead-stripped/3.o No such file or directory
warning: Unable to open /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/test/tools/dsymutil/X86/DWARFLinkerParallel/../../Inputs/dead-stripped/4.o No such file or directory
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
warning: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/test/tools/dsymutil/X86/DWARFLinkerParallel/../../Inputs/dead-stripped/2.o: No such file or directory
note: while processing /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/test/tools/dsymutil/X86/DWARFLinkerParallel/../../Inputs/dead-stripped/2.o
warning: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/test/tools/dsymutil/X86/DWARFLinkerParallel/../../Inputs/dead-stripped/3.o: No such file or directory
note: while processing /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/test/tools/dsymutil/X86/DWARFLinkerParallel/../../Inputs/dead-stripped/3.o
warning: /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/test/tools/dsymutil/X86/DWARFLinkerParallel/../../Inputs/dead-stripped/4.o: No such file or directory
note: while processing /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/test/tools/dsymutil/X86/DWARFLinkerParallel/../../Inputs/dead-stripped/4.o
warning: verification skipped for x86_64 because writing to stdout.
 #0 0x0000ae0c3e5669ac ___interceptor_backtrace /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/msan/../sanitizer_common/sanitizer_common_interceptors.inc:4497:13
 #1 0x0000ae0c433c3e68 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/lib/Support/Unix/Signals.inc:727:7
 #2 0x0000ae0c433bea3c llvm::sys::RunSignalHandlers() /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/lib/Support/Signals.cpp:106:18
 #3 0x0000ae0c433c4c04 SignalHandler(int) /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/llvm/lib/Support/Unix/Signals.inc:413:1
 #4 0x0000ae0c3e597ab4 ~ScopedThreadLocalStateBackup /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/msan/msan.h:352:37
 #5 0x0000ae0c3e597ab4 SignalHandler(int) /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/msan/msan_interceptors.cpp:1124:1
 #6 0x0000f0004367e8f8 (linux-vdso.so.1+0x8f8)
 #7 0x0000f00043152f5c (/lib/aarch64-linux-gnu/libc.so.6+0xa2f5c)
 #8 0x0000ae0c3e5a52f4 __msan::SetShadow(void const*, unsigned long, unsigned char) /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/msan/msan_poisoning.cpp:217:12
 #9 0x0000ae0c3e5a45b4 __msan::MsanThread::ClearShadowForThreadStackAndTLS() /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/msan/msan_thread.cpp:31:7
#10 0x0000ae0c3e5a471c malloc_storage /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/msan/msan_thread.h:45:59
#11 0x0000ae0c3e5a471c __msan::MsanThread::Init() /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/msan/msan_thread.cpp:45:3
#12 0x0000ae0c3e54b4e0 MsanThreadStartFunc(void*) /home/b/sanitizer-aarch64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/msan/msan_interceptors.cpp:1156:22
#13 0x0000f0004313597c (/lib/aarch64-linux-gnu/libc.so.6+0x8597c)
#14 0x0000f0004319ba4c (/lib/aarch64-linux-gnu/libc.so.6+0xeba4c)
MemorySanitizer:DEADLYSIGNAL
==546826==ERROR: MemorySanitizer: SEGV on unknown address 0x60000080e000 (pc 0xf00043152f5c bp 0xf0000080d860 sp 0xf0000080d800 T547404)
==546826==The signal is caused by a WRITE memory access.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mlir:bufferization Bufferization infrastructure mlir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants