Fix case where occasionally atomic_load would miscompile.

This commit is contained in:
Christoffer Lerno
2025-03-05 01:58:07 +01:00
parent 28b1e4d182
commit cf0405930e
6 changed files with 13 additions and 9 deletions

View File

@@ -3064,6 +3064,8 @@ void llvm_emit_int_comp_raw(GenContext *c, BEValue *result, Type *lhs_type, Type
}
}
}
ASSERT(LLVMTypeOf(lhs_value) == LLVMTypeOf(rhs_value));
if (lhs_signed && !rhs_signed && !vector_type && llvm_is_const(lhs_value) && type_size(lhs_type) <= 8)
{
long long val = LLVMConstIntGetSExtValue(lhs_value);