[llvm] [RISCV][GlobalISel] Select G_PTR_ADD (PR #67605)

Min-Yih Hsu via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 28 15:57:05 PDT 2023


================
@@ -225,9 +237,13 @@ bool RISCVInstructionSelector::select(MachineInstr &MI) {
 
   switch (Opc) {
   case TargetOpcode::G_ANYEXT:
-  case TargetOpcode::G_TRUNC:
+  case TargetOpcode::G_PTRTOINT:
+  case TargetOpcode::G_TRUNC: {
     MI.setDesc(TII.get(TargetOpcode::COPY));
+    bool Selected = selectCopy(MI, MRI);
+    assert(Selected && "Could not select copy!");
----------------
mshockwave wrote:

compilers might complain about unused `Selected` variable when assertion is disabled. So maybe we can `(void) Selected` or `return Selected;`.

https://github.com/llvm/llvm-project/pull/67605


More information about the llvm-commits mailing list