[llvm-branch-commits] [llvm] [3/7][PISA] Add PISA register file, instruction set, and MC layer (PR #214107)
Craig Topper via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Nov 3 14:49:27 PST 2026
================
@@ -14,21 +14,288 @@
#include "PISARegisterInfo.h"
#include "PISA.h"
#include "PISASubtarget.h"
+#include "llvm/ADT/ArrayRef.h"
+#include "llvm/ADT/StringRef.h"
+#include "llvm/ADT/StringTable.h"
#include "llvm/CodeGen/MachineFunction.h"
#define GET_REGINFO_TARGET_DESC
#include "PISAGenRegisterInfo.inc"
using namespace llvm;
-PISARegisterInfo::PISARegisterInfo() : PISAGenRegisterInfo(PISA::DummyReg) {}
+namespace {
+struct SpecialRegEntry {
+ StringTable::Offset Name;
+};
+
+#ifdef __GNUC__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wunused-function"
+#endif
+#define GET_SpecialRegNames_IMPL
+#include "PISAGenSearchableTables.inc"
+#ifdef __GNUC__
+#pragma GCC diagnostic pop
+#endif
+} // anonymous namespace
+
+static_assert(PISA::NUM_TARGET_SUBREGS == 63, "updated needed!");
+DenseMap<unsigned, PISARegisterInfo::SwizzleDesc> PISARegisterInfo::SwizzleMap =
----------------
topperc wrote:
I don't think we should have a global variable DenseMap. That will requires a constructor call at application start. https://llvm.org/docs/CodingStandards.html#do-not-use-static-constructors
A simple solution might be to make a static variable inside a `getSwizzleMap` function. That will construct it on the first call.
https://github.com/llvm/llvm-project/pull/214107
More information about the llvm-branch-commits
mailing list