diff options
| author | Sanjay Patel <spatel@rotateright.com> | 2018-01-13 15:44:44 +0000 |
|---|---|---|
| committer | Sanjay Patel <spatel@rotateright.com> | 2018-01-13 15:44:44 +0000 |
| commit | 4158eff0f84781e5449961b5544a2eb441f8a26e (patch) | |
| tree | 44b176cb6fb82f1042b7f2293861541fc6c14dfd /lld/wasm/OutputSegment.h | |
| parent | fda9daeb032b12d97cd96ca9863ebbd036c0d159 (diff) | |
| download | bcm5719-llvm-4158eff0f84781e5449961b5544a2eb441f8a26e.tar.gz bcm5719-llvm-4158eff0f84781e5449961b5544a2eb441f8a26e.zip | |
[InstSimplify] fold implied null ptr check (PR35790)
This extends rL322327 to handle the pointer cast and should solve:
https://bugs.llvm.org/show_bug.cgi?id=35790
Name: or_eq_zero
%isnull = icmp eq i64* %p, null
%x = ptrtoint i64* %p to i64
%somebits = and i64 %x, %y
%somebits_are_zero = icmp eq i64 %somebits, 0
%or = or i1 %somebits_are_zero, %isnull
=>
%or = %somebits_are_zero
Name: and_ne_zero
%isnotnull = icmp ne i64* %p, null
%x = ptrtoint i64* %p to i64
%somebits = and i64 %x, %y
%somebits_are_not_zero = icmp ne i64 %somebits, 0
%and = and i1 %somebits_are_not_zero, %isnotnull
=>
%and = %somebits_are_not_zero
https://rise4fun.com/Alive/CQ3
llvm-svn: 322439
Diffstat (limited to 'lld/wasm/OutputSegment.h')
0 files changed, 0 insertions, 0 deletions

