[all-commits] [llvm/llvm-project] 8782ee: [mlir][intrange] Represent bounds of `ReflectBound...

Felix Schneider via All-commits all-commits at lists.llvm.org
Sun May 19 11:28:58 PDT 2024


  Branch: refs/heads/users/ubfx/intrange-infer-nsw-nuw
  Home:   https://github.com/llvm/llvm-project
  Commit: 8782eeb6bf596905e0703ffc4e7ebb634547178a
      https://github.com/llvm/llvm-project/commit/8782eeb6bf596905e0703ffc4e7ebb634547178a
  Author: Felix Schneider <fx.schn at gmail.com>
  Date:   2024-05-19 (Sun, 19 May 2024)

  Changed paths:
    M mlir/test/Dialect/Arith/int-range-interface.mlir
    M mlir/test/Dialect/Arith/int-range-opts.mlir
    M mlir/test/lib/Dialect/Test/TestOpDefs.cpp

  Log Message:
  -----------
  [mlir][intrange] Represent bounds of `ReflectBoundsOp` as `si`/`ui`

This patch adapts the `test.reflect_bounds` test Op to use explicitly
signed and unsigned representation for signed and unsigned bounds of
`IntegerType`s.

This is mostly a cosmetic change as the internal representation of the
ranges is unchanged. However, it improves readability of tests.

Example:
```mlir
// old:
test.reflect_bounds {smax = 127 : i8, smin = -128 : i8, umax = -56 : i8, umin = 100 : i8}
// new:
test.reflect_bounds {smax = 127 : si8, smin = -128 : si8, umax = 200 : ui8, umin = 100 : ui8}
```


  Commit: 1908bae9f24fa4c6763a2175adcbbd1cc3978c07
      https://github.com/llvm/llvm-project/commit/1908bae9f24fa4c6763a2175adcbbd1cc3978c07
  Author: Felix Schneider <fx.schn at gmail.com>
  Date:   2024-05-19 (Sun, 19 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

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.


  Commit: 93b7c2b473e62185e9b90274bb47091221644967
      https://github.com/llvm/llvm-project/commit/93b7c2b473e62185e9b90274bb47091221644967
  Author: Felix Schneider <fx.schn at gmail.com>
  Date:   2024-05-19 (Sun, 19 May 2024)

  Changed paths:
    M mlir/lib/Dialect/Arith/IR/InferIntRangeInterfaceImpls.cpp
    M mlir/lib/Dialect/Index/IR/InferIntRangeInterfaceImpls.cpp

  Log Message:
  -----------
  address review comments


  Commit: c60ef799184638ccb062af1f79d273a9eace838e
      https://github.com/llvm/llvm-project/commit/c60ef799184638ccb062af1f79d273a9eace838e
  Author: Felix Schneider <fx.schn at gmail.com>
  Date:   2024-05-19 (Sun, 19 May 2024)

  Changed paths:
    M mlir/lib/Interfaces/Utils/InferIntRangeCommon.cpp

  Log Message:
  -----------
  fix clang build


  Commit: 309253496bf442d3ea531942ce5a06c7ad3f1930
      https://github.com/llvm/llvm-project/commit/309253496bf442d3ea531942ce5a06c7ad3f1930
  Author: Felix Schneider <fx.schn at gmail.com>
  Date:   2024-05-19 (Sun, 19 May 2024)

  Changed paths:
    M mlir/lib/Interfaces/Utils/InferIntRangeCommon.cpp

  Log Message:
  -----------
  Fix inference and formatting


Compare: https://github.com/llvm/llvm-project/compare/f1e29ea24200...309253496bf4

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