[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 02:46:37 PDT 2018


RKSimon added a comment.

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 


Repository:
  rL LLVM

https://reviews.llvm.org/D48877





More information about the llvm-commits mailing list