[PATCH] D112162: [NFC] [LLVM] Fix MaxFixPointIterations typo to match documentation
Alf via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 20 12:20:11 PDT 2021
gAlfonso-bit updated this revision to Diff 381054.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D112162/new/
https://reviews.llvm.org/D112162
Files:
llvm/include/llvm/Transforms/IPO/Attributor.h
llvm/lib/Transforms/IPO/Attributor.cpp
llvm/lib/Transforms/IPO/OpenMPOpt.cpp
Index: llvm/lib/Transforms/IPO/OpenMPOpt.cpp
===================================================================
--- llvm/lib/Transforms/IPO/OpenMPOpt.cpp
+++ llvm/lib/Transforms/IPO/OpenMPOpt.cpp
@@ -4724,10 +4724,10 @@
Allocator,
/*CGSCC*/ Functions, Kernels);
- unsigned MaxFixpointIterations =
+ unsigned MaxFixedpointIterations =
(isOpenMPDevice(M)) ? SetFixpointIterations : 32;
Attributor A(Functions, InfoCache, CGUpdater, nullptr, false, true,
- MaxFixpointIterations, OREGetter, DEBUG_TYPE);
+ MaxFixedPointIterations, OREGetter, DEBUG_TYPE);
OpenMPOpt OMPOpt(SCC, CGUpdater, OREGetter, InfoCache, A);
bool Result = OMPOpt.run(false);
Index: llvm/lib/Transforms/IPO/Attributor.cpp
===================================================================
--- llvm/lib/Transforms/IPO/Attributor.cpp
+++ llvm/lib/Transforms/IPO/Attributor.cpp
@@ -1327,17 +1327,15 @@
// Now that all abstract attributes are collected and initialized we start
// the abstract analysis.
- unsigned IterationCounter = 1;
- unsigned MaxFixedPointIterations;
- if (MaxFixpointIterations)
- MaxFixedPointIterations = MaxFixpointIterations.getValue();
- else
- MaxFixedPointIterations = SetFixpointIterations;
-
SmallVector<AbstractAttribute *, 32> ChangedAAs;
SetVector<AbstractAttribute *> Worklist, InvalidAAs;
Worklist.insert(DG.SyntheticRoot.begin(), DG.SyntheticRoot.end());
+ unsigned MaxFixpointIterationsValue = MaxFixpointIterations
+ ? MaxFixpointIterations.getValue()
+ : SetFixpointIterations;
+ unsigned IterationCounter = 1;
+
do {
// Remember the size to determine new attributes.
size_t NumAAs = DG.SyntheticRoot.Deps.size();
@@ -1412,17 +1410,18 @@
Worklist.clear();
Worklist.insert(ChangedAAs.begin(), ChangedAAs.end());
- } while (!Worklist.empty() && (IterationCounter++ < MaxFixedPointIterations ||
- VerifyMaxFixpointIterations));
+ } while (!Worklist.empty() &&
+ (IterationCounter++ < MaxFixpointIterationsValue ||
+ VerifyMaxFixpointIterations));
- if (IterationCounter > MaxFixedPointIterations && !Worklist.empty()) {
+ if (IterationCounter > MaxFixpointIterationsValue && !Worklist.empty()) {
auto Remark = [&](OptimizationRemarkMissed ORM) {
return ORM << "Attributor did not reach a fixpoint after "
- << ore::NV("Iterations", MaxFixedPointIterations)
+ << ore::NV("Iterations", MaxFixpointIterationsValue)
<< " iterations.";
};
Function *F = Worklist.front()->getIRPosition().getAssociatedFunction();
- emitRemark<OptimizationRemarkMissed>(F, "FixedPoint", Remark);
+ emitRemark<OptimizationRemarkMissed>(F, "Fixpoint", Remark);
}
LLVM_DEBUG(dbgs() << "\n[Attributor] Fixpoint iteration done after: "
@@ -1461,9 +1460,9 @@
});
if (VerifyMaxFixpointIterations &&
- IterationCounter != MaxFixedPointIterations) {
+ IterationCounter != MaxFixpointIterationsValue) {
errs() << "\n[Attributor] Fixpoint iteration done after: "
- << IterationCounter << "/" << MaxFixedPointIterations
+ << IterationCounter << "/" << MaxFixpointIterationsValue
<< " iterations\n";
llvm_unreachable("The fixpoint was not reached with exactly the number of "
"specified iterations!");
Index: llvm/include/llvm/Transforms/IPO/Attributor.h
===================================================================
--- llvm/include/llvm/Transforms/IPO/Attributor.h
+++ llvm/include/llvm/Transforms/IPO/Attributor.h
@@ -2004,7 +2004,7 @@
/// Whether to rewrite signatures.
const bool RewriteSignatures;
- /// Maximum number of fixedpoint iterations.
+ /// Maximum number of fixpoint iterations.
Optional<unsigned> MaxFixpointIterations;
/// A set to remember the functions we already assume to be live and visited.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D112162.381054.patch
Type: text/x-patch
Size: 4112 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211020/53d8cb08/attachment.bin>
More information about the llvm-commits
mailing list