[PATCH] D83394: [AMDGPU] Avoid splitting FLAT offsets in unsafe ways
Jay Foad via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 16 00:30:58 PDT 2020
foad marked an inline comment as done.
foad added inline comments.
================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp:1705
+ // Use signed division by a power of two to truncate towards 0.
+ int64_t D = 1LL << (NumBits - 1);
+ RemainderOffset = (static_cast<int64_t>(COffsetVal) / D) * D;
----------------
arsenm wrote:
> maskTrailingZeros
That would round towards -infinity. As the comment says, we're deliberately rounding towards zero instead.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D83394/new/
https://reviews.llvm.org/D83394
More information about the llvm-commits
mailing list