[PATCH] D48826: [AMDGPU] Add support for TFE/LWE in image intrinsics
David Stuttard via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 11 10:38:05 PDT 2018
dstuttard marked 14 inline comments as done.
dstuttard added inline comments.
================
Comment at: lib/Target/AMDGPU/SIInstrInfo.cpp:2793-2798
+ if ((LWE && LWE->getImm()) || (TFE && TFE->getImm()))
+ RegCount += IsD16 ? 2 : 1;
+
+ // Adjust for D16 variants
+ bool Packed = !ST.hasUnpackedD16VMem();
+ if (IsD16 && Packed) RegCount = (RegCount + 1) >> 1;
----------------
nhaehnle wrote:
> It's a minor thing, but I think it would be easier to follow to first divide the RegCount for D16 based on `(D16 && D16->getImm() && !ST.hasUnpackedD16VMem())`, and then increment that for LWE || TFE afterwards.
Agreed - not really sure how I arrived at the original non-obvious way. Suspect it evolved.
Repository:
rL LLVM
https://reviews.llvm.org/D48826
More information about the llvm-commits
mailing list