[PATCH] D137844: [DAG] Allow folding zext/sext into masked loads with multiple uses

Peter Waller via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 14 07:41:20 PST 2022


peterwaller-arm added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:12120
+          User->getOpcode() == ISD::CopyToReg)
+        return false;
+      // Replacing a non-free truncate with another non-free truncate should
----------------
Is it necessary to bail out for these cases, or would they still be handled by the isTruncFree logic? If you want to have the FIXME, it may be worth referencing ExtendUsesToFormExtLoad.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:12110
+  auto AllUsesCanBeReplaced = [&](SDValue V) {
+    bool isTruncFree = TLI.isTruncateFree(VT, N0.getValueType());
+    for (SDNode::use_iterator UI = V->use_begin(), UE = V->use_end(); UI != UE;
----------------
`V` is `N0`, so do you need to close over `N0`?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137844



More information about the llvm-commits mailing list