Re: [Scalar masks 2/x] Use bool masks in if-conversion

2015-08-27 Thread Richard Biener
On Wed, Aug 26, 2015 at 5:51 PM, Ilya Enkovich wrote: > 2015-08-26 17:56 GMT+03:00 Richard Biener : >> On Wed, Aug 26, 2015 at 4:38 PM, Ilya Enkovich >> wrote: >>> 2015-08-26 16:02 GMT+03:00 Richard Biener : On Fri, Aug 21, 2015 at 2:17 PM, Ilya Enkovich wrote: > 2015-08-21 14:00

Re: [Scalar masks 2/x] Use bool masks in if-conversion

2015-08-26 Thread Jeff Law
On 08/26/2015 05:13 AM, Ilya Enkovich wrote: 2015-08-26 0:42 GMT+03:00 Jeff Law : On 08/21/2015 04:49 AM, Ilya Enkovich wrote: I want a work with bitmasks to be expressed in a natural way using regular integer operations. Currently all masks manipulations are emulated via vector statements (m

Re: [Scalar masks 2/x] Use bool masks in if-conversion

2015-08-26 Thread Ilya Enkovich
2015-08-26 17:56 GMT+03:00 Richard Biener : > On Wed, Aug 26, 2015 at 4:38 PM, Ilya Enkovich wrote: >> 2015-08-26 16:02 GMT+03:00 Richard Biener : >>> On Fri, Aug 21, 2015 at 2:17 PM, Ilya Enkovich >>> wrote: 2015-08-21 14:00 GMT+03:00 Richard Biener : > > Hmm, I don't see how vecto

Re: [Scalar masks 2/x] Use bool masks in if-conversion

2015-08-26 Thread Jakub Jelinek
On Wed, Aug 26, 2015 at 04:56:23PM +0200, Richard Biener wrote: > >> How do you declare those? > > > > Something like this: > > > > #pragma omp declare simd inbranch > > int foo(int*); > > The 'inbranch' is the thing that matters? And all of foo is then > implicitely predicated? If it is #pragma

Re: [Scalar masks 2/x] Use bool masks in if-conversion

2015-08-26 Thread Richard Biener
On Wed, Aug 26, 2015 at 4:38 PM, Ilya Enkovich wrote: > 2015-08-26 16:02 GMT+03:00 Richard Biener : >> On Fri, Aug 21, 2015 at 2:17 PM, Ilya Enkovich >> wrote: >>> 2015-08-21 14:00 GMT+03:00 Richard Biener : Hmm, I don't see how vector masks are more difficult to operate with. >>> >>>

Re: [Scalar masks 2/x] Use bool masks in if-conversion

2015-08-26 Thread Ilya Enkovich
2015-08-26 16:02 GMT+03:00 Richard Biener : > On Fri, Aug 21, 2015 at 2:17 PM, Ilya Enkovich wrote: >> 2015-08-21 14:00 GMT+03:00 Richard Biener : >>> >>> Hmm, I don't see how vector masks are more difficult to operate with. >> >> There are just no instructions for that but you have to pretend you

Re: [Scalar masks 2/x] Use bool masks in if-conversion

2015-08-26 Thread Richard Biener
On Wed, Aug 26, 2015 at 3:35 PM, Jakub Jelinek wrote: > On Wed, Aug 26, 2015 at 03:21:52PM +0200, Richard Biener wrote: >> On Wed, Aug 26, 2015 at 3:16 PM, Jakub Jelinek wrote: >> > On Wed, Aug 26, 2015 at 03:02:02PM +0200, Richard Biener wrote: >> >> > AVX-512 is such target. Current representat

Re: [Scalar masks 2/x] Use bool masks in if-conversion

2015-08-26 Thread Jakub Jelinek
On Wed, Aug 26, 2015 at 03:21:52PM +0200, Richard Biener wrote: > On Wed, Aug 26, 2015 at 3:16 PM, Jakub Jelinek wrote: > > On Wed, Aug 26, 2015 at 03:02:02PM +0200, Richard Biener wrote: > >> > AVX-512 is such target. Current representation forces multiple scalar > >> > mask -> vector mask and ba

Re: [Scalar masks 2/x] Use bool masks in if-conversion

2015-08-26 Thread Richard Biener
On Wed, Aug 26, 2015 at 3:16 PM, Jakub Jelinek wrote: > On Wed, Aug 26, 2015 at 03:02:02PM +0200, Richard Biener wrote: >> > AVX-512 is such target. Current representation forces multiple scalar >> > mask -> vector mask and back transformations which are artificially >> > introduced by current boo

Re: [Scalar masks 2/x] Use bool masks in if-conversion

2015-08-26 Thread Jakub Jelinek
On Wed, Aug 26, 2015 at 03:02:02PM +0200, Richard Biener wrote: > > AVX-512 is such target. Current representation forces multiple scalar > > mask -> vector mask and back transformations which are artificially > > introduced by current bool patterns and are hard to optimize out. > > I dislike the

Re: [Scalar masks 2/x] Use bool masks in if-conversion

2015-08-26 Thread Richard Biener
On Wed, Aug 26, 2015 at 1:13 PM, Ilya Enkovich wrote: > 2015-08-26 0:42 GMT+03:00 Jeff Law : >> On 08/21/2015 04:49 AM, Ilya Enkovich wrote: >>> >>> >>> I want a work with bitmasks to be expressed in a natural way using >>> regular integer operations. Currently all masks manipulations are >>> emul

Re: [Scalar masks 2/x] Use bool masks in if-conversion

2015-08-26 Thread Richard Biener
On Fri, Aug 21, 2015 at 2:17 PM, Ilya Enkovich wrote: > 2015-08-21 14:00 GMT+03:00 Richard Biener : >> On Fri, Aug 21, 2015 at 12:49 PM, Ilya Enkovich >> wrote: >>> 2015-08-21 11:15 GMT+03:00 Richard Biener : On Thu, Aug 20, 2015 at 8:46 PM, Jeff Law wrote: > On 08/17/2015 10:25 AM, Il

Re: [Scalar masks 2/x] Use bool masks in if-conversion

2015-08-26 Thread Ilya Enkovich
2015-08-26 0:42 GMT+03:00 Jeff Law : > On 08/21/2015 04:49 AM, Ilya Enkovich wrote: >> >> >> I want a work with bitmasks to be expressed in a natural way using >> regular integer operations. Currently all masks manipulations are >> emulated via vector statements (mostly using a bunch of vec_cond).

Re: [Scalar masks 2/x] Use bool masks in if-conversion

2015-08-26 Thread Ilya Enkovich
2015-08-26 0:26 GMT+03:00 Jeff Law : > On 08/21/2015 06:17 AM, Ilya Enkovich wrote: >>> >>> >>> Hmm, I don't see how vector masks are more difficult to operate with. >> >> >> There are just no instructions for that but you have to pretend you >> have to get code vectorized. >> >>> Also accordi

Re: [Scalar masks 2/x] Use bool masks in if-conversion

2015-08-25 Thread Jeff Law
On 08/21/2015 04:49 AM, Ilya Enkovich wrote: I want a work with bitmasks to be expressed in a natural way using regular integer operations. Currently all masks manipulations are emulated via vector statements (mostly using a bunch of vec_cond). For complex predicates it may be nontrivial to tran

Re: [Scalar masks 2/x] Use bool masks in if-conversion

2015-08-25 Thread Jeff Law
On 08/21/2015 06:17 AM, Ilya Enkovich wrote: Hmm, I don't see how vector masks are more difficult to operate with. There are just no instructions for that but you have to pretend you have to get code vectorized. Also according to vector ABI integer mask should be used for mask operand in c

Re: [Scalar masks 2/x] Use bool masks in if-conversion

2015-08-21 Thread Jeff Law
On 08/21/2015 02:15 AM, Richard Biener wrote: Indeed. I don't remember my exact comments during the talk at the Cauldron but the scheme used there was sth like mask = GEN_MASK ; b = a + 1; x = VEC_COND to model conditional execution already at the if-conversion stage (for all scalar stmts ma

Re: [Scalar masks 2/x] Use bool masks in if-conversion

2015-08-21 Thread Ilya Enkovich
2015-08-21 14:00 GMT+03:00 Richard Biener : > On Fri, Aug 21, 2015 at 12:49 PM, Ilya Enkovich > wrote: >> 2015-08-21 11:15 GMT+03:00 Richard Biener : >>> On Thu, Aug 20, 2015 at 8:46 PM, Jeff Law wrote: On 08/17/2015 10:25 AM, Ilya Enkovich wrote: > > Hi, > > This patch into

Re: [Scalar masks 2/x] Use bool masks in if-conversion

2015-08-21 Thread Richard Biener
On Fri, Aug 21, 2015 at 12:49 PM, Ilya Enkovich wrote: > 2015-08-21 11:15 GMT+03:00 Richard Biener : >> On Thu, Aug 20, 2015 at 8:46 PM, Jeff Law wrote: >>> On 08/17/2015 10:25 AM, Ilya Enkovich wrote: Hi, This patch intoriduces a new vectorizer hook use_scalar_mask_p which >>

Re: [Scalar masks 2/x] Use bool masks in if-conversion

2015-08-21 Thread Ilya Enkovich
2015-08-21 11:15 GMT+03:00 Richard Biener : > On Thu, Aug 20, 2015 at 8:46 PM, Jeff Law wrote: >> On 08/17/2015 10:25 AM, Ilya Enkovich wrote: >>> >>> Hi, >>> >>> This patch intoriduces a new vectorizer hook use_scalar_mask_p which >>> affects code generated by if-conversion pass (and affects patt

Re: [Scalar masks 2/x] Use bool masks in if-conversion

2015-08-21 Thread Richard Biener
On Thu, Aug 20, 2015 at 8:46 PM, Jeff Law wrote: > On 08/17/2015 10:25 AM, Ilya Enkovich wrote: >> >> Hi, >> >> This patch intoriduces a new vectorizer hook use_scalar_mask_p which >> affects code generated by if-conversion pass (and affects patterns in later >> patches). >> >> Thanks, >> Ilya >>

Re: [Scalar masks 2/x] Use bool masks in if-conversion

2015-08-20 Thread Jeff Law
On 08/17/2015 10:25 AM, Ilya Enkovich wrote: Hi, This patch intoriduces a new vectorizer hook use_scalar_mask_p which affects code generated by if-conversion pass (and affects patterns in later patches). Thanks, Ilya -- 2015-08-17 Ilya Enkovich * doc/tm.texi (TARGET_VECTORIZE_USE_S