[PATCH] D141568: [SCEV] Support SMin/Umin for GetMinTrailingZeros
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 12 00:31:47 PST 2023
nikic added inline comments.
================
Comment at: llvm/lib/Analysis/ScalarEvolution.cpp:6342
+ if (isa<SCEVAddExpr>(S) || isa<SCEVAddRecExpr>(S) || isa<SCEVSMaxExpr>(S) ||
+ isa<SCEVUMaxExpr>(S) || isa<SCEVSMinExpr>(S) || isa<SCEVUMinExpr>(S)) {
// The result is the min of all operands results.
----------------
While here, would you mind supporting UMinSeq as well?
================
Comment at: llvm/lib/Analysis/ScalarEvolution.cpp:6346
uint32_t MinOpRes = GetMinTrailingZeros(M->getOperand(0));
- for (unsigned i = 1, e = M->getNumOperands(); MinOpRes && i != e; ++i)
- MinOpRes = std::min(MinOpRes, GetMinTrailingZeros(M->getOperand(i)));
+ for (unsigned I = 1; MinOpRes && I != M->getNumOperands(); ++I)
+ MinOpRes = std::min(MinOpRes, GetMinTrailingZeros(M->getOperand(I)));
----------------
Any reason to deviate from the previous structure?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D141568/new/
https://reviews.llvm.org/D141568
More information about the llvm-commits
mailing list