1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -passes=instsimplify < %s | FileCheck %s
4 ; A 0 valued byval pointer may be valid
5 define i1 @byval_may_be_zero(ptr byval(i32) %ptr) null_pointer_is_valid {
6 ; CHECK-LABEL: @byval_may_be_zero(
7 ; CHECK-NEXT: [[CMP:%.*]] = icmp eq ptr [[PTR:%.*]], null
8 ; CHECK-NEXT: ret i1 [[CMP]]
10 %cmp = icmp eq ptr %ptr, null
14 define i1 @nonnull_may_be_zero(ptr nonnull %ptr) null_pointer_is_valid {
15 ; CHECK-LABEL: @nonnull_may_be_zero(
16 ; CHECK-NEXT: ret i1 false
18 %cmp = icmp eq ptr %ptr, null