[PATCH] D88194: [X86] CET endbr enhance

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 27 19:45:53 PDT 2020


craig.topper added inline comments.


================
Comment at: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1352
+      return true;
+    if (std::find(Prefixs.begin(), Prefixs.end(), Byte) == Prefixs.end())
+      return false;
----------------
xiangzhangllvm wrote:
> craig.topper wrote:
> > You don't need an ArrayRef. you can just use std::begin() and std::end() on Bytes
> Done, thank you !!
We shouldn't hard code the size. Its not friendly to change multiple places if the array size changes which is why I suggested std::begin/std::end

But looking again I forgot we have llvm::is_contained in STLExtras.h which would be even better here.


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

https://reviews.llvm.org/D88194



More information about the llvm-commits mailing list