[clang] [CIR][RISCV] Support Zihintntl builtins (PR #205468)

Andy Kaylor via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 15 10:55:28 PDT 2026


================
@@ -154,9 +160,31 @@ CIRGenFunction::emitRISCVBuiltinExpr(unsigned builtinID, const CallExpr *e) {
   // Zihintntl
   case RISCV::BI__builtin_riscv_ntl_load:
   case RISCV::BI__builtin_riscv_ntl_store: {
-    cgm.errorNYI(e->getSourceRange(),
-                 std::string("unimplemented RISC-V builtin call: ") +
-                     getContext().BuiltinInfo.getName(builtinID));
+    unsigned domainVal = 5; // Default __RISCV_NTLH_ALL
----------------
andykaylor wrote:

I see that this is a numeric literal with the same comment in classic codegen too. I wish we could connect the `clang/lib/Headers/riscv_ntlh.h` header file, which does define `__RISCV_NTLH_ALL` as 5. That doesn't necessarily need to be done as part of this PR.

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


More information about the cfe-commits mailing list