[llvm-branch-commits] [llvm] 92fb5c4 - [SLP] rename variable to improve readability; NFC
Sanjay Patel via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Jan 12 13:10:09 PST 2021
Author: Sanjay Patel
Date: 2021-01-12T16:03:57-05:00
New Revision: 92fb5c49e8aa53ac97fa2fb1a891a4d7ccfd75c5
URL: https://github.com/llvm/llvm-project/commit/92fb5c49e8aa53ac97fa2fb1a891a4d7ccfd75c5
DIFF: https://github.com/llvm/llvm-project/commit/92fb5c49e8aa53ac97fa2fb1a891a4d7ccfd75c5.diff
LOG: [SLP] rename variable to improve readability; NFC
The OperationData in the 2nd block (visiting the operands)
is completely independent of the 1st block.
Added:
Modified:
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index 04bdc74c7879..1ef762c9dfa7 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -6826,7 +6826,7 @@ class HorizontalReduction {
while (!Stack.empty()) {
Instruction *TreeN = Stack.back().first;
unsigned EdgeToVisit = Stack.back().second++;
- OperationData OpData = getOperationData(TreeN);
+ const OperationData OpData = getOperationData(TreeN);
bool IsReducedValue = OpData != RdxTreeInst;
// Postorder vist.
@@ -6858,14 +6858,14 @@ class HorizontalReduction {
// Visit left or right.
Value *NextV = TreeN->getOperand(EdgeToVisit);
auto *I = dyn_cast<Instruction>(NextV);
- OpData = getOperationData(I);
+ const OperationData EdgeOpData = getOperationData(I);
// Continue analysis if the next operand is a reduction operation or
// (possibly) a reduced value. If the reduced value opcode is not set,
// the first met operation != reduction operation is considered as the
// reduced value class.
- const bool IsRdxInst = OpData == RdxTreeInst;
+ const bool IsRdxInst = EdgeOpData == RdxTreeInst;
if (I && I != Phi &&
- (!RdxLeafVal || OpData == RdxLeafVal || IsRdxInst)) {
+ (!RdxLeafVal || EdgeOpData == RdxLeafVal || IsRdxInst)) {
// Only handle trees in the current basic block.
// Each tree node needs to have minimal number of users except for the
// ultimate reduction.
@@ -6873,21 +6873,21 @@ class HorizontalReduction {
RdxTreeInst.hasRequiredNumberOfUses(I, IsRdxInst) && I != B) {
if (IsRdxInst) {
// We need to be able to reassociate the reduction operations.
- if (!OpData.isAssociative(I)) {
+ if (!EdgeOpData.isAssociative(I)) {
// I is an extra argument for TreeN (its parent operation).
markExtraArg(Stack.back(), I);
continue;
}
- } else if (RdxLeafVal && RdxLeafVal != OpData) {
+ } else if (RdxLeafVal && RdxLeafVal != EdgeOpData) {
// Make sure that the opcodes of the operations that we are going to
// reduce match.
// I is an extra argument for TreeN (its parent operation).
markExtraArg(Stack.back(), I);
continue;
} else if (!RdxLeafVal) {
- RdxLeafVal = OpData;
+ RdxLeafVal = EdgeOpData;
}
- Stack.push_back(std::make_pair(I, OpData.getFirstOperandIndex()));
+ Stack.push_back(std::make_pair(I, EdgeOpData.getFirstOperandIndex()));
continue;
}
}
More information about the llvm-branch-commits
mailing list