This is an archive of the discontinued LLVM Phabricator instance.

Make bitcast, extractelement, and insertelement considered cheap for speculation in SimplifyCFG.
ClosedPublic

Authored by arsenm on Nov 18 2013, 7:00 PM.

Details

Reviewers
nadav
arsenm
Summary

This help fold more branches into selects.
On R600, vectors are cheap and anything that helps
remove branches is very good.

I don't know why this doesn't use the TTI for this cost
calculation or if it should.

Diff Detail

Event Timeline

nadav added a comment.Nov 19 2013, 8:43 AM

Hi Matt,

I don’t know this code very well but your patch looks okay to me. Please benchmark the LLVM test suite and make sure that this change does not introduce new regressions.

SimplifyCFG should not use TTI because this pass is executed very early in the optimization pipe. TTI should only be used by “lowering” transformations in the late stages of the optimization pipe.

Thanks,
Nadav

arsenm accepted this revision.May 30 2014, 11:42 AM
arsenm added a reviewer: arsenm.

r209914

This revision is now accepted and ready to land.May 30 2014, 11:42 AM
arsenm closed this revision.May 30 2014, 11:42 AM