[PATCH] D77082: [AMDGPU] Handle SMRD signed offset immediate
Matt Arsenault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 1 12:04:50 PDT 2020
arsenm added inline comments.
================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp:1798
- if (Gen == AMDGPUSubtarget::SEA_ISLANDS) {
- EncodedOffset =
- AMDGPU::getSMRDEncodedLiteralOffset32(*Subtarget, ByteOffset);
- if (EncodedOffset) {
- Offset = CurDAG->getTargetConstant(*EncodedOffset, SL, MVT::i32);
- return true;
- }
+ if (!CurDAG->SignBitIsZero(ByteOffsetNode))
+ return false;
----------------
kerbowa wrote:
> arsenm wrote:
> > The GlobalISel patch seems to be missing this part?
> I think it's handled here?
>
> AMDGPUInstructionSelector.cpp:2876
> if (!GEPInfo.Imm || **GEPInfo.Imm < 0** || !isUInt<32>(GEPInfo.Imm))
OK, the use of SignBitIsZero is confusing when it's a known constant. This should also directly check the immediate value
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D77082/new/
https://reviews.llvm.org/D77082
More information about the llvm-commits
mailing list