[PATCH] D64125: [RISCV] Support @llvm.readcyclecounter() Intrinsic

Alex Bradbury via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 3 22:42:08 PDT 2019


asb added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVInstrInfo.td:1062
+let Predicates = [IsRV64] in
+def : Pat<(readcyclecounter), (CSRRS 0xC00, X0)>;
+// On RV32, ReadCycleWide is inserted and expanded to the suggested rdcycle[h] loop.
----------------
lenary wrote:
> simoncook wrote:
> > This should have a comment, like on line 611 which notes 0xc00 is a CSR address rather than a random constant.
> > 
> > (I also think it would be nice to have patterns select named InstAliases to use the `rdcycle` instruction alias directly, but it seems TableGen doesn't support doing such a thing)
> I'm going to wait for D64139 to land, and then use the constants introduced there.
Why not just rebase this patch on top of D64139?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64125/new/

https://reviews.llvm.org/D64125





More information about the llvm-commits mailing list