[PATCH] D46426: [SROA] Handle PHI with multiple duplicate predecessors

Bjorn Pettersson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 4 05:30:51 PDT 2018


bjope created this revision.
bjope added reviewers: uabelho, chandlerc, hfinkel.

The verifier accepts PHI nodes with multiple entries for the
same basic block, as long as the value is the same.

As seen in PR37203, SROA did not handle such PHI nodes properly
when speculating loads over the PHI, since it inserted multiple
loads in the predecessor block and changed the PHI into having
multiple entries for the same basic block, but with different
values.

This patch teaches SROA to reuse the same speculated load for
each PHI duplicate entry in such situations.

Resolves: https://bugs.llvm.org/show_bug.cgi?id=37203


Repository:
  rL LLVM

https://reviews.llvm.org/D46426

Files:
  lib/Transforms/Scalar/SROA.cpp
  test/Transforms/SROA/phi-with-duplicate-pred.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46426.145178.patch
Type: text/x-patch
Size: 3730 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180504/b26e6742/attachment.bin>


More information about the llvm-commits mailing list