[PATCH] D40892: Add early out to O(n^2) switch analysis in switch-to-select conversion

Marcello Maggioni via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 11 09:29:09 PST 2017


kariddi requested changes to this revision.
kariddi added a reviewer: kariddi.
kariddi added a comment.

Hi Andrew, your change modifies the semantics of the function, in the sense that it becomes specialized into just collecting the data to perform "ConvertTwoCaseSwitch()" and it will not be possible to use it for other potential optimization that require the same data.

Maybe we could add configurable cut-off points instead (in the form of default parameters) that default to what  "ConvertTwoCaseSwitch()" requires for now (that would be 2 and 2)

Otherwise if we think that this function is not gonna be useful for any other optimization we could rename it and maybe it could even be simplified and the comment before it then should be updated to clarify the new use of it.


Repository:
  rL LLVM

https://reviews.llvm.org/D40892





More information about the llvm-commits mailing list