================
@@ -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
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits