[sil] Use FullApplySite instead of ApplyInst in SILInstruction::getMemoryBehavior().

We were giving special handling to ApplyInst when we were attempting to use
getMemoryBehavior(). This commit changes the special handling to work on all
full apply sites instead of just AI. Additionally, we look through partial
applies and thin to thick functions.

I also added a dumper called BasicInstructionPropertyDumper that just dumps the
results of SILInstruction::get{Memory,Releasing}Behavior() for all instructions
in order to verify this behavior.
This commit is contained in:
Michael Gottesman
2016-02-21 20:44:59 -08:00
parent b812efa4cc
commit a5be2fff01
30 changed files with 236 additions and 53 deletions

View File

@@ -288,7 +288,7 @@ void SideEffectAnalysis::analyzeInstruction(FunctionInfo *FInfo,
}
}
if (SILFunction *SingleCallee = FAS.getCalleeFunction()) {
if (SILFunction *SingleCallee = FAS.getReferencedFunction()) {
// Does the function have any @effects?
if (getDefinedEffects(FInfo->FE, SingleCallee))
return;
@@ -467,7 +467,7 @@ void SideEffectAnalysis::getEffects(FunctionEffects &ApplyEffects, FullApplySite
return;
}
if (SILFunction *SingleCallee = FAS.getCalleeFunction()) {
if (SILFunction *SingleCallee = FAS.getReferencedFunction()) {
// Does the function have any @effects?
if (getDefinedEffects(ApplyEffects, SingleCallee))
return;