[PATCH] D28534: [LCSSA] Don't let SSAUpdater to break LCSSA during LCSSA construction.

Michael Zolotukhin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 10 14:07:18 PST 2017


mzolotukhin created this revision.
mzolotukhin added reviewers: chandlerc, sanjoy, davide.
mzolotukhin added a subscriber: llvm-commits.

This change essentially does the following:

1. Factors out formLCSSAForOneInstruction, so that we can use the same instance of SSAUpdate for all rewritings corresponding to the same instruction.
2. Starts to use a stricter check than just SSAUpdate.HasValueForBlock: we need to process the value even if SSAUpdater thinks it's available unless it's a PHI-node defined in this block.

(1) allows us to avoid generating duplicate phi-nodes in the same BB for
the same instruction - we did this because we cleared SSAUpdater on
every iteration in our Worklist loop. Now we only clear it once, before
processing an instruction.
(2) makes sure that we still generate LCSSA phi-nodes even in cases
where SSAUpdater thinks we have an available value.


https://reviews.llvm.org/D28534

Files:
  lib/Transforms/Utils/LCSSA.cpp
  test/Transforms/LCSSA/pr28424.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28534.83869.patch
Type: text/x-patch
Size: 4888 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170110/78e0c048/attachment.bin>


More information about the llvm-commits mailing list