[LLVMdev] Ideas for representing vector gather/scatter and masks in LLVM IR

David Greene dag at cray.com
Wed Aug 13 08:30:09 PDT 2008


On Tuesday 12 August 2008 16:55, Daniel Berlin wrote:

> > With applymask, things look something like this:
> >
> > applymask:
> > %m1 = ...
> > %m2 = ...
> > %r5 = applymask %r2, %m1
> > %r6 = applymask %r3, %m1
> > %r7 = applymask %r2, %m2
> > %r8 = applymask %r3, %m2
> > %r1 = add %r5, %r6
> > %r4 = add %r7, %r8
> >
> > This is interesting because CSE will not do the optimization since the
> > operands of the adds are different.
>
> LLVM's main CSE these days is really GVN based.
> GVN should happily compute these to be the same value, and if it
> doesn't, you have much larger problems.

Eh?  How can these compute the same thing if the masks are different?

                                                   -Dave



More information about the llvm-dev mailing list