[PATCH] D151979: [RISCV] Handle "o" inline asm memory constraint

Jessica Clarke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 2 01:17:12 PDT 2023


jrtc27 added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp:2147
   default:
-    break;
+    llvm_unreachable(("Unexpected asm memory constraint " +
+                      InlineAsm::getMemConstraintName(ConstraintID).str())
----------------
report_fatal_error? llvm_unreachable doesn't always print its message, doesn't always print at all, and doesn't always even abort; in the worst case it ends up being a __builtin_unreachable() that tells the compiler to assume the case can't happen.


================
Comment at: llvm/test/CodeGen/RISCV/inline-asm.ll:116
+; RV64I-NEXT:    ret
+  call void asm sideeffect "", "=*o"(ptr elementtype(i32) %a)
+  ret void
----------------
The implementation could be completely broken and this would be none the wiser. You need to test the implementation actually lowers it to something sensible, not that it doesn't crash.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D151979



More information about the llvm-commits mailing list