In this patch Value::getPointerDereferenceableBytes and
Value::getPointerAlignment are extracted into more powerful versions
living alongside isDereferenceableAndAlignedPointer in
Analysis/Loads.h. The functions have also been enriched wrt. GEP
support and unified wrt. value kinds they can unpack. Thus, the only
"new" logic is concerned with GEP handling everything else is
copied/moved from other places.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
- Build Status
Buildable 37159 Build 37158: arc lint + arc unit
Event Timeline
At least for freestanding environments, it would be useful to separate nonnull completely from deferencable. GCC has a separate flag for it, which might also be a reasonable idea.
If you set the function attribute accordingly that should already work, e.g., null will be considered any other pointer.
Can we remove the CanBeNull argument from getPointerDereferenceableBytes()? It looks like it's currently unused. Or are you planning to use it somewhere?
llvm/include/llvm/Analysis/Loads.h | ||
---|---|---|
82 | Maybe describe what it means if IsKnownDeref is false, in a little more detail? |
This is a good question. For now, there are no users but there is a situation where we could use it: When we derive dereferenceable in the Attributor we also derive nonnull separately, if we would return false for CanBeNull we could update the nonnull attribute directly. Maybe there are other use cases, e.g., use flow information to rule out NULL, but I fail to see where we would exploit those.
For sure I have to describe better what all the combinations of return values would mean.
llvm/test/CodeGen/PowerPC/noPermuteFormasking.ll | ||
---|---|---|
94 | I think you want to first regenerate check-lines in trunk. |
@lebedev.ri There were some concerns and I first have to reevaluate how to address them and achieve value in the move. Long story short, this is halted for now.
This review may be stuck/dead, consider abandoning if no longer relevant.
Removing myself as reviewer in attempt to clean dashboard.
Maybe describe what it means if IsKnownDeref is false, in a little more detail?