This patch adds support for applying a relation on domain/range of a relation.

# Details

# Diff Detail

- Repository
- rG LLVM Github Monorepo

### Event Timeline

I think we should add a compose member function, it being a natural opreation on relations. You can move applyRange's documentation to compose and just mention in applyRange that it's the same as compose, but provided for uniformity with applyDomain.

mlir/include/mlir/Analysis/Presburger/IntegerRelation.h | ||
---|---|---|

534–536 | It might be simpler to just say that this returns | |

541–543 | You can just write that it returns |

mlir/include/mlir/Analysis/Presburger/IntegerRelation.h | ||
---|---|---|

534–536 | I feel the |

I think you can remove the backslashes on exists and in, unless doxygen can somehow render them, it seems unnecessary.

mlir/include/mlir/Analysis/Presburger/IntegerRelation.h | ||
---|---|---|

534–536 | R2.inverse().compose() is in fact a proper mathematical description. For me personally, a concrete example was more useful to understand what the point of this is, and then for a formal specification the inverse compose thing will show what the general version of that example is. |

mlir/include/mlir/Analysis/Presburger/IntegerRelation.h | ||
---|---|---|

533 | What do you mean by | |

535 | ||

536 | ||

537 | ||

542 | ||

543 | read the original as (i->j), k at first | |

545 | I would prefer this example, it has less "noise" and also shows a little bit happens when the other variables depend on the projected variable R1 : i -> j : (0 <= i < 2, j = i) R2: i -> k : (k = i floordiv 2) R3: k -> j : (0 <= k < 1, 2k <= j <= 2k + 1) R1 = {(0, 0), (1, 1)}. R2 maps both 0 and 1 to 0. So R3 = {(0, 0), (0, 1)} | |

550–557 | Not sure if an example is needed for composition but you can do e.g. | |

552 | ||

557 | ||

mlir/lib/Analysis/Presburger/IntegerRelation.cpp | ||

2148–2156 |