[PATCH] D131778: [DAGCombine] Replace std::monostate equivalent in DAGCombiner.cpp
Joe Loser via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 12 14:10:12 PDT 2022
jloser updated this revision to Diff 452301.
jloser added a comment.
Fix reference to `Unit`. Use `std::monostate{}` instead.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D131778/new/
https://reviews.llvm.org/D131778
Files:
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
===================================================================
--- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -72,6 +72,7 @@
#include <string>
#include <tuple>
#include <utility>
+#include <variant>
using namespace llvm;
@@ -24943,13 +24944,6 @@
return DAG.getTokenFactor(SDLoc(N), Aliases);
}
-namespace {
-// TODO: Replace with with std::monostate when we move to C++17.
-struct UnitT { } Unit;
-bool operator==(const UnitT &, const UnitT &) { return true; }
-bool operator!=(const UnitT &, const UnitT &) { return false; }
-} // namespace
-
// This function tries to collect a bunch of potentially interesting
// nodes to improve the chains of, all at once. This might seem
// redundant, as this function gets called when visiting every store
@@ -24970,8 +24964,8 @@
// the common case, every store writes to the immediately previous address
// space and thus merged with the previous interval at insertion time.
- using IMap =
- llvm::IntervalMap<int64_t, UnitT, 8, IntervalMapHalfOpenInfo<int64_t>>;
+ using IMap = llvm::IntervalMap<int64_t, std::monostate, 8,
+ IntervalMapHalfOpenInfo<int64_t>>;
IMap::Allocator A;
IMap Intervals(A);
@@ -24998,7 +24992,8 @@
return false;
// Add ST's interval.
- Intervals.insert(0, (St->getMemoryVT().getSizeInBits() + 7) / 8, Unit);
+ Intervals.insert(0, (St->getMemoryVT().getSizeInBits() + 7) / 8,
+ std::monostate{});
while (StoreSDNode *Chain = dyn_cast<StoreSDNode>(STChain->getChain())) {
if (Chain->getMemoryVT().isScalableVector())
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131778.452301.patch
Type: text/x-patch
Size: 1708 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220812/ce41e028/attachment.bin>
More information about the llvm-commits
mailing list