[llvm] 9372662 - fixup: Missing operator in [globalisel][legalizer] Separate the deprecated LegalizerInfo from the current one
Daniel Sanders via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 1 13:58:15 PDT 2021
Author: Daniel Sanders
Date: 2021-06-01T13:58:03-07:00
New Revision: 937266205026052c413acee73da7be5e254cc2c9
URL: https://github.com/llvm/llvm-project/commit/937266205026052c413acee73da7be5e254cc2c9
DIFF: https://github.com/llvm/llvm-project/commit/937266205026052c413acee73da7be5e254cc2c9.diff
LOG: fixup: Missing operator in [globalisel][legalizer] Separate the deprecated LegalizerInfo from the current one
My local compiler was fine with it but the bots complain about ambiguous types.
Added:
Modified:
llvm/include/llvm/CodeGen/GlobalISel/LegacyLegalizerInfo.h
llvm/lib/CodeGen/GlobalISel/LegacyLegalizerInfo.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/LegacyLegalizerInfo.h b/llvm/include/llvm/CodeGen/GlobalISel/LegacyLegalizerInfo.h
index fb616d2d5fda..b1f2103da309 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/LegacyLegalizerInfo.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/LegacyLegalizerInfo.h
@@ -74,6 +74,8 @@ enum LegacyLegalizeAction : std::uint8_t {
NotFound,
};
} // end namespace LegacyLegalizeActions
+raw_ostream &operator<<(raw_ostream &OS,
+ LegacyLegalizeActions::LegacyLegalizeAction Action);
/// Legalization is decided based on an instruction's opcode, which type slot
/// we're considering, and what the existing type is. These aspects are gathered
diff --git a/llvm/lib/CodeGen/GlobalISel/LegacyLegalizerInfo.cpp b/llvm/lib/CodeGen/GlobalISel/LegacyLegalizerInfo.cpp
index f7e68e2691cf..364100d1137a 100644
--- a/llvm/lib/CodeGen/GlobalISel/LegacyLegalizerInfo.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/LegacyLegalizerInfo.cpp
@@ -25,6 +25,45 @@ using namespace LegacyLegalizeActions;
#define DEBUG_TYPE "legalizer-info"
+raw_ostream &llvm::operator<<(raw_ostream &OS, LegacyLegalizeAction Action) {
+ switch (Action) {
+ case Legal:
+ OS << "Legal";
+ break;
+ case NarrowScalar:
+ OS << "NarrowScalar";
+ break;
+ case WidenScalar:
+ OS << "WidenScalar";
+ break;
+ case FewerElements:
+ OS << "FewerElements";
+ break;
+ case MoreElements:
+ OS << "MoreElements";
+ break;
+ case Bitcast:
+ OS << "Bitcast";
+ break;
+ case Lower:
+ OS << "Lower";
+ break;
+ case Libcall:
+ OS << "Libcall";
+ break;
+ case Custom:
+ OS << "Custom";
+ break;
+ case Unsupported:
+ OS << "Unsupported";
+ break;
+ case NotFound:
+ OS << "NotFound";
+ break;
+ }
+ return OS;
+}
+
LegacyLegalizerInfo::LegacyLegalizerInfo() : TablesInitialized(false) {
// Set defaults.
// FIXME: these two (G_ANYEXT and G_TRUNC?) can be legalized to the
More information about the llvm-commits
mailing list