[PATCH] D73892: [SelectionDAG] Optimize build_vector of truncates and shifts

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 3 07:43:43 PST 2020


arsenm added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:17486-17488
+  // Only for little endian
+  if (!DAG.getDataLayout().isLittleEndian())
+    return SDValue();
----------------
Why does this matter? This doesn't touch memory


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:17504
+    if (Op.getOpcode() == ISD::BITCAST)
+      return SDValue(Op.getOperand(0));
+    return Op;
----------------
You don't need the SDValue copy constructor here


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D73892





More information about the llvm-commits mailing list