[llvm] [AArch64][GlobalISel] Fix incorrect ABI when tail call not supported (PR #70215)

Amara Emerson via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 25 23:47:53 PDT 2023


aemerson wrote:

> The documentation of `determineAssignments` states that it manipulates its arguments. This looks hacky. Probably `determineAssignments` should return an optional instead. Mutable arguments are an anti pattern.

I don't think we have to be too dogmatic about that. Unnecessary array copies also (minutely) impact compile time which we'd be paying the cost of on every call to `determineAssignments` if we returned an optional. An alternative would be to introduce a new wrapper that's only used for querying and doesn't mutate its arguments, hiding the copying of the input from the caller. Something like `canDetermineAssignments()`?

https://github.com/llvm/llvm-project/pull/70215


More information about the llvm-commits mailing list