-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[mlir][NFC] Remove redundant insertion point changes #161837
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
These insertion points were added in llvm#146551 and llvm#146908 to support the one-shot dialect conversion driver which performs changes to the IR immediately and would otherwise invalidate previous insertion points. Since then, the insertion point has been made resilient against op erasure (llvm#146955) making the changes now redundant.
@llvm/pr-subscribers-mlir-spirv @llvm/pr-subscribers-mlir Author: Markus Böck (zero9178) ChangesThese insertion points were added in #146551 and #146908 to support the one-shot dialect conversion driver which performs changes to the IR immediately and would otherwise invalidate previous insertion points. Since then, the insertion point has been made resilient against op erasure (#146955) making the changes now redundant. Full diff: https://github.com/llvm/llvm-project/pull/161837.diff 2 Files Affected:
diff --git a/mlir/lib/Conversion/SPIRVToLLVM/ConvertLaunchFuncToLLVMCalls.cpp b/mlir/lib/Conversion/SPIRVToLLVM/ConvertLaunchFuncToLLVMCalls.cpp
index 035f197b1eac2..882d06f8e895c 100644
--- a/mlir/lib/Conversion/SPIRVToLLVM/ConvertLaunchFuncToLLVMCalls.cpp
+++ b/mlir/lib/Conversion/SPIRVToLLVM/ConvertLaunchFuncToLLVMCalls.cpp
@@ -267,9 +267,7 @@ class GPULaunchLowering : public ConvertOpToLLVMPattern<gpu::LaunchFuncOp> {
copyInfo.push_back(info);
}
// Create a call to the kernel and copy the data back.
- Operation *callOp = rewriter.replaceOpWithNewOp<LLVM::CallOp>(
- op, kernelFunc, ArrayRef<Value>());
- rewriter.setInsertionPointAfter(callOp);
+ rewriter.replaceOpWithNewOp<LLVM::CallOp>(op, kernelFunc, ArrayRef<Value>());
for (CopyInfo info : copyInfo)
copy(loc, info.src, info.dst, info.size, rewriter);
return success();
diff --git a/mlir/lib/Conversion/TosaToLinalg/TosaToLinalgNamed.cpp b/mlir/lib/Conversion/TosaToLinalg/TosaToLinalgNamed.cpp
index 6f288495516f7..0cb0badacf69d 100644
--- a/mlir/lib/Conversion/TosaToLinalg/TosaToLinalgNamed.cpp
+++ b/mlir/lib/Conversion/TosaToLinalg/TosaToLinalgNamed.cpp
@@ -802,7 +802,6 @@ class MaxPool2dConverter : public OpConversionPattern<tosa::MaxPool2dOp> {
ValueRange{paddedInput, fakeWindowDims}, filledEmptyTensor, strideAttr,
dilationAttr);
- rewriter.setInsertionPointAfter(op);
NanPropagationMode nanMode = op.getNanMode();
rewriter.replaceOp(op, resultOp);
|
@llvm/pr-subscribers-mlir-tosa Author: Markus Böck (zero9178) ChangesThese insertion points were added in #146551 and #146908 to support the one-shot dialect conversion driver which performs changes to the IR immediately and would otherwise invalidate previous insertion points. Since then, the insertion point has been made resilient against op erasure (#146955) making the changes now redundant. Full diff: https://github.com/llvm/llvm-project/pull/161837.diff 2 Files Affected:
diff --git a/mlir/lib/Conversion/SPIRVToLLVM/ConvertLaunchFuncToLLVMCalls.cpp b/mlir/lib/Conversion/SPIRVToLLVM/ConvertLaunchFuncToLLVMCalls.cpp
index 035f197b1eac2..882d06f8e895c 100644
--- a/mlir/lib/Conversion/SPIRVToLLVM/ConvertLaunchFuncToLLVMCalls.cpp
+++ b/mlir/lib/Conversion/SPIRVToLLVM/ConvertLaunchFuncToLLVMCalls.cpp
@@ -267,9 +267,7 @@ class GPULaunchLowering : public ConvertOpToLLVMPattern<gpu::LaunchFuncOp> {
copyInfo.push_back(info);
}
// Create a call to the kernel and copy the data back.
- Operation *callOp = rewriter.replaceOpWithNewOp<LLVM::CallOp>(
- op, kernelFunc, ArrayRef<Value>());
- rewriter.setInsertionPointAfter(callOp);
+ rewriter.replaceOpWithNewOp<LLVM::CallOp>(op, kernelFunc, ArrayRef<Value>());
for (CopyInfo info : copyInfo)
copy(loc, info.src, info.dst, info.size, rewriter);
return success();
diff --git a/mlir/lib/Conversion/TosaToLinalg/TosaToLinalgNamed.cpp b/mlir/lib/Conversion/TosaToLinalg/TosaToLinalgNamed.cpp
index 6f288495516f7..0cb0badacf69d 100644
--- a/mlir/lib/Conversion/TosaToLinalg/TosaToLinalgNamed.cpp
+++ b/mlir/lib/Conversion/TosaToLinalg/TosaToLinalgNamed.cpp
@@ -802,7 +802,6 @@ class MaxPool2dConverter : public OpConversionPattern<tosa::MaxPool2dOp> {
ValueRange{paddedInput, fakeWindowDims}, filledEmptyTensor, strideAttr,
dilationAttr);
- rewriter.setInsertionPointAfter(op);
NanPropagationMode nanMode = op.getNanMode();
rewriter.replaceOp(op, resultOp);
|
@llvm/pr-subscribers-mlir-linalg Author: Markus Böck (zero9178) ChangesThese insertion points were added in #146551 and #146908 to support the one-shot dialect conversion driver which performs changes to the IR immediately and would otherwise invalidate previous insertion points. Since then, the insertion point has been made resilient against op erasure (#146955) making the changes now redundant. Full diff: https://github.com/llvm/llvm-project/pull/161837.diff 2 Files Affected:
diff --git a/mlir/lib/Conversion/SPIRVToLLVM/ConvertLaunchFuncToLLVMCalls.cpp b/mlir/lib/Conversion/SPIRVToLLVM/ConvertLaunchFuncToLLVMCalls.cpp
index 035f197b1eac2..882d06f8e895c 100644
--- a/mlir/lib/Conversion/SPIRVToLLVM/ConvertLaunchFuncToLLVMCalls.cpp
+++ b/mlir/lib/Conversion/SPIRVToLLVM/ConvertLaunchFuncToLLVMCalls.cpp
@@ -267,9 +267,7 @@ class GPULaunchLowering : public ConvertOpToLLVMPattern<gpu::LaunchFuncOp> {
copyInfo.push_back(info);
}
// Create a call to the kernel and copy the data back.
- Operation *callOp = rewriter.replaceOpWithNewOp<LLVM::CallOp>(
- op, kernelFunc, ArrayRef<Value>());
- rewriter.setInsertionPointAfter(callOp);
+ rewriter.replaceOpWithNewOp<LLVM::CallOp>(op, kernelFunc, ArrayRef<Value>());
for (CopyInfo info : copyInfo)
copy(loc, info.src, info.dst, info.size, rewriter);
return success();
diff --git a/mlir/lib/Conversion/TosaToLinalg/TosaToLinalgNamed.cpp b/mlir/lib/Conversion/TosaToLinalg/TosaToLinalgNamed.cpp
index 6f288495516f7..0cb0badacf69d 100644
--- a/mlir/lib/Conversion/TosaToLinalg/TosaToLinalgNamed.cpp
+++ b/mlir/lib/Conversion/TosaToLinalg/TosaToLinalgNamed.cpp
@@ -802,7 +802,6 @@ class MaxPool2dConverter : public OpConversionPattern<tosa::MaxPool2dOp> {
ValueRange{paddedInput, fakeWindowDims}, filledEmptyTensor, strideAttr,
dilationAttr);
- rewriter.setInsertionPointAfter(op);
NanPropagationMode nanMode = op.getNanMode();
rewriter.replaceOp(op, resultOp);
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
These insertion points were added in llvm#146551 and llvm#146908 to support the one-shot dialect conversion driver which performs changes to the IR immediately and would otherwise invalidate previous insertion points. Since then, the insertion point has been made resilient against op erasure (llvm#146955) making the changes now redundant.
These insertion points were added in #146551 and #146908 to support the one-shot dialect conversion driver which performs changes to the IR immediately and would otherwise invalidate previous insertion points.
Since then, the insertion point has been made resilient against op erasure (#146955) making the changes now redundant.