Slide 41
Slide 41 text
USZ%FWJSUVBMJ[F"QQMZ
auto &M = FAS.getModule();
auto Instance = stripUpCasts(CMI->getOperand());
auto ClassType = Instance->getType();
...
if (isEffectivelyFinalMethod(FAS, ClassType, CD, CHA))
return tryDevirtualizeClassMethod(FAS, Instance, ORE,
true /*isEffectivelyFinalMethod*/);
if (auto Instance = getInstanceWithExactDynamicType(CMI->getOperand(),
CMI->getModule(),
CHA))
return tryDevirtualizeClassMethod(FAS, Instance, ORE);
if (auto ExactTy = getExactDynamicType(CMI->getOperand(), CMI->getModule(),
CHA)) {
if (ExactTy == CMI->getOperand()->getType())
return tryDevirtualizeClassMethod(FAS, CMI->getOperand(), ORE);
}
MJC4*-0QUJNJ[FS6UJMT%FWJSUVBMJ[FDQQ