[PATCH] D22038: [X86] Transform zext+seteq+cmp into shr+lzcnt on btver2 architecture.

pierre gousseau via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 6 09:16:15 PDT 2016

pgousseau added a comment.

In http://reviews.llvm.org/D22038#475155, @RKSimon wrote:

> This seems to be limited to (a==0) and ((a== 0) || (b== 0)) patterns - is that the best way to do this? Can this be easily compounded to support different numbers of tests?

Yes I was hoping to do the generic case initially, I had a version implemented in X86ISelLowering which was handling the case (ak == 0 || ... || an == 0), but this caused some optimisation opportunities in h264's hot functions to be missed. Not quite sure why this happened, it seems that there are optimisations occurring before Instruction selection that will undo lzcnt + shr optimisations.


More information about the llvm-commits mailing list