[llvm] 8769a94 - [TableGen] Remove some unnecessary TreePatternNodePtrs. NFC
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 21 17:12:22 PDT 2023
Author: Craig Topper
Date: 2023-04-21T17:11:09-07:00
New Revision: 8769a945ebeb9df7028f9b495fa65dcccbb7d878
URL: https://github.com/llvm/llvm-project/commit/8769a945ebeb9df7028f9b495fa65dcccbb7d878
DIFF: https://github.com/llvm/llvm-project/commit/8769a945ebeb9df7028f9b495fa65dcccbb7d878.diff
LOG: [TableGen] Remove some unnecessary TreePatternNodePtrs. NFC
The patterns we're referring are still owned by the PatternToMatch
object. We don't need to increment their reference count here.
Added:
Modified:
llvm/utils/TableGen/CodeGenDAGPatterns.cpp
Removed:
################################################################################
diff --git a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
index 3a7452600595f..f861caa11687f 100644
--- a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
+++ b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
@@ -4399,11 +4399,11 @@ void CodeGenDAGPatterns::ExpandHwModeBasedTypes() {
};
for (PatternToMatch &P : Copy) {
- TreePatternNodePtr SrcP = nullptr, DstP = nullptr;
+ const TreePatternNode *SrcP = nullptr, *DstP = nullptr;
if (P.getSrcPattern()->hasProperTypeByHwMode())
- SrcP = P.getSrcPatternShared();
+ SrcP = P.getSrcPattern();
if (P.getDstPattern()->hasProperTypeByHwMode())
- DstP = P.getDstPatternShared();
+ DstP = P.getDstPattern();
if (!SrcP && !DstP) {
PatternsToMatch.push_back(P);
continue;
@@ -4411,9 +4411,9 @@ void CodeGenDAGPatterns::ExpandHwModeBasedTypes() {
std::set<unsigned> Modes;
if (SrcP)
- collectModes(Modes, SrcP.get());
+ collectModes(Modes, SrcP);
if (DstP)
- collectModes(Modes, DstP.get());
+ collectModes(Modes, DstP);
// The predicate for the default mode needs to be constructed for each
// pattern separately.
More information about the llvm-commits
mailing list