[PATCH] D84629: [LazyValueInfo] Let getEdgeValueLocal look into freeze instructions

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 27 12:58:18 PDT 2020


nikic added inline comments.


================
Comment at: llvm/lib/Analysis/LazyValueInfo.cpp:1316
+          (isa<FreezeInst>(Val) &&
+           Condition == cast<FreezeInst>(Val)->getOperand(0)))
         return ValueLatticeElement::get(ConstantInt::get(
----------------
efriedma wrote:
> nikic wrote:
> > Wouldn't we expect such a freeze to get dropped by InstSimplify/InstCombine anyway?
> You mean, we should rewrite uses of a freeze in blocks where we know the operand of the freeze can't be undef/poison?  I guess that's something we should do.  I don't think instsimplify has the context necessary to do that sort of rewrite.
You're right, if there are multiple uses and only some are dominated by the condition we currently don't handle it in InstCombine. The `@simple` case from the test would be handled though, because the freeze gets sunk.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D84629





More information about the llvm-commits mailing list