On Wed, Mar 18, 2015 at 1:25 PM, Ian Romanick <i...@freedesktop.org> wrote: > From: Ian Romanick <ian.d.roman...@intel.com> > > We use the idoim
typo: idiom > > ir_foo *x = y->as_foo(); > if (x == NULL) > return; > > all over the place. GCC generates some quite lovely code for this. > One such example: > > 340a5b: 83 7d 18 04 cmpl $0x4,0x18(%rbp) > 340a5f: 0f 85 06 04 00 00 jne 340e6b > 340a65: 48 85 ed test %rbp,%rbp > 340a68: 0f 84 fd 03 00 00 je 340e6b > > This case used as_expression() (ir_type_expression is 4). Note that it > checkes the ir_type, then checks that the pointer isn't NULL. There is typo: checks Like Ilia said, this is probably the perfect use for assume. Using assume, Reviewed-by: Matt Turner <matts...@gmail.com> _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev