[PATCH] D134418: [AMDGPU] Improve ISel for v_bfi instructions.

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 23 01:25:50 PDT 2022


foad added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SIInstructions.td:1909
+// ((a ^ y) & C0) ^ ((y & C1) | (z & ~C1)) <=>
+// (a & C0) | (~C0 & ((y & C1) | (z & ~C1)))
+def : AMDGPUPat <
----------------
tsymalla wrote:
> foad wrote:
> > Still not true. Counterexample: a=y=C1=0, z=C0=1.
> You are correct. I need to overthink the pattern. In general, the equation is not correct when when y != z and a=y=C1.
It might be true if you restrict it to cases where ~C0|C1 is true, i.e. the bits set in C0 are a subset of the bits set in C1?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D134418



More information about the llvm-commits mailing list