[PATCH] D99171: [WebAssembly] Fold xor by inverting branch target

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 24 18:28:56 PDT 2021


craig.topper added a comment.

In D99171#2646847 <https://reviews.llvm.org/D99171#2646847>, @samparker wrote:

> Thanks all. I've added a PatLeaf to detect a boolean, but I wasn't sure how to write a negative test using LLVM IR considering that the branch always takes an i1. Any ideas?

If you're starting from brcond, I don't think you need the check. I think the input to brcond should agree with the what the target has defined for getBooleanContents. I assume that's ZeroOrOne for WebAssembly. If you were to generalize this for xors not being used by a brcond you would need a check.


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

https://reviews.llvm.org/D99171



More information about the llvm-commits mailing list