[PATCH] D148385: [RISCV] Implement KCFI operand bundle lowering

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 14 15:36:02 PDT 2023


MaskRay accepted this revision.
MaskRay added a comment.
This revision is now accepted and ready to land.

Will be good to wait a few days to give regular RISC-V backend developers a chance to leave any final comments.



================
Comment at: llvm/lib/Target/RISCV/RISCVAsmPrinter.cpp:332
+      continue;
+    while (!isRegAvailable(NextReg))
+      ++NextReg;
----------------
samitolvanen wrote:
> MaskRay wrote:
> > As a minor optimization to skip one redundant `isRegAvailable` call: `while (!isRegAvailable(++NextReg));`
> `Reg` != `NextReg` here, and using `while (!isRegAvailable(++NextReg))` would always skip the first alternative register by first incrementing `NextReg` before calling `isRegsAvailable`. What am I missing?
Ah you are right. Didn't notice the Reg/nextReg difference.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D148385



More information about the cfe-commits mailing list