mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 18:54:02 +01:00
Add options for MaxLoadsPerMemcmp(OptSize).
Reviewers: davidxl Reviewed By: davidxl Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60587 llvm-svn: 358287
This commit is contained in:
parent
5ecc27dbb9
commit
82f5563b0e
@ -36,6 +36,14 @@ static cl::opt<unsigned> MemCmpEqZeroNumLoadsPerBlock(
|
||||
cl::desc("The number of loads per basic block for inline expansion of "
|
||||
"memcmp that is only being compared against zero."));
|
||||
|
||||
static cl::opt<unsigned> MaxLoadsPerMemcmp(
|
||||
"max-loads-per-memcmp", cl::Hidden,
|
||||
cl::desc("Set maximum number of loads used in expanded memcmp"));
|
||||
|
||||
static cl::opt<unsigned> MaxLoadsPerMemcmpOptSize(
|
||||
"max-loads-per-memcmp-opt-size", cl::Hidden,
|
||||
cl::desc("Set maximum number of loads used in expanded memcmp for -Os/Oz"));
|
||||
|
||||
namespace {
|
||||
|
||||
|
||||
@ -741,8 +749,13 @@ static bool expandMemCmp(CallInst *CI, const TargetTransformInfo *TTI,
|
||||
const auto *const Options = TTI->enableMemCmpExpansion(IsUsedForZeroCmp);
|
||||
if (!Options) return false;
|
||||
|
||||
const unsigned MaxNumLoads =
|
||||
TLI->getMaxExpandSizeMemcmp(CI->getFunction()->hasOptSize());
|
||||
const unsigned MaxNumLoads = CI->getFunction()->hasOptSize()
|
||||
? (MaxLoadsPerMemcmpOptSize.getNumOccurrences()
|
||||
? MaxLoadsPerMemcmpOptSize
|
||||
: TLI->getMaxExpandSizeMemcmp(true))
|
||||
: (MaxLoadsPerMemcmp.getNumOccurrences()
|
||||
? MaxLoadsPerMemcmp
|
||||
: TLI->getMaxExpandSizeMemcmp(false));
|
||||
|
||||
unsigned NumLoadsPerBlock = MemCmpEqZeroNumLoadsPerBlock.getNumOccurrences()
|
||||
? MemCmpEqZeroNumLoadsPerBlock
|
||||
|
Loading…
Reference in New Issue
Block a user