[PATCH] D70171: [Scalarizer] Treat values from unreachable blocks as undef

Mikael Holmén via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 13 04:34:14 PST 2019


uabelho created this revision.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.

When scalarizing PHI nodes we might try to examine/rewrite
InsertElement nodes in predecessors. If those predecessors
are unreachable from entry, then the IR in those blocks could
have unexpected properties resulting in infinite loops in
Scatterer::operator[].
By simply treating values originating from instructions in
unreachable blocks as undef we do not need to analyse them
further.

This fixes PR41723.


Repository:
  rL LLVM

https://reviews.llvm.org/D70171

Files:
  llvm/lib/Transforms/Scalar/Scalarizer.cpp
  llvm/test/Transforms/Scalarizer/phi-unreachable-pred.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70171.229060.patch
Type: text/x-patch
Size: 8339 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191113/9ba55950/attachment.bin>


More information about the llvm-commits mailing list