Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
- Build Status
Buildable 31592 Build 31591: arc lint + arc unit
Event Timeline
I'd look into this but I have trouble locating the "ptrmask" intrinsic in LLVM/Clang/LangRef. Could you help me out?
llvm/lib/Analysis/ValueTracking.cpp | ||
---|---|---|
3702 | 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? |
llvm/lib/Analysis/ValueTracking.cpp | ||
---|---|---|
3702 | 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 |
Handle nonnullness requirement for the use of getArgumentAliasingToReturnedPointer
in isKnownNonZero, as suggested.
Also simplified the test.
I found that getArgumentAliasingToReturnedPointer (which calls this function) is used at isKnownNonZero with the following pattern:
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?