diff options
author | Sanjay Patel <spatel@rotateright.com> | 2016-12-31 17:54:05 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2016-12-31 17:54:05 +0000 |
commit | aea60846c4886e41fa11dccd6aa229b127bf9757 (patch) | |
tree | 3c7083ea37951369f5e2b2c0299e3289ad11f737 | |
parent | 7fd779f09f00b04fbd59c15ce28614cdeea1e0b4 (diff) | |
download | bcm5719-llvm-aea60846c4886e41fa11dccd6aa229b127bf9757.tar.gz bcm5719-llvm-aea60846c4886e41fa11dccd6aa229b127bf9757.zip |
[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
-rw-r--r-- | llvm/lib/Transforms/Utils/InlineFunction.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Utils/InlineFunction.cpp b/llvm/lib/Transforms/Utils/InlineFunction.cpp index 66eb76b9ae9..a2ceded106b 100644 --- a/llvm/lib/Transforms/Utils/InlineFunction.cpp +++ b/llvm/lib/Transforms/Utils/InlineFunction.cpp @@ -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); } } } |