There is my diff.But when i run ./llvm-mc test -triple=riscv64 -show-encoding
, the mvin
still be recognized,i wish use -mattr=+mvin
before it is recognized.I don’t know why,I think def HasMvin : Predicate<"Subtarget->hasMvin()">;
is wrong,but i do not know how to change it.Is there a tablegen print function just like printf in c here? I want to see the corresponding value when llvm-mc runs. If anyone can help me, I would be grateful.
diff --git a/llvm/lib/Target/RISCV/RISCV.td b/llvm/lib/Target/RISCV/RISCV.td
index 32cbd479bea3..f981f87d41d6 100644
--- a/llvm/lib/Target/RISCV/RISCV.td
+++ b/llvm/lib/Target/RISCV/RISCV.td
@@ -12,11 +12,6 @@ include "llvm/Target/Target.td"
// RISC-V subtarget features and instruction predicates.
//===----------------------------------------------------------------------===//
-def FeatureMvin
- : SubtargetFeature<"mvin", "HasMvin", "true", "test mvin">;
-
-def HasMvin : Predicate<"Subtarget->hasMvin()">;
-
def FeatureStdExtM
: SubtargetFeature<"m", "HasStdExtM", "true",
"'M' (Integer Multiplication and Division)">;
diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfo.td b/llvm/lib/Target/RISCV/RISCVInstrInfo.td
index 777ff33f6b30..0af53bb63c9e 100644
--- a/llvm/lib/Target/RISCV/RISCVInstrInfo.td
+++ b/llvm/lib/Target/RISCV/RISCVInstrInfo.td
@@ -598,10 +598,6 @@ class Priv_rr<string opcodestr, bits<7> funct7>
// Instructions
//===----------------------------------------------------------------------===//
-let hasSideEffects = 0, mayLoad = 0, mayStore = 0, Predicates = [HasMvin] in
-def mvin : RVInstR<0b0000000, 0b000, OPC_CUSTOM_0,(outs GPR:$rd),
- (ins GPR:$rs1,GPR:$rs2), "mvin","$rd, $rs1">;
-
let hasSideEffects = 0, mayLoad = 0, mayStore = 0 in {
let isReMaterializable = 1, isAsCheapAsAMove = 1 in
def LUI : RVInstU<OPC_LUI, (outs GPR:$rd), (ins uimm20_lui:$imm20),
diff --git a/llvm/lib/Target/RISCV/RISCVSubtarget.h b/llvm/lib/Target/RISCV/RISCVSubtarget.h
index c0d25ddd6f15..066ad3f55055 100644
--- a/llvm/lib/Target/RISCV/RISCVSubtarget.h
+++ b/llvm/lib/Target/RISCV/RISCVSubtarget.h
@@ -44,7 +44,6 @@ private:
RISCVProcFamilyEnum RISCVProcFamily = Others;
- bool HasMvin = false;
bool HasStdExtM = false;
bool HasStdExtA = false;
bool HasStdExtF = false;
@@ -155,7 +154,6 @@ public:
/// initializeProperties().
RISCVProcFamilyEnum getProcFamily() const { return RISCVProcFamily; }
- bool hasMvin() const { return HasMvin; }
bool hasStdExtM() const { return HasStdExtM; }
bool hasStdExtA() const { return HasStdExtA; }
bool hasStdExtF() const { return HasStdExtF; }