I found that getArgumentAliasingToReturnedPointer (which calls this function) is used at isKnownNonZero with the following pattern:
if (const auto *RP = getArgumentAliasingToReturnedPointer(Call)) return isKnownNonZero(RP, Depth, Q);
which seems to assume that the non-zeroness of the result of a function call is equivalent to the non-zeroness of the first argument. isKnownNonZero should be fixed, or maybe we can add a boolean flag to isIntrinsicReturningPointerAliasingArgumentWithoutCapturing that allows callers to determine its purpose?
Value::stripPointerCasts() is sometimes used with the same assumption but there is it also not given (due to address space casts). In D61607 I try to introduce a version that "keeps the bit pattern the same" to fix uses that put the result in to isKnownNonZero-like functions.
That said, I guess you can introduce an