[PATCH] D77202: [Target][ARM] Fold or(A, B) more aggressively for I1 Vectors

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 4 23:57:39 PDT 2020


dmgreen accepted this revision.
dmgreen added a comment.
This revision is now accepted and ready to land.

Thanks. LGTM, with one extra comment.



================
Comment at: llvm/lib/Target/ARM/ARMISelLowering.cpp:12686
 
-  SmallVector<SDValue, 4> Ops0;
-  Ops0.push_back(N0->getOperand(0));
-  if (N0->getOpcode() == ARMISD::VCMP)
-    Ops0.push_back(N0->getOperand(1));
-  Ops0.push_back(DCI.DAG.getConstant(Opposite0, SDLoc(N0), MVT::i32));
-  SmallVector<SDValue, 4> Ops1;
-  Ops1.push_back(N1->getOperand(0));
-  if (N1->getOpcode() == ARMISD::VCMP)
-    Ops1.push_back(N1->getOperand(1));
-  Ops1.push_back(DCI.DAG.getConstant(Opposite1, SDLoc(N1), MVT::i32));
-
-  SDValue NewN0 = DCI.DAG.getNode(N0->getOpcode(), SDLoc(N0), VT, Ops0);
-  SDValue NewN1 = DCI.DAG.getNode(N1->getOpcode(), SDLoc(N1), VT, Ops1);
-  SDValue And = DCI.DAG.getNode(ISD::AND, SDLoc(N), VT, NewN0, NewN1);
-  return DCI.DAG.getNode(ISD::XOR, SDLoc(N), VT, And,
-                         DCI.DAG.getAllOnesConstant(SDLoc(N), VT));
+  SDValue NewN0 = DCI.DAG.getLogicalNOT({N0}, N0, VT);
+  SDValue NewN1 = DCI.DAG.getLogicalNOT({N1}, N1, VT);
----------------
These can use DL too. The not is in a way coming from the Or.


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

https://reviews.llvm.org/D77202





More information about the llvm-commits mailing list