[llvm] 45582ed - [SandboxVec][DAG][NFC] Rename isMemDepCandidate() to isMemDepNodeCandidate()
Vasileios Porpodas via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 3 10:40:01 PDT 2024
Author: Vasileios Porpodas
Date: 2024-10-03T10:39:10-07:00
New Revision: 45582ed2406fa3c094033da69d11e0d26156da15
URL: https://github.com/llvm/llvm-project/commit/45582ed2406fa3c094033da69d11e0d26156da15
DIFF: https://github.com/llvm/llvm-project/commit/45582ed2406fa3c094033da69d11e0d26156da15.diff
LOG: [SandboxVec][DAG][NFC] Rename isMemDepCandidate() to isMemDepNodeCandidate()
Added:
Modified:
llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.h
llvm/lib/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.h b/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.h
index 5b2089791decb0..2a17e90d7dab84 100644
--- a/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.h
+++ b/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.h
@@ -55,14 +55,14 @@ class DGNode {
public:
DGNode(Instruction *I) : I(I), SubclassID(DGNodeID::DGNode) {
- assert(!isMemDepCandidate(I) && "Expected Non-Mem instruction, ");
+ assert(!isMemDepNodeCandidate(I) && "Expected Non-Mem instruction, ");
}
DGNode(const DGNode &Other) = delete;
virtual ~DGNode() = default;
/// \Returns true if this is before \p Other in program order.
bool comesBefore(const DGNode *Other) { return I->comesBefore(Other->I); }
/// \Returns true if \p I is a memory dependency candidate instruction.
- static bool isMemDepCandidate(Instruction *I) {
+ static bool isMemDepNodeCandidate(Instruction *I) {
AllocaInst *Alloca;
return Utils::isMemDepCandidate(I) ||
((Alloca = dyn_cast<AllocaInst>(I)) &&
@@ -106,7 +106,7 @@ class MemDGNode final : public DGNode {
public:
MemDGNode(Instruction *I) : DGNode(I, DGNodeID::MemDGNode) {
- assert(isMemDepCandidate(I) && "Expected Mem instruction!");
+ assert(isMemDepNodeCandidate(I) && "Expected Mem instruction!");
}
static bool classof(const DGNode *Other) {
return Other->SubclassID == DGNodeID::MemDGNode;
@@ -150,7 +150,7 @@ class DependencyGraph {
DGNode *getOrCreateNode(Instruction *I) {
auto [It, NotInMap] = InstrToNodeMap.try_emplace(I);
if (NotInMap) {
- if (DGNode::isMemDepCandidate(I))
+ if (DGNode::isMemDepNodeCandidate(I))
It->second = std::make_unique<MemDGNode>(I);
else
It->second = std::make_unique<DGNode>(I);
diff --git a/llvm/lib/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.cpp b/llvm/lib/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.cpp
index ce295e8bf5df3f..10da07c24940dd 100644
--- a/llvm/lib/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.cpp
+++ b/llvm/lib/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.cpp
@@ -38,12 +38,12 @@ MemDGNodeIntervalBuilder::make(const Interval<Instruction> &Instrs,
// walk down/up the chain and find the mem-dep ones.
Instruction *MemTopI = Instrs.top();
Instruction *MemBotI = Instrs.bottom();
- while (!DGNode::isMemDepCandidate(MemTopI) && MemTopI != MemBotI)
+ while (!DGNode::isMemDepNodeCandidate(MemTopI) && MemTopI != MemBotI)
MemTopI = MemTopI->getNextNode();
- while (!DGNode::isMemDepCandidate(MemBotI) && MemBotI != MemTopI)
+ while (!DGNode::isMemDepNodeCandidate(MemBotI) && MemBotI != MemTopI)
MemBotI = MemBotI->getPrevNode();
// If we couldn't find a mem node in range TopN - BotN then it's empty.
- if (!DGNode::isMemDepCandidate(MemTopI))
+ if (!DGNode::isMemDepNodeCandidate(MemTopI))
return {};
// Now that we have the mem-dep nodes, create and return the range.
return Interval<MemDGNode>(cast<MemDGNode>(DAG.getNode(MemTopI)),
More information about the llvm-commits
mailing list