[PATCH] D17288: [CodeGenPrepare] Do select to branch transform when cmp's operand is expensive.

Junmo Park via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 29 18:37:10 PST 2016


flyingforyou added a comment.

Thanks for comment, Zia.

> This may happen to be a correct general statement to make today, but not one that is guaranteed to hold for future architectures. In my opinion, it's just too low level of a heuristic to make here.


I agree with your opinion about future architecture might have powerful divider which doesn't need this heuristic. But when they come, we can make this opt turn off easily by setting `PredictableSelectIsExpensive` false or passing more information to `isFormingBranchFromSelectProfitable` something like `MCSchedModel` for changing heuristic.

> It's also easier to hold on to selects and break them up later than to break them up early and change our minds and hope to reassemble them.


Yes. you're right. But it's easier to make branch at this level than later.

Junmo.


http://reviews.llvm.org/D17288





More information about the llvm-commits mailing list