This is an archive of the discontinued LLVM Phabricator instance.

[Transforms][SROA] Fixed assertion crash (PR30416)
AbandonedPublic

Authored by kbelochapka on Feb 20 2018, 7:33 PM.

Details

Summary

Problem:
In certain situations during ALLOCA promotion, the promoteSingleBlockAlloca() function attempts to replace an instruction by the same instruction. This causes the assertion crash described in PR30416.

Solution:
Disable SROA for a Basic Block that can cause circular dependency.

Diff Detail

Event Timeline

kbelochapka created this revision.Feb 20 2018, 7:33 PM
kbelochapka edited the summary of this revision. (Show Details)

Test?

Added test.

espindola edited reviewers, added: espindola; removed: rafael.Mar 15 2018, 8:35 AM
luqmana resigned from this revision.Oct 6 2020, 12:14 AM

This problem was fixed:

commit 2cd9451d45d2cfd560395c25c12d27d8f6090d1b
Date:   Thu Jun 7 11:09:05 2018 +0000

[Mem2Reg] Avoid replacing load with itself in promoteSingleBlockAlloca.
We do the same thing in rewriteSingleStoreAlloca.

Differential Revision: https://reviews.llvm.org/D47825

@kbelochapka Abandon this patch?