Skip to content

Commit 381fb1f

Browse files
committed
[𝘀𝗽𝗿] changes to main this commit is based on
Created using spr 1.3.6-beta.1 [skip ci]
1 parent d3daa3c commit 381fb1f

File tree

4 files changed

+39134
-0
lines changed

4 files changed

+39134
-0
lines changed

llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2491,3 +2491,18 @@ bool RISCVTTIImpl::isProfitableToSinkOperands(
24912491
}
24922492
return true;
24932493
}
2494+
2495+
RISCVTTIImpl::TTI::MemCmpExpansionOptions
2496+
RISCVTTIImpl::enableMemCmpExpansion(bool OptSize, bool IsZeroCmp) const {
2497+
TTI::MemCmpExpansionOptions Options;
2498+
// FIXME: Vector haven't been tested.
2499+
Options.AllowOverlappingLoads =
2500+
(ST->enableUnalignedScalarMem() || ST->enableUnalignedVectorMem());
2501+
Options.MaxNumLoads = TLI->getMaxExpandSizeMemcmp(OptSize);
2502+
Options.NumLoadsPerBlock = Options.MaxNumLoads;
2503+
if (ST->is64Bit())
2504+
Options.LoadSizes = {8, 4, 2, 1};
2505+
else
2506+
Options.LoadSizes = {4, 2, 1};
2507+
return Options;
2508+
}

llvm/lib/Target/RISCV/RISCVTargetTransformInfo.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,9 @@ class RISCVTTIImpl : public BasicTTIImplBase<RISCVTTIImpl> {
427427

428428
bool isProfitableToSinkOperands(Instruction *I,
429429
SmallVectorImpl<Use *> &Ops) const;
430+
431+
TTI::MemCmpExpansionOptions enableMemCmpExpansion(bool OptSize,
432+
bool IsZeroCmp) const;
430433
};
431434

432435
} // end namespace llvm

0 commit comments

Comments
 (0)