[PATCH] D31175: Improve TargetTransformInfo::getCFInstrCost()

Matthew Simpson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 4 06:55:35 PDT 2017


mssimpso added a comment.

In https://reviews.llvm.org/D31175#717811, @jonpa wrote:

> > I'm fine with that as long as you add an appropriate comment. I don't want to hold up this patch for something that's not going make a difference.
>
> Was this what you had in mind? Feel free to modify.


I'm fine with that.

> 
> 
>   Perhaps more importantly, I see now that test/Transforms/LoopVectorize/AArch64/aarch64-predication.ll fails, because the loop does no longer get vectorized 

This is a fragile test case that we should eventually fix. The cost of 3 for the branch would make sense if the condition were loop-varying, but in this case, the extracts will be removed by InstCombine, so the branch cost should be 0 (no scalarization overhead). I think we either want to modify getScalarizationOverhead to only compute a cost for loop-varying values or to check that the condition is loop-varying before calling getScalarizationOverhead.


https://reviews.llvm.org/D31175





More information about the llvm-commits mailing list