[PATCH] R600: Implement a few simple TTI queries.
Matt Arsenault
Matthew.Arsenault at amd.com
Fri Jul 18 13:14:47 PDT 2014
On 07/18/2014 01:02 PM, Tom Stellard wrote:
> On Fri, Jul 18, 2014 at 07:05:23PM +0000, Matt Arsenault wrote:
>> I'm not sure if these have any effect right now.
>>
>> http://reviews.llvm.org/D4586
>>
>> Files:
>> lib/Target/R600/AMDGPUTargetTransformInfo.cpp
>>
>> Index: lib/Target/R600/AMDGPUTargetTransformInfo.cpp
>> ===================================================================
>> --- lib/Target/R600/AMDGPUTargetTransformInfo.cpp
>> +++ lib/Target/R600/AMDGPUTargetTransformInfo.cpp
>> @@ -91,6 +91,10 @@
>>
>> PopcntSupportKind getPopcntSupport(unsigned IntTyWidthInBit) const override;
>>
>> + unsigned getNumberOfRegisters(bool Vector) const override;
>> + unsigned getRegisterBitWidth(bool Vector) const override;
>> + unsigned getMaximumUnrollFactor() const override;
>> +
>> /// @}
>> };
>>
>> @@ -162,3 +166,23 @@
>> assert(isPowerOf2_32(TyWidth) && "Ty width must be power of 2");
>> return ST->hasBCNT(TyWidth) ? PSK_FastHardware : PSK_Software;
>> }
>> +
>> +unsigned AMDGPUTTI::getNumberOfRegisters(bool Vec) const {
>> + if (Vec)
>> + return 0;
>> +
>> + // Number of VGPRs on SI.
>> + if (ST->getGeneration() >= AMDGPUSubtarget::SOUTHERN_ISLANDS)
>> + return 256;
>> +
>> + return 4 * 128; // XXX - 4 channels. Should these count as vector instead?
>> +}
>> +
>> +unsigned AMDGPUTTI::getRegisterBitWidth(bool) const {
>> + return 32;
>> +}
>> +
>> +unsigned AMDGPUTTI::getMaximumUnrollFactor() const {
>> + // Semi-arbitrary large amount.
>> + return 64;
>> +}
> How does this interact with getUnrollingPreference() ?
>
> -Tom
Right now it seems like it's only used to clamp the unroll factor in the
loop vectorizer, which looks like it doesn't use getUnrollingPreference
More information about the llvm-commits
mailing list