[PATCH] D129468: [NFC] Fix compile time regression seen on some benchmarks after a630ea3003 commit
Duncan P. N. Exon Smith via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 11 12:41:56 PDT 2022
dexonsmith added inline comments.
================
Comment at: llvm/lib/Analysis/TypeBasedAliasAnalysis.cpp:306
bool NewFormat = isNewFormat();
+ const ArrayRef<MDOperand> Operands(Node->op_begin(), Node->op_end());
+ const unsigned NumOperands = Operands.size();
----------------
yurai007 wrote:
> nikic wrote:
> > Can use `Node->operands()` here?
> Unfortunately not. I tried this initially, but there is no simple conversion from iterator_range<const llvm::MDOperand *> to MutableArrayRef/ArrayRef<llvm::MDOperand>. Also making Operands iterator_range complicates things with indexing and getting size so ended up with passing iterators directly to ArrayRef.
As a prep / follow-up, it might be reasonable to update `operands()` to return ArrayRef.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D129468/new/
https://reviews.llvm.org/D129468
More information about the llvm-commits
mailing list