================
@@ -420,45 +410,66 @@ mlir::Value lowerCirAttrAsValue(mlir::Operation *parentOp,
return value;
}
-void convertSideEffectForCall(mlir::Operation *callOp, bool isNothrow,
- cir::SideEffect sideEffect,
- mlir::LLVM::MemoryEffectsAttr &memoryEffect,
- bool &noUnwind, bool &willReturn,
- bool &noReturn) {
+/// Whether the ABI hands the callee memory through a pointer argument: an
+/// sret slot for an indirect return, or byval / byref for an indirect
+/// argument. Such a function reaches argument memory no matter what its
+/// source-level attributes say, so `const` and `pure` cannot lower to a
+/// memory effect that excludes it.
+static bool hasABIIndirectMemoryArg(mlir::ArrayAttr argAttrs) {
----------------
andykaylor wrote:
Why are we waiting until LowerToLLVM to do this? It seems like we should be
updating the CIR side effects when we rewrite the function call.
https://github.com/llvm/llvm-project/pull/221067
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits