diff options
author | Fabian Ritter <fabian.ritter@amd.com> | 2025-08-12 10:14:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-08-12 10:14:20 +0200 |
commit | e9ece175f9dad9b38492bab3b90743f9406d08e8 (patch) | |
tree | feebbc401628440267fa2c066a6c57f261cac80b /llvm/lib/Transforms/Utils/LoopUtils.cpp | |
parent | 66aa46da6c2f18d8e7493bc2105abef0af4a7b98 (diff) | |
download | llvm-e9ece175f9dad9b38492bab3b90743f9406d08e8.zip llvm-e9ece175f9dad9b38492bab3b90743f9406d08e8.tar.gz llvm-e9ece175f9dad9b38492bab3b90743f9406d08e8.tar.bz2 |
[AMDGPU][GISel] Only fold flat offsets if they are inbounds (#153001)
For flat memory instructions where the address is supplied as a base address
register with an immediate offset, the memory aperture test ignores the
immediate offset. Currently, ISel does not respect that, which leads to
miscompilations where valid input programs crash when the address computation
relies on the immediate offset to get the base address in the proper memory
aperture. Global or scratch instructions are not affected.
This patch only selects flat instructions with immediate offsets from address
computations with the inbounds flag: If the address computation does not leave
the bounds of the allocated object, it cannot leave the bounds of the memory
aperture and is therefore safe to handle with an immediate offset.
Relevant tests are in fold-gep-offset.ll.
Analogous to #132353 for SDAG (which is not yet in a mergeable state, its
progress is currently blocked by #146076).
Fixes SWDEV-516125 for GISel.
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopUtils.cpp')
0 files changed, 0 insertions, 0 deletions