[PATCH] D144624: [SCEV] Make scalable size representation more explicit

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 23 06:14:53 PST 2023


nikic added a comment.

In D144624#4147219 <https://reviews.llvm.org/D144624#4147219>, @paulwalker-arm wrote:

> I realise this patch is partly refactoring but it does seem to increase the value of scalable vector GEP ConstantExprs, which is inconsistent to your view on D134648 <https://reviews.llvm.org/D134648>?

I don't think this patch changes the situation either way: It replaces on constexpr vscale GEP with another (more canonical) one.

> Is it possible for SCEV to have its own representation of `vscale` that is independent to the Constant class hierarchy?

Yes, it's possible to add a first class `vscale` SCEV expression. It's not even particularly hard, just takes a bit of boilerplate to adjust all the SCEV type `switch`es.

Incidentally, I just put up https://discourse.llvm.org/t/rfc-replacing-getelementptr-with-ptradd/68699, which will be removing the vscale constant expressions as a side effect, so I guess we'll have to indeed do that SCEV change at some point. (Unless we can avoid the need entirely, I think one use in LAA is the only bit that that really needs vscale SCEV that is not present in IR).


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D144624/new/

https://reviews.llvm.org/D144624



More information about the llvm-commits mailing list