[llvm-commits] More aggressive speculation in SimplifyCFG

Evan Cheng evan.cheng at apple.com
Tue Jan 22 20:28:22 PST 2013


On Jan 22, 2013, at 4:20 PM, Krzysztof Parzyszek <kparzysz at codeaurora.org> wrote:

> On 1/22/2013 5:55 PM, Evan Cheng wrote:
>> 
>> What are you trying to accomplish with this change? It's hard to reason about the cost effectiveness of select formation in LLVM IR. Have you looked at the EarlyIfConversion pass?
> 
> This was written almost a year ago.  I don't know if the early-if-conversion existed then, and if it did, then I was unaware of it.  This was mainly motivated by source code analysis in the benchmarks that we were working on at the time.  The main thing was to linearize the control flow, specifically to eliminate small blocks, even if it comes at the price of speculatively executing some code.
> Cost effectiveness is definitely tricky---I don't know how this could be made universally applicable to every target.
> 
> The reason I'm submitting it is basically that we have it, it works for us, and maybe someone would find it useful.  I haven't analyzed the early if conversion, so I'm not sure how this code compares to it.

The early if-converter is written exactly for this. It uses MachineTraceMetrics analysis to estimate CPU resource usage to make the decision to speculate and form conditional moves. It subsumes the functionality of your patch and has much more sophisticated analysis behind it. I don't think it makes sense to add the aggressive speculation code to SimplifyCFG.

Evan

> 
> -Krzysztof
> 
> -- 
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation




More information about the llvm-commits mailing list