[Mlir-commits] [mlir] [mlir] Add `arith-int-range-narrowing` pass (PR #112404)

Ivan Butygin llvmlistbot at llvm.org
Wed Oct 16 05:18:22 PDT 2024


Hardcode84 wrote:

> > We already have the arith-int-narrowing pass, but it mostly only doing local analysis, while IntegerRangeAnalysis analyses entire program. They ideally should be unified, but it's a task for the future.
> 
> AFAIK, `arith-int-narrowing` doesn't have any use(r)s and could be dropped. I think it would be better to replace it with the new implementation from this PR.

I've added some tests from the old `arith-int-narrowing` pass, but it cannot be replaced 1-to-1 yet, vector support need more work (https://github.com/llvm/llvm-project/pull/112292) and for some cases this new pass chooses more conservative truncation.

I would prefer to merge this one in its current state and improve incrementally.

https://github.com/llvm/llvm-project/pull/112404


More information about the Mlir-commits mailing list