[PATCH] D115884: [AMDGPU] Expand not pattern according to the XOR node divergence

Alexander via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 17 07:19:09 PST 2021


alex-t added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SIInstructions.td:2120
+def : GCNPat <
+  (i32 (UniformBinFrag<xor> i32:$src0, (i32 -1))),
+  (S_NOT_B32 $src0)
----------------
foad wrote:
> alex-t wrote:
> > rampitec wrote:
> > > foad wrote:
> > > > There are already patterns on the definitions of S_NOT_* in SOPInstructions.td. Can you update those, instead of adding new standalone patterns?
> > > +1.
> > The pattern in SOPInstructions.td works with the explicit "not" PatFrag. What if there is no "not" but the "xor src, -1" that was produced by the earlier DAG transformations?
> > Are you quite sure that this scenario never happens? 
> 'not' is not a separate DAG node, it is just a named pattern that matches an xor with -1.
Ah... yes. :)  "not" is a PatFrag so it is always considered as "not" during selection.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D115884



More information about the llvm-commits mailing list