Skip to content

Commit 45582ed

Browse files
committed
[SandboxVec][DAG][NFC] Rename isMemDepCandidate() to isMemDepNodeCandidate()
1 parent 9c99e07 commit 45582ed

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@ class DGNode {
5555

5656
public:
5757
DGNode(Instruction *I) : I(I), SubclassID(DGNodeID::DGNode) {
58-
assert(!isMemDepCandidate(I) && "Expected Non-Mem instruction, ");
58+
assert(!isMemDepNodeCandidate(I) && "Expected Non-Mem instruction, ");
5959
}
6060
DGNode(const DGNode &Other) = delete;
6161
virtual ~DGNode() = default;
6262
/// \Returns true if this is before \p Other in program order.
6363
bool comesBefore(const DGNode *Other) { return I->comesBefore(Other->I); }
6464
/// \Returns true if \p I is a memory dependency candidate instruction.
65-
static bool isMemDepCandidate(Instruction *I) {
65+
static bool isMemDepNodeCandidate(Instruction *I) {
6666
AllocaInst *Alloca;
6767
return Utils::isMemDepCandidate(I) ||
6868
((Alloca = dyn_cast<AllocaInst>(I)) &&
@@ -106,7 +106,7 @@ class MemDGNode final : public DGNode {
106106

107107
public:
108108
MemDGNode(Instruction *I) : DGNode(I, DGNodeID::MemDGNode) {
109-
assert(isMemDepCandidate(I) && "Expected Mem instruction!");
109+
assert(isMemDepNodeCandidate(I) && "Expected Mem instruction!");
110110
}
111111
static bool classof(const DGNode *Other) {
112112
return Other->SubclassID == DGNodeID::MemDGNode;
@@ -150,7 +150,7 @@ class DependencyGraph {
150150
DGNode *getOrCreateNode(Instruction *I) {
151151
auto [It, NotInMap] = InstrToNodeMap.try_emplace(I);
152152
if (NotInMap) {
153-
if (DGNode::isMemDepCandidate(I))
153+
if (DGNode::isMemDepNodeCandidate(I))
154154
It->second = std::make_unique<MemDGNode>(I);
155155
else
156156
It->second = std::make_unique<DGNode>(I);

llvm/lib/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ MemDGNodeIntervalBuilder::make(const Interval<Instruction> &Instrs,
3838
// walk down/up the chain and find the mem-dep ones.
3939
Instruction *MemTopI = Instrs.top();
4040
Instruction *MemBotI = Instrs.bottom();
41-
while (!DGNode::isMemDepCandidate(MemTopI) && MemTopI != MemBotI)
41+
while (!DGNode::isMemDepNodeCandidate(MemTopI) && MemTopI != MemBotI)
4242
MemTopI = MemTopI->getNextNode();
43-
while (!DGNode::isMemDepCandidate(MemBotI) && MemBotI != MemTopI)
43+
while (!DGNode::isMemDepNodeCandidate(MemBotI) && MemBotI != MemTopI)
4444
MemBotI = MemBotI->getPrevNode();
4545
// If we couldn't find a mem node in range TopN - BotN then it's empty.
46-
if (!DGNode::isMemDepCandidate(MemTopI))
46+
if (!DGNode::isMemDepNodeCandidate(MemTopI))
4747
return {};
4848
// Now that we have the mem-dep nodes, create and return the range.
4949
return Interval<MemDGNode>(cast<MemDGNode>(DAG.getNode(MemTopI)),

0 commit comments

Comments
 (0)