iree icon indicating copy to clipboard operation
iree copied to clipboard

Add a pass for simplifying numeric/index arithmetic.

Open stellaraccident opened this issue 4 months ago • 2 comments

The new iree-util-simplify-index-arithmetic pass uses the new range annotations to do range analysis and simplification.

Currently it is looping to:

  • Rewrite redundant comparison ops to constant true/false.
  • Performing arith canonicalization plus grab bag of other simplification patterns.
  • Keep going until no analysis driven redundancies are eliminated.

The existing DFX elements which were based on C++ int types were insufficient. Given that MLIR integers/indexes are signless, we have to be precise and do detailed emulation with APInt. New elements were added based on APInt. Also some integer constant PVS support was pulled into the main analysis directory from a pass that had it locally.

Ultimately, this analysis will become its own standalone entity and used from multiple places which need to query range and divisibility.

stellaraccident avatar Oct 05 '24 04:10 stellaraccident