Skip to content

Commit f46da9e

Browse files
committed
mark integer parameters as sext/zext
1 parent 399f8ba commit f46da9e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/codegen.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5668,6 +5668,11 @@ static jl_returninfo_t get_specsig_function(jl_codectx_t &ctx, Module *M, String
56685668
else if (isboxed && jl_is_immutable_datatype(jt)) {
56695669
attributes = attributes.addParamAttribute(jl_LLVMContext, argno, Attribute::ReadOnly);
56705670
}
5671+
else if (jl_is_primitivetype(jt) && ty->isIntegerTy()) {
5672+
bool issigned = jl_signed_type && jl_subtype(jt, (jl_value_t*)jl_signed_type);
5673+
Attribute::AttrKind attr = issigned ? Attribute::SExt : Attribute::ZExt;
5674+
attributes = attributes.addParamAttribute(jl_LLVMContext, argno, attr);
5675+
}
56715676
fsig.push_back(ty);
56725677
}
56735678

0 commit comments

Comments
 (0)