[llvm] [X86] X86DAGToDAGISel - attempt to merge XMM/YMM loads with YMM/ZMM loads of the same ptr (PR #73126)

Shengchen Kan via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 22 19:02:46 PST 2023


================
@@ -1036,6 +1036,42 @@ void X86DAGToDAGISel::PreprocessISelDAG() {
 
       break;
     }
+    case ISD::LOAD: {
+      // If this is a XMM/YMM load of the same lower bits as another YMM/ZMM
+      // load, then just extract the lower subvector and avoid the second load.
+      auto *Ld = cast<LoadSDNode>(N);
+      MVT VT = N->getSimpleValueType(0);
+      if (ISD::isNormalLoad(Ld) && Ld->isSimple() &&
----------------
KanRobert wrote:

Should we check `!isVolatile` instead of `isSimple`?

https://github.com/llvm/llvm-project/pull/73126


More information about the llvm-commits mailing list