[PATCH] R600: Implement a few simple TTI queries.
Tom Stellard
tom at stellard.net
Fri Jul 18 13:02:23 PDT 2014
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
More information about the llvm-commits
mailing list