[llvm-dev] Bug in ComputeSpeculationCost in SimplifyCFG?

Gautam Chakrabarti via llvm-dev llvm-dev at lists.llvm.org
Mon Sep 10 16:02:42 PDT 2018


I am trying to understand the cost returned by ComputeSpeculationCost function in SimplifyCFG. It appears even when it returns TCC_Expensive (which means "prohibitively expensive"), the caller may proceed with a transform, because TCC_Expensive is not really a high cost, but its value is 4.

For example when DominatesMergePoint calls this, it may still move ahead because TCC_Expensive cost may be less than CostRemaining. Looking thru the history, it appears this behavior changed with r228826 (http://llvm.org/viewvc/llvm-project?view=revision&revision=228826), when this API was moved to use TargetTransformInfo for cost analysis instead of the hard-coded cost estimates.

Is this a bug?

Thanks,
Gautam


-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information.  Any unauthorized review, use, disclosure or distribution
is prohibited.  If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180910/862cda60/attachment.html>


More information about the llvm-dev mailing list