[llvm] [polly] [delinearize] Extract array dimensions from alloca and global declarations (PR #156342)
Ryotaro Kasuga via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 11 06:36:01 PDT 2025
kasuga-fj wrote:
> > It would be best to consult an LLVM IR expert. I'm not an expert, but from my perspective, using the type arguments of allocas and/or global variables doesn't seem to significantly different from driving heuristics based on those of GEPs.
>
> I guess Sebastian's [discourse message](https://discourse.llvm.org/t/rfc-de-type-ification-of-llvm-ir-why/88257) is a reply to this. We are not allowed to look at GEP->Type, but this information has to come from somewhere and the question is where? This information is present at statically declared arrays, and I don't see it disappearing from there because it has to be there, I think. For alloca, @nikic is suggesting that `alloca { i32, i64 }` might be simplified to `alloca 16, align 8` in his EuroLLVM [presentation](https://www.youtube.com/watch?v=gIQEZ3QJz1w) (around minute 5 in the video).
Watching the video, it sounds like it's clearly stated that using the type in `alloca` is permitted only for getting its size and alignment (right after that, it's mentioned that global variables are basically the same).
https://github.com/llvm/llvm-project/pull/156342
More information about the llvm-commits
mailing list