Skip to content

Commit

Permalink
[mono][llvm] Fix the emission of nonnull metadata on loads. (#86071)
Browse files Browse the repository at this point in the history
Fixes llvm verification errors in newer llvm versions:
```
nonnull metadata must be empty
   %49 = load ptr, ptr @aotconst_ldstr_21, align 8, !nonnull !1
```
  • Loading branch information
vargaz authored May 11, 2023
1 parent a3b765e commit 51876ee
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/mono/mono/mini/mini-llvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -2419,14 +2419,12 @@ set_metadata_flag (LLVMValueRef v, const char *flag_name)
static void
set_nonnull_load_flag (LLVMValueRef v)
{
LLVMValueRef md_arg;
int md_kind;
const char *flag_name;

flag_name = "nonnull";
md_kind = LLVMGetMDKindID (flag_name, (unsigned int)strlen (flag_name));
md_arg = md_string ("<index>");
LLVMSetMetadata (v, md_kind, LLVMMDNode (&md_arg, 1));
LLVMSetMetadata (v, md_kind, LLVMMDNode (NULL, 0));
}

static void
Expand Down

0 comments on commit 51876ee

Please sign in to comment.