[PATCH] D113497: [IPSCCP] Support unfeasible default dests for switch.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 26 05:18:17 PST 2021


fhahn updated this revision to Diff 390028.
fhahn added a comment.

In D113497#3154248 <https://reviews.llvm.org/D113497#3154248>, @lebedev.ri wrote:

> Not really familiar with this pass, but the transform sounds legal, although i would have guessed you'd want to instead point it to an new block with `unreachable`?
>
>> ! In D113497#3154265 <https://reviews.llvm.org/D113497#3154265>, @nikic wrote:
>
> Agree with @lebedev.ri, this should point to an unreachable block. It doesn't matter much for the resolvedUndefsIn case, but with proper support merging into an unrelated case would be a pretty bad choice.

Thanks, I updated the code to create a new unreachable block on demand (and cache it for the function) and use that as default successor.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D113497/new/

https://reviews.llvm.org/D113497

Files:
  llvm/lib/Transforms/Scalar/SCCP.cpp
  llvm/test/Transforms/SCCP/switch-constantfold-crash.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113497.390028.patch
Type: text/x-patch
Size: 5170 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211126/42ca48bf/attachment.bin>


More information about the llvm-commits mailing list