Since revisions 228829 (code review: D7554) and 228923 (code review: D7554), SimplifyCFG knows how to speculate calls to intrinsic cttz/ctlz that are 'cheap' for the target. The logic in CodeGenPrepare (originally added at revision 224899) is now redundant and can therefore be removed.
This patch removes the duplicated logic in CodeGenPrepare and converts all the existing target specific tests for cttz/ctlz into SimplifyCFG tests. Note that X86 tests were already added by revisions 228829 and 228923. No functional change intended.
Please let me know if ok to submit.
Thanks,
Andrea