[PATCH] D106010: [SimplifyCFG] Rerun PHI deduplication after common code sinkinkg (PR51092)

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 14 13:13:15 PDT 2021


lebedev.ri created this revision.
lebedev.ri added reviewers: RKSimon, spatel.
lebedev.ri added a project: LLVM.
Herald added a subscriber: hiraditya.
lebedev.ri requested review of this revision.

`SinkCommonCodeFromPredecessors()` doesn't itself ensure that duplicate PHI nodes aren't created.
I suppose, we could teach it to do that on-the-fly (& account for the already-existing PHI nodes,
& adjust costmodel), the diff will be bigger than this.

The alternative is to schedule a new EarlyCSE pass invocation somewhere later in the pipeline.
Clearly, we don't have any EarlyCSE runs in module optimization passline, so this pattern isn't cleaned up...


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D106010

Files:
  llvm/lib/Transforms/Utils/SimplifyCFG.cpp
  llvm/test/Transforms/PhaseOrdering/X86/earlycse-after-simplifycfg-two-entry-phi-node-folding.ll
  llvm/test/Transforms/SimplifyCFG/X86/sink-common-code.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106010.358711.patch
Type: text/x-patch
Size: 9132 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210714/3b0086f4/attachment.bin>


More information about the llvm-commits mailing list