[PATCH] D130956: [X86][MC] Always emit `rep` prefix for `bsf`

Phoebe Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 2 01:23:00 PDT 2022


pengfei added inline comments.


================
Comment at: llvm/lib/Target/X86/X86MCInstLower.cpp:987
+    // recognize as TZCNT, which has better performance than BSF.
+    if (X86::isBSF(OutMI.getOpcode()))
+      OutMI.setFlags(X86::IP_HAS_REPEAT);
----------------
skan wrote:
> craig.topper wrote:
> > skan wrote:
> > > Do we need to check any target feature here?
> > I don’t think so.
> > 
> > Probably should skip for minsize though?
> I think it's a good suggestion.
Agreed. And good point! Added check for minsize.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130956/new/

https://reviews.llvm.org/D130956



More information about the llvm-commits mailing list