[PATCH] D48278: [SelectionDAG] Fold redundant masking operations of shifted value

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 10 12:05:47 PDT 2018


efriedma added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:5986
+  const auto &MaskedValue = dyn_cast<SDNode>(MASKED);
+  for (SDNode *OtherUser : MaskedValue->uses()) {
+    if ((&(*OtherUser) == ShiftAmount) || (OtherUser->getOpcode() != ISD::AND))
----------------
Walking the uses of an SDNode can get expensive... is this O(N^2) in the number of uses of MaskedValue?  If not, please add a comment explaining why it isn't.


https://reviews.llvm.org/D48278





More information about the llvm-commits mailing list