[PATCH] D48530: [DAGCombiner] In foldSelectOfConstants, use 'sub C1+1, (zext Cond)' instead of 'add (sext Cond), C1+1'

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 28 13:08:00 PDT 2018


spatel added a comment.

In https://reviews.llvm.org/D48530#1147103, @craig.topper wrote:

> Yeah I think the other patches took care of my perf regression. I'm fine to abandon this if you don't think the PowerPC changes are worthwhile.


Yep, PPC has a lot of missed opportunities. That could probably be solved with better pattern matching later on. For x86, if cmov really is implemented as a single-cycle and full-throughput op, then we probably shouldn't be doing these kinds of folds anyway.

Also worth noting: no other in-tree targets have enabled the convertSelectOfConstantsToMath() hook to get this transform, but I think that's just an oversight. Not sure what differences we'd see if more targets override the default.


Repository:
  rL LLVM

https://reviews.llvm.org/D48530





More information about the llvm-commits mailing list