[llvm] [InstCombine] Simplify nonnull pointers (PR #128111)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 10 04:37:40 PDT 2025
asmok-g wrote:
Here's a reduction attempt of the whole preprocessed (might be over-reduced):
```
namespace {
template <bool, class a> using b = a;
template <int c> struct ab {
static const int aa = c;
};
template <class d, class e> struct f : ab<__is_convertible(d, e)> {};
template <int> struct g {
template <class, class h, class... i>
using j = g<!h::aa>::template j<h, i...>;
};
template <> struct g<false> {
template <class k, class> using j = k;
};
template <class... l> using m = g<sizeof...(l)>::template j<ab<false>, l...>;
template <class n, class a> struct ac : m<f<n, a>, int> {};
template <class a> struct o {
typedef a p;
p *q;
o() : q() {}
p *operator->() { return q; }
};
template <class a> struct r {
a *q;
int *s;
template <class n, b<ac<n, a>::aa, int> = 0> r(o<n>);
o<a> ad() {
o<a> t;
if (s)
t.q = q;
return t;
}
};
} // namespace
struct ae {
int u[];
};
struct v {
virtual ae y();
};
o<v> af;
struct z : v {
z() : w(af) {}
ae y() {
o x = w.ad();
return x->y();
}
r<v> w;
};
void ag() { z(); }
```
cmd: `clang -fno-exceptions -O3 '-std=gnu++20' reduced.ii -emit-llvm -S -o `
[YutongZhuu](https://github.com/YutongZhuu) can you please take another look?
https://github.com/llvm/llvm-project/pull/128111
More information about the llvm-commits
mailing list