================
@@ -214,30 +214,35 @@ mlir::ArrayAttr updateArgAttrs(mlir::MLIRContext *ctx,
attrs.set(attrName, builder.getUnitAttr());
newArgAttrs.push_back(attrs.getDictionary(ctx));
} else if (ac.kind == ArgKind::Indirect) {
- // byval: caller-allocated copy; callee receives pointer to copy.
- // byref: callee receives pointer to the caller's original storage.
- // Both use llvm.align(A). The ownership flag differs: llvm.byval(T)
- // vs llvm.byref(T). Both are typed attributes carrying the pointee
- // type T (the pre-rewrite arg type); T is recorded explicitly because
- // it cannot be recovered from the opaque LLVM pointer after lowering.
+ // byval hands the callee its own copy. Without byval it gets a pointer
+ // to the caller's own object. Both state llvm.align and llvm.noundef,
+ // which constrains the pointer operand, not the pointee's contents.
//
- // byval also gets llvm.noundef: the caller's original must be defined
- // or UB has already occurred, and the copy inherits that.
+ // llvm.byval(T) records the pre-rewrite arg type because the opaque
+ // LLVM pointer cannot carry it. llvm.nofreeobj holds because a
+ // parameter has automatic storage duration.
//
- // byval does not get llvm.noalias. Classic adds it only under
- // -fpass-by-value-is-noalias for a record that can pass in registers,
- // and that option is not plumbed into CIR.
+ // Two of classic's attributes are missing. llvm.noalias needs
----------------
adams381 wrote:
Added MissingFeatures entries for both and cut the comment back.
https://github.com/llvm/llvm-project/pull/222445
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits