[PATCH] [SimplifyCFG] Swap to using TargetTransformInfo for cost analysis.

Andrea Di Biagio Andrea_DiBiagio at sn.scee.net
Tue Feb 10 06:46:07 PST 2015


Hi James,

With this patch, intrinsic calls with no side effects are now considered to be viable candidates for speculation. Before your patch, SimplifyCFG would have conservatively returned a high cost for intrinsic calls. My question is: was this functional change intended? In general, I like the idea of flattening the CFG as long as CodeGenPrepare knows how to undo a speculation if it is not profitable for the target.

For example, your patch would allow SimplifyCFG to speculate calls to cttz/ctlz. This would be done without knowing if it is cheap for the target. This may cause performance degradation on x86 targets with no LZCNT/BMI. My opinion is that, if we want to speculate intrinsic calls, then we also have to teach CodeGenPrepare how to revert the change if it turns out that the speculation was not profitable (cheap) for the target. At the moment, CodeGenPrepare doesn't know how to undo a wrong speculation on cttz/ctlz calls (I guess, we can teach CodeGenPrepare how to do it in a separate patch..).

Have you collected some performance numbers after this change?

Thanks,
Andrea


REPOSITORY
  rL LLVM

http://reviews.llvm.org/D7506

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list