HomePhabricator

[AMDGPU] Avoid splitting FLAT offsets in unsafe ways

Authored by foad on Jul 8 2020, 6:13 AM.

Description

[AMDGPU] Avoid splitting FLAT offsets in unsafe ways

As explained in the comment:

For a FLAT instruction the hardware decides whether to access
global/scratch/shared memory based on the high bits of vaddr,
ignoring the offset field, so we have to ensure that when we add
remainder to vaddr it still points into the same underlying object.
The easiest way to do that is to make sure that we split the offset
into two pieces that are both >= 0 or both <= 0.

In particular FLAT (as opposed to SCRATCH and GLOBAL) instructions have
an unsigned immediate offset field, so we can't use it to help split a
negative offset.

Differential Revision: https://reviews.llvm.org/D83394

Details

Committed
foadJul 17 2020, 3:44 AM
Differential Revision
D83394: [AMDGPU] Avoid splitting FLAT offsets in unsafe ways
Parents
rG1cfb207737cc: [TableGen] Report an error instead of asserting
Branches
Unknown
Tags
Unknown