[PATCH] D76434: [SCEV] Query for immediate cost in Expander

Sam Parker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 20 01:35:40 PDT 2020


samparker added a subscriber: spatel.
samparker added a comment.
Herald added a reviewer: aartbik.

Thanks for taking a look.

> This is rather pessimistic. If we really want to do this, we need to use TargetTransformInfo::getIntImmCostInst().

This sounds good and what I was also considering.

> What cost does that model?

I was under the impression that throughput/codesize costs for immediates would be highly correlated, where a 'high cost' constant would introduce instruction(s) to generate it, increasing code size and reducing throughput. As @spatel said in D76124 <https://reviews.llvm.org/D76124>, the lines have become blurred but we should be modelling at least //something// here.

> I wonder if D73501 <https://reviews.llvm.org/D73501> simply is counter-productive then.

I would be lying if I said that the patch didn't cause a whole world of pain :) But I would like to try to resolve this, if we can, by modelling costs better. The SCEV changes may have just broken our we do unrolling for our little microcontrollers, so I'll be looking at ARM TTI too.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76434/new/

https://reviews.llvm.org/D76434





More information about the llvm-commits mailing list