[PATCH] D68544: [X86][AVX] Access a scalar float/double as a free extract from a broadcast load (PR43217)

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 5 15:49:16 PDT 2019


craig.topper added inline comments.


================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:33458
                                   LN->getMemoryVT(), LN->getMemOperand());
+      if (!Src.hasOneUse())
+        DAG.ReplaceAllUsesOfValueWith(
----------------
Should we be using the same pattern we use for forming ExtLoads and truncating other users?

  // If the load value is used only by N, replace it via CombineTo N.
  bool NoReplaceTrunc = SDValue(LN0, 0).hasOneUse();
  Combiner.CombineTo(N, ExtLoad);
  if (NoReplaceTrunc) {
    DAG.ReplaceAllUsesOfValueWith(SDValue(LN0, 1), ExtLoad.getValue(1));
    Combiner.recursivelyDeleteUnusedNodes(LN0);
  } else {
    SDValue Trunc =
        DAG.getNode(ISD::TRUNCATE, SDLoc(N0), N0.getValueType(), ExtLoad);
    Combiner.CombineTo(LN0, Trunc, ExtLoad.getValue(1));
  }
  return SDValue(N, 0); // Return N so it doesn't get rechecked!



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D68544





More information about the llvm-commits mailing list