[PATCH] D57033: [LCSSA] Handle case with single new PHI faster.
Florian Hahn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 24 13:54:54 PST 2019
fhahn marked 2 inline comments as done.
fhahn added inline comments.
================
Comment at: llvm/lib/Transforms/Utils/LCSSA.cpp:205
+ if (UseToRewrite->get()->hasValueHandle())
+ ValueHandleBase::ValueIsRAUWd(*UseToRewrite, AddedPHIs[0]);
+ UseToRewrite->set(AddedPHIs[0]);
----------------
efriedma wrote:
> Maybe worth mentioning that this can call ValueIsRAUWd multiple times for the same value. (I don't think it's a problem, but took me a minute to understand what this is doing.)
Yep, I can also move it to avoid calling it multiple times.
================
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)));
----------------
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.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D57033/new/
https://reviews.llvm.org/D57033
More information about the llvm-commits
mailing list