[llvm-dev] getTypeLegalizationCost()

Jonas Paulsson via llvm-dev llvm-dev at lists.llvm.org
Wed Feb 1 00:21:11 PST 2017


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)?

/Jonas



More information about the llvm-dev mailing list