[PATCH] D57033: [LCSSA] Handle case with single new PHI faster.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 24 13:58:30 PST 2019


efriedma added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/LCSSA.cpp:226
+      Value *V = AddedPHIs.size() == 1 ? AddedPHIs[0]
+                                       : SSAUpdate.FindValueForBlock(UserBB);
+      DVI->setOperand(0, MetadataAsValue::get(Ctx, ValueAsMetadata::get(V)));
----------------
fhahn wrote:
> efriedma wrote:
> > I'm not sure I understand why you're changing the logic here for the `AddedPHIs.size() != 1` case.
> In the AddedPHIs.size() == 1 case, SSAUpdate won't be used to rewrite the uses, so we can just use the only inserted PHI.
Let me rephrase: the setOperand() call used to be guarded by an if statement. Why are you making the call unconditional?


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

https://reviews.llvm.org/D57033





More information about the llvm-commits mailing list