[PATCH] D158504: [RISCV][GlobalISel] Select G_CONSTANT

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 22 10:39:34 PDT 2023


craig.topper added inline comments.


================
Comment at: llvm/lib/Target/RISCV/GISel/RISCVInstructionSelector.cpp:131
+  Register DstReg;
+  MachineInstr *Result;
+  unsigned i;
----------------
Declare `Result` inside the loop.


================
Comment at: llvm/lib/Target/RISCV/GISel/RISCVInstructionSelector.cpp:134
+
+  for (i = 0; i < NumInsts; i++) {
+    DstReg = i < NumInsts - 1 ? MRI.createVirtualRegister(&RISCV::GPRRegClass)
----------------
Declare `i` here instead of outside the loop


================
Comment at: llvm/lib/Target/RISCV/GISel/RISCVInstructionSelector.cpp:135
+  for (i = 0; i < NumInsts; i++) {
+    DstReg = i < NumInsts - 1 ? MRI.createVirtualRegister(&RISCV::GPRRegClass)
+                              : FinalReg;
----------------
Declare DstReg here instead of outside the loop.


================
Comment at: llvm/test/CodeGen/RISCV/GlobalISel/instruction-select/constant32.mir:2
+# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
+# RUN: llc -mtriple=riscv32 -run-pass=instruction-select %s -o - \
+# RUN: | FileCheck %s
----------------
What about riscv64?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D158504



More information about the llvm-commits mailing list