[llvm-dev] getTypeLegalizationCost()

Hal Finkel via llvm-dev llvm-dev at lists.llvm.org
Wed Feb 1 05:16:15 PST 2017


On 02/01/2017 02:21 AM, Jonas Paulsson via llvm-dev wrote:
> Hi,
>
> I noticed that
>
> BasicTTIImplBase::getArithmeticInstrCost() returned too high values 
> for some vector instructions.
>
> This happened regardless of if the vector type was to later be 
> widened, or if it was legal.
>
> In this method this call is made:
>
> LT = TLI->getTypeLegalizationCost(DL, Ty);
>
> This doesn't return any sensible values, because 
> computeRegisterProperties() has not been called, so all vector types 
> get split. It returns {2, i32} for v2i8, for example. I think it 
> should have returned {1, v16i8}.
>
> This seemed a bit odd to me, so it would be interesting to hear any 
> opinions on this regarding if this is something to be fixed perhaps. 
> It should be worth to know the legal vector types during calls to 
> TargetTransformInfo... Or is it something that is missing in the 
> backend (SystemZ)?

Sounds like something needs to be fixed. I don't understand the problem, 
however, because computeRegisterProperties is generally called in the 
*TargetLowering constructor (the same place that all of the other 
legalization information is set). It looks like your calling it early in 
the constructor in SystemZ (like on AArch64), whereas it gets called 
late in the constructor on PowerPC and x86. Is that causing an issue?

  -Hal

>
> /Jonas
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

-- 
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory



More information about the llvm-dev mailing list