Skip to content

Commit

Permalink
mark integer parameters as sext/zext
Browse files Browse the repository at this point in the history
  • Loading branch information
vchuravy committed Jan 6, 2021
1 parent 399f8ba commit f46da9e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5668,6 +5668,11 @@ static jl_returninfo_t get_specsig_function(jl_codectx_t &ctx, Module *M, String
else if (isboxed && jl_is_immutable_datatype(jt)) {
attributes = attributes.addParamAttribute(jl_LLVMContext, argno, Attribute::ReadOnly);
}
else if (jl_is_primitivetype(jt) && ty->isIntegerTy()) {
bool issigned = jl_signed_type && jl_subtype(jt, (jl_value_t*)jl_signed_type);
Attribute::AttrKind attr = issigned ? Attribute::SExt : Attribute::ZExt;
attributes = attributes.addParamAttribute(jl_LLVMContext, argno, attr);
}
fsig.push_back(ty);
}

Expand Down

0 comments on commit f46da9e

Please sign in to comment.