-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Revert "[mlir] IntegerRangeAnalysis: don't loop over splat..." #115388
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
)" This reverts commit 3deee23.
@llvm/pr-subscribers-mlir-arith @llvm/pr-subscribers-mlir Author: Ian Wood (IanWood1) ChangesReverts llvm/llvm-project#115229 Full diff: https://github.com/llvm/llvm-project/pull/115388.diff 1 Files Affected:
diff --git a/mlir/lib/Dialect/Arith/IR/InferIntRangeInterfaceImpls.cpp b/mlir/lib/Dialect/Arith/IR/InferIntRangeInterfaceImpls.cpp
index 59c9759d35393f..8682294c8a6972 100644
--- a/mlir/lib/Dialect/Arith/IR/InferIntRangeInterfaceImpls.cpp
+++ b/mlir/lib/Dialect/Arith/IR/InferIntRangeInterfaceImpls.cpp
@@ -40,11 +40,6 @@ void arith::ConstantOp::inferResultRanges(ArrayRef<ConstantIntRanges> argRanges,
setResultRange(getResult(), ConstantIntRanges::constant(value));
return;
}
- if (auto splatAttr = llvm::dyn_cast_or_null<SplatElementsAttr>(getValue())) {
- setResultRange(getResult(), ConstantIntRanges::constant(
- splatAttr.getSplatValue<APInt>()));
- return;
- }
if (auto arrayCstAttr =
llvm::dyn_cast_or_null<DenseIntElementsAttr>(getValue())) {
std::optional<ConstantIntRanges> result;
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add reason for revert (you could add link to break in IREE as well)
Reland #115229 which was reverted by #115388 because it was hitting an assertion in IREE. From the original change: If the `DenseIntElementsAttr` is a splat value, there is no need to loop over the entire attr. Instead, just update with the splat value. The problem with the original implementation is that `SplatElementsAttr` might be an attr of non `APInt` (e.g. float) elements. Instead, check if `DenseIntElementsAttr` is splat and use the splat value. Added a test to ensure there's no crash when handling float attrs.
…115388) Hitting assertion in IREE https://github.com/iree-org/iree/actions/runs/11732283897/job/32684201665?pr=19066 ``` iree-compile: /__w/iree/iree/third_party/llvm-project/mlir/include/mlir/IR/BuiltinAttributes.h:423: auto mlir::DenseElementsAttr::getValues() const [T = llvm::APInt]: Assertion `succeeded(range) && "element type cannot be iterated"' failed. ``` Reverts llvm#115229
…5399) Reland llvm#115229 which was reverted by llvm#115388 because it was hitting an assertion in IREE. From the original change: If the `DenseIntElementsAttr` is a splat value, there is no need to loop over the entire attr. Instead, just update with the splat value. The problem with the original implementation is that `SplatElementsAttr` might be an attr of non `APInt` (e.g. float) elements. Instead, check if `DenseIntElementsAttr` is splat and use the splat value. Added a test to ensure there's no crash when handling float attrs.
Hitting assertion in IREE https://github.com/iree-org/iree/actions/runs/11732283897/job/32684201665?pr=19066
Reverts #115229