[PATCH] D38122: [DAGCombiner] Remove duplicate code from visitZERO_EXTEND

Phabricator via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 21 10:31:50 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL313891: [DAGCombiner] Remove duplicate code from visitZERO_EXTEND (authored by ctopper).

Changed prior to commit:
  https://reviews.llvm.org/D38122?vs=116143&id=116217#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D38122

Files:
  llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp


Index: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
===================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -7558,20 +7558,6 @@
       return DAG.getZExtOrTrunc(Op, SDLoc(N), VT);
   }
 
-  // fold (zext (truncate (load x))) -> (zext (smaller load x))
-  // fold (zext (truncate (srl (load x), c))) -> (zext (small load (x+c/n)))
-  if (N0.getOpcode() == ISD::TRUNCATE) {
-    if (SDValue NarrowLoad = ReduceLoadWidth(N0.getNode())) {
-      SDNode *oye = N0.getOperand(0).getNode();
-      if (NarrowLoad.getNode() != N0.getNode()) {
-        CombineTo(N0.getNode(), NarrowLoad);
-        // CombineTo deleted the truncate, if needed, but not what's under it.
-        AddToWorklist(oye);
-      }
-      return SDValue(N, 0);   // Return N so it doesn't get rechecked!
-    }
-  }
-
   // fold (zext (truncate x)) -> (and x, mask)
   if (N0.getOpcode() == ISD::TRUNCATE) {
     // fold (zext (truncate (load x))) -> (zext (smaller load x))


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38122.116217.patch
Type: text/x-patch
Size: 1076 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170921/c483d356/attachment.bin>


More information about the llvm-commits mailing list