@@ -641,7 +641,7 @@ static AttributeList get_attrs_box_float(LLVMContext &C, unsigned nbytes)
641641 auto FnAttrs = AttrBuilder (C);
642642 FnAttrs.addAttribute (Attribute::WillReturn);
643643 FnAttrs.addAttribute (Attribute::NoUnwind);
644- FnAttrs.addMemoryAttr (MemoryEffects::inaccessibleMemOnly ());
644+ FnAttrs.addMemoryAttr (MemoryEffects::inaccessibleMemOnly () | MemoryEffects::readOnly () );
645645 auto RetAttrs = AttrBuilder (C);
646646 RetAttrs.addAttribute (Attribute::NonNull);
647647 RetAttrs.addDereferenceableAttr (nbytes);
@@ -657,7 +657,7 @@ static AttributeList get_attrs_box_sext(LLVMContext &C, unsigned nbytes)
657657 auto FnAttrs = AttrBuilder (C);
658658 FnAttrs.addAttribute (Attribute::WillReturn);
659659 FnAttrs.addAttribute (Attribute::NoUnwind);
660- FnAttrs.addMemoryAttr (MemoryEffects::inaccessibleMemOnly ());
660+ FnAttrs.addMemoryAttr (MemoryEffects::inaccessibleMemOnly () | MemoryEffects::readOnly () );
661661 auto RetAttrs = AttrBuilder (C);
662662 RetAttrs.addAttribute (Attribute::NonNull);
663663 RetAttrs.addAttribute (Attribute::getWithDereferenceableBytes (C, nbytes));
@@ -674,7 +674,7 @@ static AttributeList get_attrs_box_zext(LLVMContext &C, unsigned nbytes)
674674 auto FnAttrs = AttrBuilder (C);
675675 FnAttrs.addAttribute (Attribute::WillReturn);
676676 FnAttrs.addAttribute (Attribute::NoUnwind);
677- FnAttrs.addMemoryAttr (MemoryEffects::inaccessibleMemOnly ());
677+ FnAttrs.addMemoryAttr (MemoryEffects::inaccessibleMemOnly () | MemoryEffects::readOnly () );
678678 auto RetAttrs = AttrBuilder (C);
679679 RetAttrs.addAttribute (Attribute::NonNull);
680680 RetAttrs.addDereferenceableAttr (nbytes);
@@ -1125,7 +1125,7 @@ static const auto jl_alloc_obj_func = new JuliaFunction<TypeFnContextAndSizeT>{
11251125 auto FnAttrs = AttrBuilder (C);
11261126 FnAttrs.addAllocSizeAttr (1 , None); // returns %1 bytes
11271127 FnAttrs.addAllocKindAttr (AllocFnKind::Alloc);
1128- FnAttrs.addMemoryAttr (MemoryEffects::argMemOnly (ModRefInfo::Ref) | MemoryEffects::inaccessibleMemOnly (ModRefInfo::ModRef ));
1128+ FnAttrs.addMemoryAttr (MemoryEffects::argMemOnly (ModRefInfo::Ref) | MemoryEffects::inaccessibleMemOnly ());
11291129 FnAttrs.addAttribute (Attribute::WillReturn);
11301130 FnAttrs.addAttribute (Attribute::NoUnwind);
11311131 auto RetAttrs = AttrBuilder (C);
@@ -1149,7 +1149,7 @@ static const auto jl_alloc_genericmemory_unchecked_func = new JuliaFunction<Type
11491149 [](LLVMContext &C) {
11501150 auto FnAttrs = AttrBuilder (C);
11511151 FnAttrs.addAllocKindAttr (AllocFnKind::Alloc);
1152- FnAttrs.addMemoryAttr (MemoryEffects::argMemOnly (ModRefInfo::Ref) | MemoryEffects::inaccessibleMemOnly (ModRefInfo::ModRef ));
1152+ FnAttrs.addMemoryAttr (MemoryEffects::argMemOnly (ModRefInfo::Ref) | MemoryEffects::inaccessibleMemOnly ());
11531153 FnAttrs.addAttribute (Attribute::WillReturn);
11541154 FnAttrs.addAttribute (Attribute::NoUnwind);
11551155 auto RetAttrs = AttrBuilder (C);
@@ -1394,7 +1394,7 @@ static const auto jl_allocgenericmemory = new JuliaFunction<TypeFnContextAndSize
13941394 [](LLVMContext &C) {
13951395 AttrBuilder FnAttrs (C);
13961396 AttrBuilder RetAttrs (C);
1397- FnAttrs.addMemoryAttr (MemoryEffects::inaccessibleMemOnly (ModRefInfo::ModRef ) | MemoryEffects::argMemOnly (ModRefInfo::Ref ));
1397+ FnAttrs.addMemoryAttr (MemoryEffects::inaccessibleMemOnly () | MemoryEffects::readOnly ( ));
13981398 FnAttrs.addAttribute (Attribute::WillReturn);
13991399 RetAttrs.addAlignmentAttr (Align (16 ));
14001400 RetAttrs.addAttribute (Attribute::NonNull);
@@ -1438,7 +1438,7 @@ static const auto jldnd_func = new JuliaFunction<>{
14381438 },
14391439 [](LLVMContext &C) {
14401440 AttrBuilder FnAttrs (C);
1441- FnAttrs.addMemoryAttr (MemoryEffects::inaccessibleMemOnly ());
1441+ FnAttrs.addMemoryAttr (MemoryEffects::inaccessibleMemOnly () | MemoryEffects::readOnly () );
14421442 FnAttrs.addAttribute (Attribute::WillReturn);
14431443 FnAttrs.addAttribute (Attribute::NoUnwind);
14441444 return AttributeList::get (C,
0 commit comments