[PATCH] D92786: [RISCV] Remove custom isel code for RISCVISD::READ_CYCLE_WIDE
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 8 10:26:22 PST 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rG3e86fbc97189: [RISCV] Replace custom isel code for RISCVISD::READ_CYCLE_WIDE with isel pattern (authored by craig.topper).
Herald added a subscriber: jrtc27.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D92786/new/
https://reviews.llvm.org/D92786
Files:
llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
llvm/lib/Target/RISCV/RISCVInstrInfo.td
Index: llvm/lib/Target/RISCV/RISCVInstrInfo.td
===================================================================
--- llvm/lib/Target/RISCV/RISCVInstrInfo.td
+++ llvm/lib/Target/RISCV/RISCVInstrInfo.td
@@ -25,6 +25,8 @@
def SDT_RISCVSelectCC : SDTypeProfile<1, 5, [SDTCisSameAs<1, 2>,
SDTCisSameAs<0, 4>,
SDTCisSameAs<4, 5>]>;
+def SDT_RISCVReadCycleWide : SDTypeProfile<2, 0, [SDTCisVT<0, i32>,
+ SDTCisVT<1, i32>]>;
// Target-independent nodes, but with target-specific formats.
def callseq_start : SDNode<"ISD::CALLSEQ_START", SDT_CallSeqStart,
@@ -52,6 +54,10 @@
def riscv_sraw : SDNode<"RISCVISD::SRAW", SDTIntShiftOp>;
def riscv_srlw : SDNode<"RISCVISD::SRLW", SDTIntShiftOp>;
+def riscv_read_cycle_wide : SDNode<"RISCVISD::READ_CYCLE_WIDE",
+ SDT_RISCVReadCycleWide,
+ [SDNPHasChain, SDNPSideEffect]>;
+
//===----------------------------------------------------------------------===//
// Operand and SDNode transformation definitions.
//===----------------------------------------------------------------------===//
@@ -1170,9 +1176,10 @@
def : Pat<(readcyclecounter), (CSRRS CYCLE.Encoding, X0)>;
// On RV32, ReadCycleWide will be expanded to the suggested loop reading both
// halves of the 64-bit "cycle" CSR.
-let Predicates = [IsRV32], usesCustomInserter = 1, hasSideEffects = 0,
-mayLoad = 0, mayStore = 0, hasNoSchedulingInfo = 1 in
-def ReadCycleWide : Pseudo<(outs GPR:$lo, GPR:$hi), (ins), [], "", "">;
+let Predicates = [IsRV32], usesCustomInserter = 1, hasNoSchedulingInfo = 1 in
+def ReadCycleWide : Pseudo<(outs GPR:$lo, GPR:$hi), (ins),
+ [(set GPR:$lo, GPR:$hi, (riscv_read_cycle_wide))],
+ "", "">;
/// traps
Index: llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
===================================================================
--- llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
+++ llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
@@ -143,13 +143,6 @@
}
break;
}
- case RISCVISD::READ_CYCLE_WIDE:
- assert(!Subtarget->is64Bit() && "READ_CYCLE_WIDE is only used on riscv32");
-
- ReplaceNode(Node, CurDAG->getMachineNode(RISCV::ReadCycleWide, DL, MVT::i32,
- MVT::i32, MVT::Other,
- Node->getOperand(0)));
- return;
}
// Select the default instruction.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92786.310271.patch
Type: text/x-patch
Size: 2580 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201208/93c7a0cb/attachment.bin>
More information about the llvm-commits
mailing list