forked from OSchip/llvm-project
[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:
parent
7fd779f09f
commit
aea60846c4
|
@ -1097,9 +1097,8 @@ static void AddAliasScopeMetadata(CallSite CS, ValueToValueMapTy &VMap,
|
||||||
static void AddAlignmentAssumptions(CallSite CS, InlineFunctionInfo &IFI) {
|
static void AddAlignmentAssumptions(CallSite CS, InlineFunctionInfo &IFI) {
|
||||||
if (!PreserveAlignmentAssumptions || !IFI.GetAssumptionCache)
|
if (!PreserveAlignmentAssumptions || !IFI.GetAssumptionCache)
|
||||||
return;
|
return;
|
||||||
AssumptionCache *AC = IFI.GetAssumptionCache
|
|
||||||
? &(*IFI.GetAssumptionCache)(*CS.getCaller())
|
AssumptionCache *AC = &(*IFI.GetAssumptionCache)(*CS.getCaller());
|
||||||
: nullptr;
|
|
||||||
auto &DL = CS.getCaller()->getParent()->getDataLayout();
|
auto &DL = CS.getCaller()->getParent()->getDataLayout();
|
||||||
|
|
||||||
// To avoid inserting redundant assumptions, we should check for assumptions
|
// 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())
|
CallInst *NewAssumption = IRBuilder<>(CS.getInstruction())
|
||||||
.CreateAlignmentAssumption(DL, Arg, Align);
|
.CreateAlignmentAssumption(DL, Arg, Align);
|
||||||
if (AC)
|
AC->registerAssumption(NewAssumption);
|
||||||
AC->registerAssumption(NewAssumption);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue