[Inliner] remove unnecessary null checks from AddAlignmentAssumptions(); NFCI

We bail out on the 1st line if the assumption cache is not set, so there's
no need to check it after that.

llvm-svn: 290787
This commit is contained in:
Sanjay Patel 2016-12-31 17:54:05 +00:00
parent 7fd779f09f
commit aea60846c4
1 changed files with 3 additions and 5 deletions

View File

@ -1097,9 +1097,8 @@ static void AddAliasScopeMetadata(CallSite CS, ValueToValueMapTy &VMap,
static void AddAlignmentAssumptions(CallSite CS, InlineFunctionInfo &IFI) {
if (!PreserveAlignmentAssumptions || !IFI.GetAssumptionCache)
return;
AssumptionCache *AC = IFI.GetAssumptionCache
? &(*IFI.GetAssumptionCache)(*CS.getCaller())
: nullptr;
AssumptionCache *AC = &(*IFI.GetAssumptionCache)(*CS.getCaller());
auto &DL = CS.getCaller()->getParent()->getDataLayout();
// To avoid inserting redundant assumptions, we should check for assumptions
@ -1127,8 +1126,7 @@ static void AddAlignmentAssumptions(CallSite CS, InlineFunctionInfo &IFI) {
CallInst *NewAssumption = IRBuilder<>(CS.getInstruction())
.CreateAlignmentAssumption(DL, Arg, Align);
if (AC)
AC->registerAssumption(NewAssumption);
AC->registerAssumption(NewAssumption);
}
}
}