[PATCH] D75098: Add TCOPY, a terminator form of the COPY instr
Bill Wendling via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 27 16:11:27 PST 2020
void marked an inline comment as done.
void added inline comments.
================
Comment at: llvm/lib/CodeGen/MachineSink.cpp:845
MachineBasicBlock::iterator InsertPos,
+ const TargetInstrInfo *TII,
SmallVectorImpl<MachineInstr *> &DbgValuesToSink) {
----------------
nickdesaulniers wrote:
> void wrote:
> > nickdesaulniers wrote:
> > > pass as `const&`, or make `performSink` a private method.
> > Two different passes use this function so it can't be made a private method. I"m not sure why passing it as "const&" is better than a "const*"...
> Generally, passing by const reference indicates that a parameter is strictly an input, as opposed to both input AND output, which is why you don't see a mix of pointers and references in this function signature.
A 'const*' doesn't allow modifications either. Also note that none of the references in this function signature are 'const', and are probably passed by reference because they aren't pointers (`SuccToSinkto` notwithstanding) in the originating function. Converting this to a reference is not useful.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D75098/new/
https://reviews.llvm.org/D75098
More information about the llvm-commits
mailing list