Skip to content

[mlir][IntegerRangeAnalysis] Teach the analysis to infer overflow flags #145092

@krzysz00

Description

@krzysz00
Contributor

When analyzing operations that might exhibit overflow, we can often determine whether or not such an overflow could occur, which is data that can be expressed using the nuw and nsw overflow flags. This is information that can be annotated onto operations and might be usable to make some bits of the analysis more precise.

So the ConstantIntRanges struct could grow a std::optionalarith::OverflowFlags field to mark whether the associated operation could've overflowed while computing that result.

Activity

llvmbot

llvmbot commented on Jun 20, 2025

@llvmbot
Member

@llvm/issue-subscribers-mlir

Author: Krzysztof Drewniak (krzysz00)

When analyzing operations that might exhibit overflow, we can often determine whether or not such an overflow could occur, which is data that can be expressed using the nuw and nsw overflow flags. This is information that can be annotated onto operations and might be usable to make some bits of the analysis more precise.

So the ConstantIntRanges struct could grow a std::optional<arith::OverflowFlags> field to mark whether the associated operation could've overflowed while computing that result.

badumbatish

badumbatish commented on Jul 10, 2025

@badumbatish
Contributor

is this an issue for beginner?

krzysz00

krzysz00 commented on Aug 13, 2025

@krzysz00
ContributorAuthor

@badumbatish It might take some time to get familiar with IntRangeOptimizations.cpp and all the infrastructure that's going on in there. So this isn't a trivial issue, but it would make a good way to get familiar with the code.

(Sorry, didn't see your comment until now)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @krzysz00@badumbatish@llvmbot

        Issue actions

          [mlir][IntegerRangeAnalysis] Teach the analysis to infer overflow flags · Issue #145092 · llvm/llvm-project