[llvm] [llvm] Optimize misaligned accesses with early profitable splitting (PR #145168)
Acthinks Yang via llvm-commits
llvm-commits at lists.llvm.org
Sat Jun 21 19:51:32 PDT 2025
Acthinks wrote:
> My high level thought here is that we should be able to provide more information to SDAG when building. When we lower something like `load gep(p, const)` instead of creating MPI for `gep(p, const) + 0` with the load alignment, we should (in cases where this does not reduce known alignment) instead create MPI for `p + const` and the base alignment of `p`.
Thanks for the suggestion @nikic
This is a good idea, but I still have the following questions: 1. MMO BaseAlign corresponds to IR Value, and MPI Offset is a constant. In order to obtain the optimal align info, we may need a new base + offset and introduce a new IR Value, which seems inappropriate. 2. The split in two parts in the SDAG legalization stage needs to be adapted and modified, otherwise it will be difficult to optimize the load/store based on the maximum alignment.
https://github.com/llvm/llvm-project/pull/145168
More information about the llvm-commits
mailing list