1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 04:02:41 +01:00

[Attributor] Verify checkForAllUses return value properly

Also do not emit more than one remark after Heap2Stack failed.
This commit is contained in:
Johannes Doerfert 2021-07-27 17:30:53 -05:00
parent 0b6fb7b1ef
commit 0042081f58

View File

@ -6163,7 +6163,8 @@ ChangeStatus AAHeapToStackFunction::updateImpl(Attributor &A) {
"parameter as `__attribute__((noescape))` to override."; "parameter as `__attribute__((noescape))` to override.";
}; };
if (AI.LibraryFunctionId == LibFunc___kmpc_alloc_shared) if (ValidUsesOnly &&
AI.LibraryFunctionId == LibFunc___kmpc_alloc_shared)
A.emitRemark<OptimizationRemarkMissed>(AI.CB, "OMP113", Remark); A.emitRemark<OptimizationRemarkMissed>(AI.CB, "OMP113", Remark);
LLVM_DEBUG(dbgs() << "[H2S] Bad user: " << *UserI << "\n"); LLVM_DEBUG(dbgs() << "[H2S] Bad user: " << *UserI << "\n");
@ -6183,7 +6184,8 @@ ChangeStatus AAHeapToStackFunction::updateImpl(Attributor &A) {
ValidUsesOnly = false; ValidUsesOnly = false;
return true; return true;
}; };
A.checkForAllUses(Pred, *this, *AI.CB); if (!A.checkForAllUses(Pred, *this, *AI.CB))
return false;
return ValidUsesOnly; return ValidUsesOnly;
}; };