[all-commits] [llvm/llvm-project] 2034f2: [mlir][intrange] Use `nsw`, `nuw` flags in inferenc...

Felix Schneider via All-commits all-commits at lists.llvm.org
Wed May 22 00:02:54 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2034f2fc8729bd4645ef7caa3c5c6efa284d2d3f
      https://github.com/llvm/llvm-project/commit/2034f2fc8729bd4645ef7caa3c5c6efa284d2d3f
  Author: Felix Schneider <fx.schn at gmail.com>
  Date:   2024-05-22 (Wed, 22 May 2024)

  Changed paths:
    M mlir/include/mlir/Interfaces/Utils/InferIntRangeCommon.h
    M mlir/lib/Dialect/Arith/IR/InferIntRangeInterfaceImpls.cpp
    M mlir/lib/Dialect/Index/IR/InferIntRangeInterfaceImpls.cpp
    M mlir/lib/Interfaces/Utils/InferIntRangeCommon.cpp
    M mlir/test/Dialect/Arith/int-range-interface.mlir
    M mlir/test/Dialect/Arith/int-range-opts.mlir

  Log Message:
  -----------
  [mlir][intrange] Use `nsw`,`nuw` flags in inference (#92642)

This patch includes the "no signed wrap" and "no unsigned wrap" flags,
which can be used to annotate some Ops in the `arith` dialect and also
in LLVMIR, in the integer range inference.

The general approach is to use saturating arithmetic operations to infer
bounds which are assumed to not wrap and use overflowing arithmetic
operations in the normal case. If overflow is detected in the normal
case,
special handling makes sure that we don't underestimate the result
range.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list