diff options
| author | Johannes Doerfert <jdoerfert@anl.gov> | 2019-08-19 19:14:10 +0000 | 
|---|---|---|
| committer | Johannes Doerfert <jdoerfert@anl.gov> | 2019-08-19 19:14:10 +0000 | 
| commit | 056f1b5cc7c2133f0cb3e30e7f24808d321096d7 (patch) | |
| tree | 5fae5d18a7d77319bfe26ae111f5c86a0d031e26 /llvm/lib/Transforms | |
| parent | 0f4e9835c98ae68d53ebd05ac40ada41ddae68aa (diff) | |
| download | bcm5719-llvm-056f1b5cc7c2133f0cb3e30e7f24808d321096d7.tar.gz bcm5719-llvm-056f1b5cc7c2133f0cb3e30e7f24808d321096d7.zip | |
Re-apply fixed "[Attributor] Fix: Make sure we set the changed flag"
This reverts commit cedd0d9a6e4b433e1cd6585d1d4d152eb5e60b11.
Re-apply the original commit but make sure the variables are initialized
(even if they are not used) so UBSan is not complaining.
llvm-svn: 369294
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/IPO/Attributor.cpp | 8 | 
1 files changed, 4 insertions, 4 deletions
| diff --git a/llvm/lib/Transforms/IPO/Attributor.cpp b/llvm/lib/Transforms/IPO/Attributor.cpp index 4339a65f5e6..34fe5552a40 100644 --- a/llvm/lib/Transforms/IPO/Attributor.cpp +++ b/llvm/lib/Transforms/IPO/Attributor.cpp @@ -878,7 +878,7 @@ ChangeStatus AAReturnedValuesImpl::updateImpl(Attributor &A) {      // The map in which we collect return values -> return instrs.      decltype(ReturnedValues) &RetValsMap;      // The flag to indicate a change. -    bool Changed; +    bool &Changed;      // The return instrs we come from.      SmallPtrSet<ReturnInst *, 2> RetInsts;    }; @@ -906,9 +906,8 @@ ChangeStatus AAReturnedValuesImpl::updateImpl(Attributor &A) {    // Callback for all "return intructions" live in the associated function.    auto CheckReturnInst = [this, &VisitReturnedValue, &Changed](Instruction &I) {      ReturnInst &Ret = cast<ReturnInst>(I); -    RVState RVS({ReturnedValues, false, {}}); +    RVState RVS({ReturnedValues, Changed, {}});      RVS.RetInsts.insert(&Ret); -    Changed |= RVS.Changed;      return VisitReturnedValue(*Ret.getReturnValue(), RVS);    }; @@ -955,7 +954,8 @@ ChangeStatus AAReturnedValuesImpl::updateImpl(Attributor &A) {        if (Argument *Arg = dyn_cast<Argument>(RetVal)) {          // Arguments are mapped to call site operands and we begin the traversal          // again. -        RVState RVS({NewRVsMap, false, RetValAAIt.second}); +        bool Unused = false; +        RVState RVS({NewRVsMap, Unused, RetValAAIt.second});          VisitReturnedValue(*CB->getArgOperand(Arg->getArgNo()), RVS);          continue;        } else if (isa<CallBase>(RetVal)) { | 

