Skip to content
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

[mlir][Interfaces][NFC] ValueBoundsConstraintSet: Delete dead code #86098

Merged

Conversation

matthias-springer
Copy link
Member

There is an assertion that the stop condition is not satisfied for the the starting point at the beginning of computeBound. Therefore, that case does not have to be handled later on in that function.

@llvmbot
Copy link
Collaborator

llvmbot commented Mar 21, 2024

@llvm/pr-subscribers-mlir

Author: Matthias Springer (matthias-springer)

Changes

There is an assertion that the stop condition is not satisfied for the the starting point at the beginning of computeBound. Therefore, that case does not have to be handled later on in that function.


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

1 Files Affected:

  • (modified) mlir/lib/Interfaces/ValueBoundsOpInterface.cpp (-12)
diff --git a/mlir/lib/Interfaces/ValueBoundsOpInterface.cpp b/mlir/lib/Interfaces/ValueBoundsOpInterface.cpp
index 02af3a83166dfb..f2f732f3a21d25 100644
--- a/mlir/lib/Interfaces/ValueBoundsOpInterface.cpp
+++ b/mlir/lib/Interfaces/ValueBoundsOpInterface.cpp
@@ -321,18 +321,6 @@ LogicalResult ValueBoundsConstraintSet::computeBound(
   Builder b(value.getContext());
   mapOperands.clear();
 
-  if (stopCondition(value, dim)) {
-    // Special case: If the stop condition is satisfied for the input
-    // value/dimension, directly return it.
-    mapOperands.push_back(std::make_pair(value, dim));
-    AffineExpr bound = b.getAffineDimExpr(0);
-    if (type == BoundType::UB)
-      bound = bound + ubAdjustment;
-    resultMap = AffineMap::get(/*dimCount=*/1, /*symbolCount=*/0,
-                               b.getAffineDimExpr(0));
-    return success();
-  }
-
   // Process the backward slice of `value` (i.e., reverse use-def chain) until
   // `stopCondition` is met.
   ValueDim valueDim = std::make_pair(value, dim.value_or(kIndexValue));

Copy link
Member

@MacDue MacDue left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@matthias-springer matthias-springer force-pushed the users/matthias-springer/value_bounds_const_columns branch from 13c9d7f to 6bbcba6 Compare March 23, 2024 05:54
@matthias-springer matthias-springer force-pushed the users/matthias-springer/value_bounds_dead_code branch from 12e7e88 to f944279 Compare March 23, 2024 05:56
@matthias-springer matthias-springer force-pushed the users/matthias-springer/value_bounds_const_columns branch from 6bbcba6 to d53abc4 Compare March 25, 2024 09:22
@matthias-springer matthias-springer changed the base branch from users/matthias-springer/value_bounds_const_columns to main April 4, 2024 07:55
@matthias-springer matthias-springer force-pushed the users/matthias-springer/value_bounds_dead_code branch from f944279 to 94baa23 Compare April 4, 2024 07:56
@matthias-springer matthias-springer merged commit d542cb3 into main Apr 4, 2024
3 of 4 checks passed
@matthias-springer matthias-springer deleted the users/matthias-springer/value_bounds_dead_code branch April 4, 2024 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants