[PATCH] D141660: [InstCombine] Fold pattern xor(and, or) to select

chenglin.bi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 18 21:18:25 PST 2023


bcl5980 added inline comments.


================
Comment at: llvm/test/Transforms/InstCombine/xor-and-or.ll:200
 
-;; TODO: do we really need to do this transform?
+;; even through we save a instruction here, select is heavier than normal 
+;; and/or/xor on most backend,  do we really need to do this transform?
----------------
spatel wrote:
> typo: through -> though
> 
> If there's evidence that this is worse in codegen, then we could restrict the transform in this patch - only change when one or more of the original instructions is a select?
https://godbolt.org/z/7hPWbK9oT
It looks the drop comes from i1 vector. The case I worry looks at least no drop. Can I disable for the vector in this patch?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D141660/new/

https://reviews.llvm.org/D141660



More information about the llvm-commits mailing list