On Wed, Apr 28, 2021 at 3:32 PM Richard Biener wrote: > > On Wed, 28 Apr 2021, Uros Bizjak wrote: > > > On Wed, Apr 28, 2021 at 1:46 PM Richard Biener wrote: > > > > > > On Wed, 28 Apr 2021, Uros Bizjak wrote: > > > > > > > On Wed, Apr 28, 2021 at 1:02 PM Richard Biener wrote: > > > > > > > > > > This arranges for the x86 AVX and AVX2 masked load builtins to be > > > > > pure to enable dead code elimination and more appropriate alias > > > > > analysis. > > > > > > > > > > Bootstrapped and tested on x86_64-unknown-linux-gnu. OK for trunk? > > > > > > > > > > Thanks, > > > > > Richard. > > > > > > > > > > 2021-04-28 Richard Biener > > > > > > > > > > PR target/100312 > > > > > * config/i386/i386-builtin.def (IX86_BUILTIN_MASKLOADPD, > > > > > IX86_BUILTIN_MASKLOADPS, IX86_BUILTIN_MASKLOADPD256, > > > > > IX86_BUILTIN_MASKLOADPS256, IX86_BUILTIN_MASKLOADD, > > > > > IX86_BUILTIN_MASKLOADQ, IX86_BUILTIN_MASKLOADD256, > > > > > IX86_BUILTIN_MASKLOADQ256): Remove. > > > > > * config/i386/i386-builtins.h (ix86_builtins): Add entries for > > > > > IX86_BUILTIN_MASKLOADPD, IX86_BUILTIN_MASKLOADPS, > > > > > IX86_BUILTIN_MASKLOADPD256, IX86_BUILTIN_MASKLOADPS256, > > > > > IX86_BUILTIN_MASKLOADD, IX86_BUILTIN_MASKLOADQ, > > > > > IX86_BUILTIN_MASKLOADD256, and IX86_BUILTIN_MASKLOADQ256. > > > > > * config/i386/i386-builtins.c (ix86_init_mmx_sse_builtins): > > > > > Initialize IX86_BUILTIN_MASKLOADPD, IX86_BUILTIN_MASKLOADPS, > > > > > IX86_BUILTIN_MASKLOADPD256, IX86_BUILTIN_MASKLOADPS256, > > > > > IX86_BUILTIN_MASKLOADD, IX86_BUILTIN_MASKLOADQ, > > > > > IX86_BUILTIN_MASKLOADD256, and IX86_BUILTIN_MASKLOADQ256 > > > > > as pure builtins. > > > > > > > > OK. > > > > > > Whoops - somehow I posted the wrong version. The version posted > > > ICEs because I failed to realize I'd have to explicitely handle > > > those builtins in ix86_expand_builtin. What bootstrapped and > > > tested OK is the version below. > > > > > > Is that version also OK? > > > > Hm, your previous version removed mentioned builtins from builtins.def > > and initialized them in ix86_init_mmx_sse_builtins by hand (this seems > > to be the preferred way). This should work, so I really don't see why > > the previous approach would result in ICE. > > It eventually runs into the gcc_unreachable () at the very end of > ix86_expand_builtin since IX86_BUILTIN_MASKLOADD and friends are > no longer in the range of IX86_BUILTIN__BDESC_SPECIAL_ARGS_FIRST > to IX86_BUILTIN__BDESC_SPECIAL_ARGS_LAST. How about the attached (untested) patch then? Uros.