[PATCH] D116270: [AMDGPU] Enable divergence-driven XNOR selection

Alexander via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 11 12:11:59 PST 2022


alex-t added a comment.

> I think it is worth trying to change this generic combine to give up if x is uniform and y is divergent.

That is exactly what I have done for now:

  if (N0.hasOneUse() &&
    // In this case the transformation spoils the opportunity
    // to keep the whole operation scalar.
    !(!(N0->isDivergent() || N00->isDivergent()) && N1->isDivergent())) {
    // Reassociate: (op (op x, c1), y) -> (op (op x, y), c1)
    //              iff (op x, c1) has one use
    if (SDValue OpNode = DAG.getNode(Opc, SDLoc(N0), VT, N00, N1))
      return DAG.getNode(Opc, DL, VT, OpNode, N01);
    return SDValue();
  }

but need to test if it does not break anything else :)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D116270



More information about the llvm-commits mailing list