[PATCH] D100177: [X86][BMI] Fold cmpeq/ne(or(X,Y),X) --> cmpeq/ne(and(~X,Y),0) (PR44136)

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 9 06:32:38 PDT 2021


RKSimon added inline comments.


================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:48170
+      auto MatchOrCmpEq = [&](SDValue N0, SDValue N1) {
+        if (N0.getOpcode() == ISD::OR && N->isOnlyUserOf(N0.getNode())) {
+          if (N0.getOperand(0) == N1)
----------------
spatel wrote:
> Is `isOnlyUserOf()` safer/better than `hasOneUse()` in this pattern (or in general)?
Nice catch - its a force of habit from shuffle combining!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100177



More information about the llvm-commits mailing list