Improved effectively for a constant offset GEP if the scalable index is same.
getelementptr <vscale x 4 x i32>, ptr %p, i64 1, i64 %i getelementptr <vscale x 4 x i32>, ptr %p, i64 1, i64 %j
Paths
| Differential D133844
[AA] Improve the BasicAA analysis capability base on GEP AbandonedPublic Authored by Allen on Sep 14 2022, 1:58 AM.
Details
Diff Detail
Unit TestsFailed
Event TimelineComment Actions If you want to support this, it must be part of GEP decomposition. If you are only interested in constants for the vscale index, then it's probably possible to support this with relatively low effort by using a VariableGEPIndex with a vscale constant expression. That should allow all the existing modelling to handle it (possibly including range analysis based on vscale_range attributes). If you are interested in variables for the vscale index, then this won't work, and it would be necessary to add first class vscale support to VariableGEPIndex (i.e. a separate bool, which all code working on decomposed GEPs has to handle in the appropriate way). This revision now requires changes to proceed.Sep 14 2022, 3:50 AM Comment Actions
Thanks for your suggestion, Firstly I hope to address the constants vscale index only. Comment Actions I don't get how this patch is supposed to work. It seems to create a VariableGEPIndex -- but I don't see the vscale factor represented anywhere in there? Worth noting that https://reviews.llvm.org/D134648 plans to make vscale non-constant, so making the use of vscale constant expressions is likely not going to be possible going forward... Comment Actions
Thank @nikic for your guidance. It looks a little more complicated than I expected. Yes, this need more work as the vscale is non-constant in the whole project.
Revision Contents
Diff 463463 llvm/lib/Analysis/BasicAliasAnalysis.cpp
llvm/test/Analysis/BasicAA/vscale.ll
llvm/test/Transforms/GVN/vscale.ll
|