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

Thomas Symalla via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 28 06:33:25 PDT 2022


tsymalla 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 <
----------------
foad wrote:
> 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?
No, I don't think that applies in this particular example.
Maybe it makes more sense to restrict the matching to the case where C0 = 0xffc00 and C1 = 0x3ff00000. In this case, it should work. I cannot think of any (relevant) correlation between C0 and 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