forked from OSchip/llvm-project
Revert [Attributor] Fix: Make sure we set the changed flag
This reverts r369159 (git commit cbaf1fdea2
)
r369160 caused a test to fail under UBSAN. See thread on llvm-commits.
llvm-svn: 369241
This commit is contained in:
parent
81094aad61
commit
cedd0d9a6e
|
@ -878,7 +878,7 @@ ChangeStatus AAReturnedValuesImpl::updateImpl(Attributor &A) {
|
||||||
// The map in which we collect return values -> return instrs.
|
// The map in which we collect return values -> return instrs.
|
||||||
decltype(ReturnedValues) &RetValsMap;
|
decltype(ReturnedValues) &RetValsMap;
|
||||||
// The flag to indicate a change.
|
// The flag to indicate a change.
|
||||||
bool &Changed;
|
bool Changed;
|
||||||
// The return instrs we come from.
|
// The return instrs we come from.
|
||||||
SmallPtrSet<ReturnInst *, 2> RetInsts;
|
SmallPtrSet<ReturnInst *, 2> RetInsts;
|
||||||
};
|
};
|
||||||
|
@ -906,8 +906,9 @@ ChangeStatus AAReturnedValuesImpl::updateImpl(Attributor &A) {
|
||||||
// Callback for all "return intructions" live in the associated function.
|
// Callback for all "return intructions" live in the associated function.
|
||||||
auto CheckReturnInst = [this, &VisitReturnedValue, &Changed](Instruction &I) {
|
auto CheckReturnInst = [this, &VisitReturnedValue, &Changed](Instruction &I) {
|
||||||
ReturnInst &Ret = cast<ReturnInst>(I);
|
ReturnInst &Ret = cast<ReturnInst>(I);
|
||||||
RVState RVS({ReturnedValues, Changed, {}});
|
RVState RVS({ReturnedValues, false, {}});
|
||||||
RVS.RetInsts.insert(&Ret);
|
RVS.RetInsts.insert(&Ret);
|
||||||
|
Changed |= RVS.Changed;
|
||||||
return VisitReturnedValue(*Ret.getReturnValue(), RVS);
|
return VisitReturnedValue(*Ret.getReturnValue(), RVS);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -954,8 +955,7 @@ ChangeStatus AAReturnedValuesImpl::updateImpl(Attributor &A) {
|
||||||
if (Argument *Arg = dyn_cast<Argument>(RetVal)) {
|
if (Argument *Arg = dyn_cast<Argument>(RetVal)) {
|
||||||
// Arguments are mapped to call site operands and we begin the traversal
|
// Arguments are mapped to call site operands and we begin the traversal
|
||||||
// again.
|
// again.
|
||||||
bool Unused;
|
RVState RVS({NewRVsMap, false, RetValAAIt.second});
|
||||||
RVState RVS({NewRVsMap, Unused, RetValAAIt.second});
|
|
||||||
VisitReturnedValue(*CB->getArgOperand(Arg->getArgNo()), RVS);
|
VisitReturnedValue(*CB->getArgOperand(Arg->getArgNo()), RVS);
|
||||||
continue;
|
continue;
|
||||||
} else if (isa<CallBase>(RetVal)) {
|
} else if (isa<CallBase>(RetVal)) {
|
||||||
|
|
Loading…
Reference in New Issue