[PATCH] D107794: [AArch64ISelLowering] Avoid sinking mul's ops in some cases

guopeilin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 9 19:04:09 PDT 2021


guopeilin added a comment.

Within the CodegenPrepare::tryToSinkFreeOperands,  those Ops that use in the same BB as TargetBB will be skipped.

  for (Use *U : reverse(OpsToSink)) {
      auto *UI = cast<Instruction>(U->get());
      if (UI->getParent() == TargetBB || isa<PHINode>(UI))
        continue;
      ToReplace.push_back(U);
    }

Thus for the Ops `shuffle and insertelement` of Mul generated by `shouldSinkOperands`, if the shuffle is already in the same BB of Mul, we will not sink the shuffle. However, the insertelement instruction will be sink right above the Mul instruction while behind the shuffle instruction. That is illegal cause def not dominate the use.


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

https://reviews.llvm.org/D107794



More information about the llvm-commits mailing list