[PATCH] D40670: Let Alloca treated as nonnull for any alloca addr space value
Matt Arsenault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 1 09:25:16 PST 2017
arsenm added a comment.
In https://reviews.llvm.org/D40670#942316, @yaxunl wrote:
> In https://reviews.llvm.org/D40670#942232, @yaxunl wrote:
>
> > In https://reviews.llvm.org/D40670#941244, @nlopes wrote:
> >
> > > This change is incorrect. null can be a valid pointer in a non-0 address space, and alloca may return it.
> > > If your target's address space guarantees that alloca doesn't return null, then we can probably make this target-dependent. But we cannot simply make it unconditional; that's not correct.
> >
> >
> > If whether alloca inst can be zero depending on target, then we need to make it target dependent. I will see if I can add this to TargetTransformInfo.
>
>
> Well, this will incur lots of interface changes. Essentially all value tracking functions and passes relying on value tracking will require TargetTransformInfo. Do we want to do that?
>
> On the other hand, on which specific target alloca inst could be null? As Matt said, alloca cannot be used to represent malloc, why alloca inst could be null?
AMDGPU currently has a workaround to avoid alloca ever returning 0. 0 is a valid pointer though. What we really want to represent is that alloca never returns an invalid pointer, not that it never has a 0 value
https://reviews.llvm.org/D40670
More information about the llvm-commits
mailing list