Displaying 15 results from an estimated 15 matches for "null_check".
2016 Dec 14
2
analysis based on nonnull attribute
...mation about subsequent
uses of that value outside of the function that has the attribute?
Example:
define i1 @bar(i32* nonnull %x) { ; %x must be non-null in this function
%y = load i32, i32* %x
%z = icmp ugt i32 %y, 23
ret i1 %z
}
define i1 @foo(i32* %x) {
%d = call i1 @bar(i32* %x)
%null_check = icmp eq i32* %x, null ; check if null after call that
guarantees non-null?
br i1 %null_check, label %t, label %f
t:
ret i1 1
f:
ret i1 %d
}
$ opt -inline nonnull.ll -S
...
define i1 @foo(i32* %x) {
%y.i = load i32, i32* %x ; inlined and non-null knowledge is lost?
%z.i = icmp ugt i...
2016 Dec 14
0
analysis based on nonnull attribute
...ation can be used to optimize the caller as well.
> Example:
> define i1 @bar(i32* nonnull %x) { ; %x must be non-null in this
> function
> %y = load i32, i32* %x
> %z = icmp ugt i32 %y, 23
> ret i1 %z
> }
> define i1 @foo(i32* %x) {
> %d = call i1 @bar(i32* %x)
> %null_check = icmp eq i32* %x, null ; check if null after call that
> guarantees non-null?
> br i1 %null_check, label %t, label %f
> t:
> ret i1 1
> f:
> ret i1 %d
> }
> $ opt -inline nonnull.ll -S
> ...
> define i1 @foo(i32* %x) {
> %y.i = load i32, i32* %x ; inlined and non-...
2016 Dec 14
2
analysis based on nonnull attribute
...ugs/show_bug.cgi?id=28430
>
>
> Example:
>
> define i1 @bar(i32* nonnull %x) { ; %x must be non-null in this function
> %y = load i32, i32* %x
> %z = icmp ugt i32 %y, 23
> ret i1 %z
> }
>
> define i1 @foo(i32* %x) {
> %d = call i1 @bar(i32* %x)
> %null_check = icmp eq i32* %x, null ; check if null after call that
> guarantees non-null?
> br i1 %null_check, label %t, label %f
> t:
> ret i1 1
> f:
> ret i1 %d
> }
>
> $ opt -inline nonnull.ll -S
> ...
> define i1 @foo(i32* %x) {
> %y.i = load i32, i32* %x ;...
2016 Dec 14
0
analysis based on nonnull attribute
...ad i32, i32* %x
> >
>
> > > %z = icmp ugt i32 %y, 23
> >
>
> > > ret i1 %z
> >
>
> > > }
> >
>
> > > define i1 @foo(i32* %x) {
> >
>
> > > %d = call i1 @bar(i32* %x)
> >
>
> > > %null_check = icmp eq i32* %x, null ; check if null after call
> > > that
> > > guarantees non-null?
> >
>
> > > br i1 %null_check, label %t, label %f
> >
>
> > > t:
> >
>
> > > ret i1 1
> >
>
> > > f:
> >...
2015 Oct 19
3
Managed Languages BOF @ Dev Meeting
...g a few instructions after a security-critical check has failed is not always a good thing to do) so I agree that it’s a good idea to avoid depending on it.
> So we'd
> have to do repeat the null checks in the unwind block, like
>
> superblock: # unwinds to unwind_block
> null_check(ptr_a)
> do_something
> null_check(ptr_b)
> do_something_again
>
> unwind_block:
> ;; either ptr_a is null or ptr_b is null
> if (ptr_a == null)
> throw_nullptrexception(bci = 42)
> else ;; if (ptr_b == null)
> throw_nullptrexception(bci =...
2016 Dec 15
2
analysis based on nonnull attribute
...gt; Example:
>>
>> define i1 @bar(i32* nonnull %x) { ; %x must be non-null in this function
>> %y = load i32, i32* %x
>> %z = icmp ugt i32 %y, 23
>> ret i1 %z
>> }
>>
>> define i1 @foo(i32* %x) {
>> %d = call i1 @bar(i32* %x)
>> %null_check = icmp eq i32* %x, null ; check if null after call that
>> guarantees non-null?
>> br i1 %null_check, label %t, label %f
>> t:
>> ret i1 1
>> f:
>> ret i1 %d
>> }
>>
>> $ opt -inline nonnull.ll -S
>> ...
>> define i1 @foo(i32...
2016 Dec 15
0
analysis based on nonnull attribute
...> }
> > > >
> > >
> >
>
> > > > > define i1 @foo(i32* %x) {
> > > >
> > >
> >
>
> > > > > %d = call i1 @bar(i32* %x)
> > > >
> > >
> >
>
> > > > > %null_check = icmp eq i32* %x, null ; check if null after
> > > > > call
> > > > > that
> > > > > guarantees non-null?
> > > >
> > >
> >
>
> > > > > br i1 %null_check, label %t, label %f
> > > >
> >...
2015 Oct 18
3
Managed Languages BOF @ Dev Meeting
I won’t be able to attend, but I’d be interested in hearing if any conclusions are reached on several of these topics:
> On 16 Oct 2015, at 21:27, Joe Ranieri via llvm-dev <llvm-dev at lists.llvm.org> wrote:
>
> - Dealing with the explosion of basic blocks that come up with
> languages where almost every function call, implicit and explicit, can
> raise exceptions.
This
2016 Dec 16
2
analysis based on nonnull attribute
...efine i1 @bar(i32* nonnull %x) { ; %x must be non-null in this function
>>> %y = load i32, i32* %x
>>> %z = icmp ugt i32 %y, 23
>>> ret i1 %z
>>> }
>>>
>>> define i1 @foo(i32* %x) {
>>> %d = call i1 @bar(i32* %x)
>>> %null_check = icmp eq i32* %x, null ; check if null after call that
>>> guarantees non-null?
>>> br i1 %null_check, label %t, label %f
>>> t:
>>> ret i1 1
>>> f:
>>> ret i1 %d
>>> }
>>>
>>> $ opt -inline nonnull.ll -S
>...
2016 Dec 16
0
analysis based on nonnull attribute
...y = load i32, i32* %x
> %z = icmp ugt i32 %y, 23
> ret i1 %z
> }
>
> define i1 @foo(i32* %x) {
> %d = call i1 @bar(i32* %x)
> %null_check = icmp eq i32* %x, null ; check
> if null after call that guarantees non-null?
> br i1 %null_check, label %t, label %f
> t:
> ret i1 1
> f:
>...
2016 Dec 16
3
analysis based on nonnull attribute
...; %x must be non-null in this function
>>>> %y = load i32, i32* %x
>>>> %z = icmp ugt i32 %y, 23
>>>> ret i1 %z
>>>> }
>>>>
>>>> define i1 @foo(i32* %x) {
>>>> %d = call i1 @bar(i32* %x)
>>>> %null_check = icmp eq i32* %x, null ; check if null after call that
>>>> guarantees non-null?
>>>> br i1 %null_check, label %t, label %f
>>>> t:
>>>> ret i1 1
>>>> f:
>>>> ret i1 %d
>>>> }
>>>>
>>>>...
2016 Dec 16
0
analysis based on nonnull attribute
...%z = icmp ugt i32 %y, 23
>> ret i1 %z
>> }
>>
>> define i1 @foo(i32* %x) {
>> %d = call i1 @bar(i32* %x)
>> %null_check = icmp eq i32* %x, null ;
>> check if null after call that guarantees
>> non-null?
>> br i1 %null_check, label %t, label %f
>> t:
>>...
2016 Dec 16
2
analysis based on nonnull attribute
...unction
>>>>> %y = load i32, i32* %x
>>>>> %z = icmp ugt i32 %y, 23
>>>>> ret i1 %z
>>>>> }
>>>>>
>>>>> define i1 @foo(i32* %x) {
>>>>> %d = call i1 @bar(i32* %x)
>>>>> %null_check = icmp eq i32* %x, null ; check if null after call that
>>>>> guarantees non-null?
>>>>> br i1 %null_check, label %t, label %f
>>>>> t:
>>>>> ret i1 1
>>>>> f:
>>>>> ret i1 %d
>>>>> }
>...
2016 Dec 16
1
analysis based on nonnull attribute
...unction
>>>>> %y = load i32, i32* %x
>>>>> %z = icmp ugt i32 %y, 23
>>>>> ret i1 %z
>>>>> }
>>>>>
>>>>> define i1 @foo(i32* %x) {
>>>>> %d = call i1 @bar(i32* %x)
>>>>> %null_check = icmp eq i32* %x, null ; check if null after call that
>>>>> guarantees non-null?
>>>>> br i1 %null_check, label %t, label %f
>>>>> t:
>>>>> ret i1 1
>>>>> f:
>>>>> ret i1 %d
>>>>> }
>...
2016 Dec 19
0
analysis based on nonnull attribute
...%y = load i32, i32* %x
>>>>>> %z = icmp ugt i32 %y, 23
>>>>>> ret i1 %z
>>>>>> }
>>>>>>
>>>>>> define i1 @foo(i32* %x) {
>>>>>> %d = call i1 @bar(i32* %x)
>>>>>> %null_check = icmp eq i32* %x, null ; check if null after call that
>>>>>> guarantees non-null?
>>>>>> br i1 %null_check, label %t, label %f
>>>>>> t:
>>>>>> ret i1 1
>>>>>> f:
>>>>>> ret i1 %d
>...