[PATCH] D147041: [CodeGen] Remove redundent instructions generated by combineAddrModes.

Serguei Katkov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 29 21:21:48 PDT 2023


skatkov added a comment.

Additionally, what I worry about is that the function CodeGenPrepare::optimizeMemoryInst itself remove original instruction.

  if (Repl->use_empty()) {
    resetIteratorIfInvalidatedWhileCalling(CurInstIterator->getParent(), [&]() {
      RecursivelyDeleteTriviallyDeadInstructions(
          Repl, TLInfo, nullptr,
          [&](Value *V) { removeAllAssertingVHReferences(V); });
    });
  }

I guess it will not be able to remove combineValue but it should be checked by full inspection of algorithm or you can use WeakTrackingVH to keep common value.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D147041



More information about the llvm-commits mailing list