[PATCH] D48877: [X86][BtVer2][MCA] Recognize CMPEQ one-idioms

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 4 04:43:50 PDT 2018


RKSimon added a comment.

In https://reviews.llvm.org/D48877#1152009, @lebedev.ri wrote:

> In https://reviews.llvm.org/D48877#1151974, @RKSimon wrote:
>
> > In https://reviews.llvm.org/D48877#1151042, @lebedev.ri wrote:
> >
> > > Hmm, so if they still consume resources, does this mean it is the lack of latency is what making them special?
> >
> >
> > The PCMPEQ 'all ones' idiom is a regular instruction - it consumes resources and has a latency before its result is available for any instructions that depend on it.
> >
> > What it doesn't have to do is wait for its source resisters to be available:
> >
> >   VDIVPS %xmm1, %xmm0, %xmm0    <---- Big latency 
> >   VPCMPEQB %xmm1, %xmm0, %xmm0  <---- Must wait a loooooong time until VDIVPS has completed
> >
> >
> > vs
> >
> >   VDIVPS %xmm1, %xmm0, %xmm0    <---- Big latency 
> >   VPCMPEQB %xmm0, %xmm0, %xmm0  <---- 'Ones Idiom' - can execute immediately, doesn't wait for VDIVPS 
> >
>
>
> Ok, well, i guess what i was trying to ask/understand is, is that already properly represented https://godbolt.org/g/9rYPYA, or not?


No, we don't properly model dependency breaking instructions yet - zero-idioms are making use of a special case of llvm-mca that assumes dependency breaking if no resources are used - IMO that's something that should be removed and we come up with a better way to model this.


Repository:
  rL LLVM

https://reviews.llvm.org/D48877





More information about the llvm-commits mailing list