SideEffectAnalysis: don't assume the worst side-effects for a release instruction

Instead let the client decide what to do with this.
Sometimes the client knows what side effect a release instruction really has.
This commit is contained in:
Erik Eckstein
2018-01-04 16:11:31 -08:00
parent 8ccab3e7e4
commit db69b8d433
5 changed files with 9 additions and 5 deletions

View File

@@ -72,6 +72,7 @@ static bool mayWriteTo(AliasAnalysis *AA, SideEffectAnalysis *SEA,
for (unsigned Idx = 0, End = AI->getNumArguments(); Idx < End; ++Idx) {
auto &ArgEffect = E.getParameterEffects()[Idx];
assert(!ArgEffect.mayRelease() && "apply should only read from memory");
if (!ArgEffect.mayRead())
continue;