[PATCH] D45448: [CVP] simplify phi with constant incoming values that match common variable edge values

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 10 10:55:35 PDT 2018


efriedma added a comment.

Seems like it triggers frequently enough to be worth doing.



================
Comment at: lib/Transforms/Scalar/CorrelatedValuePropagation.cpp:161
+  if (auto *CommonInst = dyn_cast<Instruction>(CommonValue))
+    if (!SQ.DT->dominates(CommonInst, P))
+      return false;
----------------
`if (!SQ.DT->dominates(CommonInst, P->getParent()))` is probably closer to what you want; the two-instruction form actually scans the block if the two instructions are in the same BB.  (We should probably get rid of the two-instruction form at some point...)


https://reviews.llvm.org/D45448





More information about the llvm-commits mailing list