mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-25 10:27:04 +00:00
Refactor code to use new attribute getters on CallSite for NoCapture and ByVal.
Suggested in code review by Eli. That code in InstCombine looks kinda suspicious. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145013 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -950,7 +950,7 @@ bool MemCpyOpt::iterateOnFunction(Function &F) {
|
||||
RepeatInstruction = processMemMove(M);
|
||||
else if (CallSite CS = (Value*)I) {
|
||||
for (unsigned i = 0, e = CS.arg_size(); i != e; ++i)
|
||||
if (CS.paramHasAttr(i+1, Attribute::ByVal))
|
||||
if (CS.isByValArgument(i))
|
||||
MadeChange |= processByValArgument(CS, i);
|
||||
}
|
||||
|
||||
|
||||
@@ -2534,13 +2534,12 @@ isOnlyCopiedFromConstantGlobal(Value *V, MemTransferInst *&TheCopy,
|
||||
// ignore it if we know that the value isn't captured.
|
||||
unsigned ArgNo = CS.getArgumentNo(UI);
|
||||
if (CS.onlyReadsMemory() &&
|
||||
(CS.getInstruction()->use_empty() ||
|
||||
CS.paramHasAttr(ArgNo+1, Attribute::NoCapture)))
|
||||
(CS.getInstruction()->use_empty() || CS.doesNotCapture(ArgNo)))
|
||||
continue;
|
||||
|
||||
// If this is being passed as a byval argument, the caller is making a
|
||||
// copy, so it is only a read of the alloca.
|
||||
if (CS.paramHasAttr(ArgNo+1, Attribute::ByVal))
|
||||
if (CS.isByValArgument(ArgNo))
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user