[PATCH] D45889: [MemCpyOpt] Do not iterate beyond beginning of basic block

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 20 12:11:17 PDT 2018


efriedma added a comment.

C dominates LI because it's the result of getDependency.  LI dominates SI because LI is an operand of SI.  Therefore C dominates SI. LI and SI are in the same block because of the getParent() check.  C is in the same block as LI because getDependency always returns an instruction in the same block.  Therefore C and SI are in the same block. Given C and SI are in the same block, and C dominates SI, and the block is reachable, C must come before SI in the block (so SI can't be the first instruction in the block, and the loop will eventually terminate).


Repository:
  rL LLVM

https://reviews.llvm.org/D45889





More information about the llvm-commits mailing list